Skip to content

Commit b346ec7

Browse files
committed
SQLite
1 parent fc14cdf commit b346ec7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1788,6 +1788,7 @@ db.execute('<query>', <dict/namedtuple>) # Replaces ':<key>'s with values.
17881788
db.executemany('<query>', <coll_of_above>) # Runs execute() many times.
17891789
```
17901790
* **Passed values can be of type str, int, float, bytes, None, bool, datetime.date or datetime.datetme.**
1791+
* **Bools will be stored and returned as ints and dates as ISO formatted strings.**
17911792

17921793
### Example
17931794
```python
@@ -1806,7 +1807,7 @@ db.executemany('<query>', <coll_of_above>) # Runs execute() many times.
18061807
from mysql import connector
18071808
db = connector.connect(host=<str>, user=<str>, password=<str>, database=<str>)
18081809
cursor = db.cursor()
1809-
cursor.execute('<query>') # Connector doesn't have execute method.
1810+
cursor.execute('<query>') # Only cursor has execute method.
18101811
cursor.execute('<query>', <list/tuple>) # Replaces '%s's in query with values.
18111812
cursor.execute('<query>', <dict/namedtuple>) # Replaces '%(<key>)s's with values.
18121813
```

index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1591,6 +1591,7 @@
15911591

15921592
<ul>
15931593
<li><strong>Passed values can be of type str, int, float, bytes, None, bool, datetime.date or datetime.datetme.</strong></li>
1594+
<li><strong>Bools will be stored and returned as ints and dates as ISO formatted strings.</strong></li>
15941595
</ul>
15951596
<div><h3 id="example">Example</h3><pre><code class="python language-python hljs"><span class="hljs-meta">&gt;&gt;&gt; </span>db = sqlite3.connect(<span class="hljs-string">'test.db'</span>)
15961597
<span class="hljs-meta">&gt;&gt;&gt; </span>db.execute(<span class="hljs-string">'create table t (a, b, c)'</span>)
@@ -1606,7 +1607,7 @@
16061607
<span class="hljs-keyword">from</span> mysql <span class="hljs-keyword">import</span> connector
16071608
db = connector.connect(host=&lt;str&gt;, user=&lt;str&gt;, password=&lt;str&gt;, database=&lt;str&gt;)
16081609
cursor = db.cursor()
1609-
cursor.execute(<span class="hljs-string">'&lt;query&gt;'</span>) <span class="hljs-comment"># Connector doesn't have execute method.</span>
1610+
cursor.execute(<span class="hljs-string">'&lt;query&gt;'</span>) <span class="hljs-comment"># Only cursor has execute method.</span>
16101611
cursor.execute(<span class="hljs-string">'&lt;query&gt;'</span>, &lt;list/tuple&gt;) <span class="hljs-comment"># Replaces '%s's in query with values.</span>
16111612
cursor.execute(<span class="hljs-string">'&lt;query&gt;'</span>, &lt;dict/namedtuple&gt;) <span class="hljs-comment"># Replaces '%(&lt;key&gt;)s's with values.</span>
16121613
</code></pre></div>

0 commit comments

Comments
 (0)