@@ -117,6 +117,24 @@ Module functions and constants
117
117
------------------------------
118
118
119
119
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
+
120
138
.. data :: version
121
139
122
140
The version number of this module, as a string. This is not the version of
@@ -139,6 +157,26 @@ Module functions and constants
139
157
The version number of the run-time SQLite library, as a tuple of integers.
140
158
141
159
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
+
142
180
.. data :: PARSE_DECLTYPES
143
181
144
182
This constant is meant to be used with the *detect_types * parameter of the
@@ -701,6 +739,14 @@ Cursor Objects
701
739
The cursor will be unusable from this point forward; a :exc: `ProgrammingError `
702
740
exception will be raised if any operation is attempted with the cursor.
703
741
742
+ .. method :: setinputsizes(sizes)
743
+
744
+ Required by the DB-API. Is a no-op in :mod: `sqlite3 `.
745
+
746
+ .. method :: setoutputsize(size [, column])
747
+
748
+ Required by the DB-API. Is a no-op in :mod: `sqlite3 `.
749
+
704
750
.. attribute :: rowcount
705
751
706
752
Although the :class: `Cursor ` class of the :mod: `sqlite3 ` module implements this
0 commit comments