Browse Source

SQLite

pull/42/head
Jure Šorn 5 years ago
parent
commit
8e988ff376
2 changed files with 6 additions and 6 deletions
  1. 6
      README.md
  2. 6
      index.html

6
README.md

@ -1788,9 +1788,9 @@ db.close()
### Read ### Read
```python ```python
<cursor> = db.execute('<query>') # Raises sqlite3.OperationalError.
<tuple> = <cursor>.fetchone() # First row. Also next(<cursor>).
<list> = <cursor>.fetchall() # Remaining rows.
<cursor> = db.execute('<query>') # Can raise sqlite3.OperationalError.
<tuple> = <cursor>.fetchone() # Returns next row. Also next(<cursor>).
<list> = <cursor>.fetchall() # Returns remaining rows.
``` ```
* **Returned values can be of type str, int, float, bytes or None.** * **Returned values can be of type str, int, float, bytes or None.**

6
index.html

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

Loading…
Cancel
Save