Browse Source

SQLite

pull/135/merge
Jure Šorn 2 months ago
parent
commit
449b7cf2dd
2 changed files with 4 additions and 4 deletions
  1. 2
      README.md
  2. 6
      index.html

2
README.md

@ -1938,7 +1938,7 @@ with <conn>: # Exits the block with commit() o
from sqlalchemy import create_engine, text
<engine> = create_engine('<url>') # Url: 'dialect://user:password@host/dbname'.
<conn> = <engine>.connect() # Creates a connection. Also <conn>.close().
<cursor> = <conn>.execute(text('<query>'), …) # Replaces ':<key>'s with keyword arguments.
<cursor> = <conn>.execute(text('<query>'), …) # `<dict>`. Replaces ':<key>'s with values.
with <conn>.begin(): ... # Exits the block with commit or rollback.
```

6
index.html

@ -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
&lt;engine&gt; = create_engine(<span class="hljs-string">'&lt;url&gt;'</span>) <span class="hljs-comment"># Url: 'dialect://user:password@host/dbname'.</span>
&lt;conn&gt; = &lt;engine&gt;.connect() <span class="hljs-comment"># Creates a connection. Also &lt;conn&gt;.close().</span>
&lt;cursor&gt; = &lt;conn&gt;.execute(text(<span class="hljs-string">'&lt;query&gt;'</span>), …) <span class="hljs-comment"># Replaces ':&lt;key&gt;'s with keyword arguments.</span>
&lt;cursor&gt; = &lt;conn&gt;.execute(text(<span class="hljs-string">'&lt;query&gt;'</span>), …) <span class="hljs-comment"># `&lt;dict&gt;`. Replaces ':&lt;key&gt;'s with values.</span>
<span class="hljs-keyword">with</span> &lt;conn&gt;.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>

Loading…
Cancel
Save