|
|
@ -1596,9 +1596,9 @@ db.close() |
|
|
|
<ul> |
|
|
|
<li><strong>New database will be created if path doesn't exist.</strong></li> |
|
|
|
</ul> |
|
|
|
<div><h3 id="read-1">Read</h3><pre><code class="python language-python hljs"><cursor> = db.execute(<span class="hljs-string">'<query>'</span>) <span class="hljs-comment"># Raises sqlite3.OperationalError.</span> |
|
|
|
<tuple> = <cursor>.fetchone() <span class="hljs-comment"># First row. Also next(<cursor>).</span> |
|
|
|
<list> = <cursor>.fetchall() <span class="hljs-comment"># Remaining rows.</span> |
|
|
|
<div><h3 id="read-1">Read</h3><pre><code class="python language-python hljs"><cursor> = db.execute(<span class="hljs-string">'<query>'</span>) <span class="hljs-comment"># Can raise sqlite3.OperationalError.</span> |
|
|
|
<tuple> = <cursor>.fetchone() <span class="hljs-comment"># Returns next row. Also next(<cursor>).</span> |
|
|
|
<list> = <cursor>.fetchall() <span class="hljs-comment"># Returns remaining rows.</span> |
|
|
|
</code></pre></div> |
|
|
|
|
|
|
|
<ul> |
|
|
|