From b346ec7108f3cfb70698b78c1039c94fbea1df7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Sat, 20 Jul 2019 18:25:53 +0200 Subject: [PATCH] SQLite --- README.md | 3 ++- index.html | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ce20c55..02752cc 100644 --- a/README.md +++ b/README.md @@ -1788,6 +1788,7 @@ db.execute('', ) # Replaces ':'s with values. db.executemany('', ) # Runs execute() many times. ``` * **Passed values can be of type str, int, float, bytes, None, bool, datetime.date or datetime.datetme.** +* **Bools will be stored and returned as ints and dates as ISO formatted strings.** ### Example ```python @@ -1806,7 +1807,7 @@ db.executemany('', ) # Runs execute() many times. from mysql import connector db = connector.connect(host=, user=, password=, database=) cursor = db.cursor() -cursor.execute('') # Connector doesn't have execute method. +cursor.execute('') # Only cursor has execute method. cursor.execute('', ) # Replaces '%s's in query with values. cursor.execute('', ) # Replaces '%()s's with values. ``` diff --git a/index.html b/index.html index ddb43f5..b42f861 100644 --- a/index.html +++ b/index.html @@ -1591,6 +1591,7 @@ db.executemany('<query>', <coll_of_abo
  • Passed values can be of type str, int, float, bytes, None, bool, datetime.date or datetime.datetme.
  • +
  • Bools will be stored and returned as ints and dates as ISO formatted strings.

Example

>>> db = sqlite3.connect('test.db')
 >>> db.execute('create table t (a, b, c)')
@@ -1606,7 +1607,7 @@ db.executemany('<query>', <coll_of_abo
 from mysql import connector
 db = connector.connect(host=<str>, user=<str>, password=<str>, database=<str>)
 cursor = db.cursor()
-cursor.execute('<query>')                     # Connector doesn't have execute method.
+cursor.execute('<query>')                     # Only cursor has execute method.
 cursor.execute('<query>', <list/tuple>)       # Replaces '%s's in query with values.
 cursor.execute('<query>', <dict/namedtuple>)  # Replaces '%(<key>)s's with values.