|
|
@ -55,7 +55,7 @@ |
|
|
|
|
|
|
|
<body> |
|
|
|
<header> |
|
|
|
<aside>December 4, 2024</aside> |
|
|
|
<aside>December 5, 2024</aside> |
|
|
|
<a href="https://gto76.github.io" rel="author">Jure Šorn</a> |
|
|
|
</header> |
|
|
|
|
|
|
@ -1602,7 +1602,7 @@ CompletedProcess(args=[<span class="hljs-string">'bc'</span>, <span class="hljs- |
|
|
|
<span class="hljs-keyword">from</span> sqlalchemy <span class="hljs-keyword">import</span> create_engine, text |
|
|
|
<engine> = create_engine(<span class="hljs-string">'<url>'</span>) <span class="hljs-comment"># Url: 'dialect://user:password@host/dbname'.</span> |
|
|
|
<conn> = <engine>.connect() <span class="hljs-comment"># Creates a connection. Also <conn>.close().</span> |
|
|
|
<cursor> = <conn>.execute(text(<span class="hljs-string">'<query>'</span>), …) <span class="hljs-comment"># Replaces ':<key>'s with keyword arguments.</span> |
|
|
|
<cursor> = <conn>.execute(text(<span class="hljs-string">'<query>'</span>), …) <span class="hljs-comment"># `<dict>`. Replaces ':<key>'s with values.</span> |
|
|
|
<span class="hljs-keyword">with</span> <conn>.begin(): ... <span class="hljs-comment"># Exits the block with commit or rollback.</span> |
|
|
|
</code></pre></div> |
|
|
|
|
|
|
@ -2924,7 +2924,7 @@ $ deactivate <span class="hljs-comment"># Deactivates the active |
|
|
|
|
|
|
|
|
|
|
|
<footer> |
|
|
|
<aside>December 4, 2024</aside> |
|
|
|
<aside>December 5, 2024</aside> |
|
|
|
<a href="https://gto76.github.io" rel="author">Jure Šorn</a> |
|
|
|
</footer> |
|
|
|
|
|
|
|