Skip to content

Commit e6c64d7

Browse files
committed
SQLite
1 parent 20cfb92 commit e6c64d7

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1743,7 +1743,7 @@ SQLite
17431743
**Server-less database engine that stores each database into separate file.**
17441744
```python
17451745
import sqlite3
1746-
db = sqlite3.connect('<path>') # Also ':memory:'.
1746+
db = sqlite3.connect('<path>') # Also ':memory:'.
17471747
...
17481748
db.close()
17491749
```
@@ -1753,8 +1753,8 @@ db.close()
17531753
```python
17541754
cursor = db.execute('<query>')
17551755
if cursor:
1756-
<tuple> = cursor.fetchone() # First row.
1757-
<list> = cursor.fetchall() # Remaining rows.
1756+
<tuple> = cursor.fetchone() # First row.
1757+
<list> = cursor.fetchall() # Remaining rows.
17581758
```
17591759
* **Returned values can be of type str, int, float, bytes or None.**
17601760

@@ -1766,9 +1766,9 @@ db.commit()
17661766

17671767
### Placeholders
17681768
```python
1769-
db.execute('<query>', <list/tuple>) # Replaces '?'s in query with values.
1770-
db.execute('<query>', <dict/namedtuple>) # Replaces ':<key>'s with values.
1771-
db.executemany('<query>', <coll_of_above>) # Runs execute() many times.
1769+
db.execute('<query>', <list/tuple>) # Replaces '?'s in query with values.
1770+
db.execute('<query>', <dict/namedtuple>) # Replaces ':<key>'s with values.
1771+
db.executemany('<query>', <coll_of_above>) # Runs execute() many times.
17721772
```
17731773
* **Passed values can be of type str, int, float, bytes, None, bool, datetime.date or datetime.datetme.**
17741774

index.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,7 +1544,7 @@ <h3 id="writeobjecttofile">Write Object to File</h3>
15441544
<h2 id="sqlite"><a href="#sqlite" name="sqlite">#</a>SQLite</h2>
15451545
<p><strong>Server-less database engine that stores each database into separate file.</strong></p>
15461546
<pre><code class="python language-python hljs"><span class="hljs-keyword">import</span> sqlite3
1547-
db = sqlite3.connect(<span class="hljs-string">'&lt;path&gt;'</span>) <span class="hljs-comment"># Also ':memory:'.</span>
1547+
db = sqlite3.connect(<span class="hljs-string">'&lt;path&gt;'</span>) <span class="hljs-comment"># Also ':memory:'.</span>
15481548
...
15491549
db.close()
15501550
</code></pre>
@@ -1554,8 +1554,8 @@ <h2 id="sqlite"><a href="#sqlite" name="sqlite">#</a>SQLite</h2>
15541554
<h3 id="read">Read</h3>
15551555
<pre><code class="python language-python hljs">cursor = db.execute(<span class="hljs-string">'&lt;query&gt;'</span>)
15561556
<span class="hljs-keyword">if</span> cursor:
1557-
&lt;tuple&gt; = cursor.fetchone() <span class="hljs-comment"># First row.</span>
1558-
&lt;list&gt; = cursor.fetchall() <span class="hljs-comment"># Remaining rows.</span>
1557+
&lt;tuple&gt; = cursor.fetchone() <span class="hljs-comment"># First row.</span>
1558+
&lt;list&gt; = cursor.fetchall() <span class="hljs-comment"># Remaining rows.</span>
15591559
</code></pre>
15601560
<ul>
15611561
<li><strong>Returned values can be of type str, int, float, bytes or None.</strong></li>
@@ -1565,9 +1565,9 @@ <h3 id="write">Write</h3>
15651565
db.commit()
15661566
</code></pre>
15671567
<h3 id="placeholders">Placeholders</h3>
1568-
<pre><code class="python language-python hljs">db.execute(<span class="hljs-string">'&lt;query&gt;'</span>, &lt;list/tuple&gt;) <span class="hljs-comment"># Replaces '?'s in query with values.</span>
1569-
db.execute(<span class="hljs-string">'&lt;query&gt;'</span>, &lt;dict/namedtuple&gt;) <span class="hljs-comment"># Replaces ':&lt;key&gt;'s with values.</span>
1570-
db.executemany(<span class="hljs-string">'&lt;query&gt;'</span>, &lt;coll_of_above&gt;) <span class="hljs-comment"># Runs execute() many times.</span>
1568+
<pre><code class="python language-python hljs">db.execute(<span class="hljs-string">'&lt;query&gt;'</span>, &lt;list/tuple&gt;) <span class="hljs-comment"># Replaces '?'s in query with values.</span>
1569+
db.execute(<span class="hljs-string">'&lt;query&gt;'</span>, &lt;dict/namedtuple&gt;) <span class="hljs-comment"># Replaces ':&lt;key&gt;'s with values.</span>
1570+
db.executemany(<span class="hljs-string">'&lt;query&gt;'</span>, &lt;coll_of_above&gt;) <span class="hljs-comment"># Runs execute() many times.</span>
15711571
</code></pre>
15721572
<ul>
15731573
<li><strong>Passed values can be of type str, int, float, bytes, None, bool, datetime.date or datetime.datetme.</strong></li>

0 commit comments

Comments
 (0)