@@ -117,6 +117,24 @@ Module functions and constants
117117------------------------------
118118
119119
120+ .. data :: apilevel
121+
122+ String constant stating the supported DB-API level. Required by the DB-API.
123+ Hard-coded to ``"2.0" ``.
124+
125+ .. data :: paramstyle
126+
127+ String constant stating the type of parameter marker formatting expected by
128+ the :mod: `sqlite3 ` module. Required by the DB-API. Hard-coded to
129+ ``"qmark" ``.
130+
131+ .. note ::
132+
133+ The :mod: `sqlite3 ` module supports both ``qmark `` and ``numeric `` DB-API
134+ parameter styles, because that is what the underlying SQLite library
135+ supports. However, the DB-API does not allow multiple values for
136+ the ``paramstyle `` attribute.
137+
120138.. data :: version
121139
122140 The version number of this module, as a string. This is not the version of
@@ -139,6 +157,26 @@ Module functions and constants
139157 The version number of the run-time SQLite library, as a tuple of integers.
140158
141159
160+ .. data :: threadsafety
161+
162+ Integer constant required by the DB-API, stating the level of thread safety
163+ the :mod: `sqlite3 ` module supports. Currently hard-coded to ``1 ``, meaning
164+ *"Threads may share the module, but not connections." * However, this may not
165+ always be true. You can check the underlying SQLite library's compile-time
166+ threaded mode using the following query::
167+
168+ import sqlite3
169+ con = sqlite3.connect(":memory:")
170+ con.execute("""
171+ select * from pragma_compile_options
172+ where compile_options like 'THREADSAFE=%'
173+ """).fetchall()
174+
175+ Note that the `SQLITE_THREADSAFE levels
176+ <https://sqlite.org/compile.html#threadsafe> `_ do not match the DB-API 2.0
177+ ``threadsafety `` levels.
178+
179+
142180.. data :: PARSE_DECLTYPES
143181
144182 This constant is meant to be used with the *detect_types * parameter of the
@@ -710,6 +748,14 @@ Cursor Objects
710748 The cursor will be unusable from this point forward; a :exc: `ProgrammingError `
711749 exception will be raised if any operation is attempted with the cursor.
712750
751+ .. method :: setinputsizes(sizes)
752+
753+ Required by the DB-API. Is a no-op in :mod: `sqlite3 `.
754+
755+ .. method :: setoutputsize(size [, column])
756+
757+ Required by the DB-API. Is a no-op in :mod: `sqlite3 `.
758+
713759 .. attribute :: rowcount
714760
715761 Although the :class: `Cursor ` class of the :mod: `sqlite3 ` module implements this
0 commit comments