pyodbc 5.4.0__cp315-cp315-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ Version: 1.13.2
2
+ Arguments: ['C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-w3jzxvns\\cp315-win_amd64\\build\\venv\\Scripts\\delvewheel', 'repair', '-w', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-w3jzxvns\\cp315-win_amd64\\repaired_wheel', '-v', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-w3jzxvns\\cp315-win_amd64\\built_wheel\\pyodbc-5.4.0-cp315-cp315-win_amd64.whl']
@@ -0,0 +1,58 @@
1
+ Metadata-Version: 2.4
2
+ Name: pyodbc
3
+ Version: 5.4.0
4
+ Summary: DB API module for ODBC
5
+ Home-page: https://github.com/mkleehammer/pyodbc
6
+ Author-email: Michael Kleehammer <michael@kleehammer.com>
7
+ Maintainer: Michael Kleehammer
8
+ Maintainer-email: Michael Kleehammer <michael@kleehammer.com>
9
+ License-Expression: MIT-0
10
+ Project-URL: Homepage, https://github.com/mkleehammer/pyodbc
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: System Administrators
14
+ Classifier: Operating System :: Microsoft :: Windows
15
+ Classifier: Operating System :: POSIX
16
+ Classifier: Programming Language :: Python
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Topic :: Database
19
+ Requires-Python: >=3.11
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE.txt
22
+ Dynamic: home-page
23
+ Dynamic: license-file
24
+ Dynamic: maintainer
25
+ Dynamic: requires-python
26
+
27
+ # pyodbc
28
+
29
+ [![Windows build](https://ci.appveyor.com/api/projects/status/github/mkleehammer/pyodbc?branch=master&svg=true&passingText=Windows%20build&failingText=Windows%20build)](https://ci.appveyor.com/project/mkleehammer/pyodbc)
30
+ [![Ubuntu build](https://github.com/mkleehammer/pyodbc/actions/workflows/ubuntu_build.yml/badge.svg)](https://github.com/mkleehammer/pyodbc/actions/workflows/ubuntu_build.yml)
31
+ [![PyPI](https://img.shields.io/pypi/v/pyodbc?color=brightgreen)](https://pypi.org/project/pyodbc/)
32
+
33
+ pyodbc is an open source Python module that makes accessing ODBC databases simple. It
34
+ implements the [DB API 2.0](https://www.python.org/dev/peps/pep-0249) specification but is packed with even more Pythonic convenience.
35
+
36
+ The easiest way to install pyodbc is to use pip:
37
+
38
+ python -m pip install pyodbc
39
+
40
+ On Macs, you should probably install unixODBC first if you don't already have an ODBC
41
+ driver manager installed. For example, using the [homebrew](https://brew.sh/) package manager:
42
+
43
+ brew install unixodbc
44
+ python -m pip install pyodbc
45
+
46
+ Similarly, on Unix you should make sure you have an ODBC driver manager installed before
47
+ installing pyodbc. See the [docs](https://github.com/mkleehammer/pyodbc/wiki/Install)
48
+ for more information about how to do this on different Unix flavors. (On Windows, the
49
+ ODBC driver manager is built-in.)
50
+
51
+ Precompiled binary wheels are provided for multiple Python versions on most Windows, macOS,
52
+ and Linux platforms. On other platforms pyodbc will be built from the source code. Note,
53
+ pyodbc contains C++ extensions so you will need a suitable C++ compiler when building from
54
+ source. See the [docs](https://github.com/mkleehammer/pyodbc/wiki/Install) for details.
55
+
56
+ [Documentation](https://github.com/mkleehammer/pyodbc/wiki)
57
+
58
+ [Release Notes](https://github.com/mkleehammer/pyodbc/releases)
@@ -0,0 +1,9 @@
1
+ pyodbc.cp315-win_amd64.pyd,sha256=iQtPwP5JM8G3t3ogzL8-TcT_8LTcMevVItVcUkSoAJA,151552
2
+ pyodbc.pyi,sha256=fmZtzez0JMv4OQsrmSjQvLo811DoqbKAWH9h_woNDZg,36735
3
+ pyodbc-5.4.0.data/platlib/msvcp140-a4c2229bdc2a2a630acdc095b4d86008.dll,sha256=pMIim9wqKmMKzcCVtNhgCOXD47x3cxdDVPPaT1vrnN4,575056
4
+ pyodbc-5.4.0.dist-info/DELVEWHEEL,sha256=lanElMc5vQdLWmmKZX7YDt4MYoK5zvduQvjg9CGRjXM,405
5
+ pyodbc-5.4.0.dist-info/METADATA,sha256=Sdd3nWgrEM8sEvl6s-oSnjlt9OeI_9F9mAVlaQw_vCI,2816
6
+ pyodbc-5.4.0.dist-info/RECORD,,
7
+ pyodbc-5.4.0.dist-info/top_level.txt,sha256=Rb69vS-SNN_Bfh99vX7eCcvEAJoyzowG3u4R7W36Flw,8
8
+ pyodbc-5.4.0.dist-info/WHEEL,sha256=0gLwYZa0C2fhgCxWR2c8HahwUiopqonVCV0wVwEg6fE,101
9
+ pyodbc-5.4.0.dist-info/licenses/LICENSE.txt,sha256=mFnIV3DJG3hmsPdpyTjjbWTQJgFBtSm5R7Tq2WiD6rQ,868
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: false
4
+ Tag: cp315-cp315-win_amd64
5
+
@@ -0,0 +1,9 @@
1
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2
+ documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
3
+ rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
4
+ permit persons to whom the Software is furnished to do so.
5
+
6
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
7
+ WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
8
+ OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
9
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,2 @@
1
+
2
+ pyodbc
Binary file
pyodbc.pyi ADDED
@@ -0,0 +1,1090 @@
1
+ # ignore line spacing (E303), mixed case names (N802/N803)
2
+ # ruff: noqa: E303, N802, N803
3
+ from __future__ import annotations
4
+ from collections.abc import Callable, Generator, Iterable, Iterator, Sequence
5
+ from typing import Any, Final, Self
6
+ import ctypes
7
+
8
+ # SQLSetConnectAttr attributes
9
+ # ref: https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqlsetconnectattr-function
10
+ SQL_ATTR_ACCESS_MODE: int
11
+ SQL_ATTR_AUTOCOMMIT: int
12
+ SQL_ATTR_CURRENT_CATALOG: int
13
+ SQL_ATTR_LOGIN_TIMEOUT: int
14
+ SQL_ATTR_ODBC_CURSORS: int
15
+ SQL_ATTR_QUIET_MODE: int
16
+ SQL_ATTR_TRACE: int
17
+ SQL_ATTR_TRACEFILE: int
18
+ SQL_ATTR_TRANSLATE_LIB: int
19
+ SQL_ATTR_TRANSLATE_OPTION: int
20
+ SQL_ATTR_TXN_ISOLATION: int
21
+ # other (e.g. specific to certain RDBMSs)
22
+ SQL_ACCESS_MODE: int
23
+ SQL_AUTOCOMMIT: int
24
+ SQL_CURRENT_QUALIFIER: int
25
+ SQL_LOGIN_TIMEOUT: int
26
+ SQL_ODBC_CURSORS: int
27
+ SQL_OPT_TRACE: int
28
+ SQL_OPT_TRACEFILE: int
29
+ SQL_PACKET_SIZE: int
30
+ SQL_QUIET_MODE: int
31
+ SQL_TRANSLATE_DLL: int
32
+ SQL_TRANSLATE_OPTION: int
33
+ SQL_TXN_ISOLATION: int
34
+ # Unicode
35
+ SQL_ATTR_ANSI_APP: int
36
+
37
+ # ODBC column data types
38
+ # https://docs.microsoft.com/en-us/sql/odbc/reference/appendixes/appendix-d-data-types
39
+ SQL_UNKNOWN_TYPE: int
40
+ SQL_CHAR: int
41
+ SQL_VARCHAR: int
42
+ SQL_LONGVARCHAR: int
43
+ SQL_WCHAR: int
44
+ SQL_WVARCHAR: int
45
+ SQL_WLONGVARCHAR: int
46
+ SQL_DECIMAL: int
47
+ SQL_NUMERIC: int
48
+ SQL_SMALLINT: int
49
+ SQL_INTEGER: int
50
+ SQL_REAL: int
51
+ SQL_FLOAT: int
52
+ SQL_DOUBLE: int
53
+ SQL_BIT: int
54
+ SQL_TINYINT: int
55
+ SQL_BIGINT: int
56
+ SQL_BINARY: int
57
+ SQL_VARBINARY: int
58
+ SQL_LONGVARBINARY: int
59
+ SQL_TYPE_DATE: int
60
+ SQL_TYPE_TIME: int
61
+ SQL_TYPE_TIMESTAMP: int
62
+ SQL_SS_TIME2: int
63
+ SQL_SS_VARIANT: int
64
+ SQL_SS_XML: int
65
+ SQL_INTERVAL_MONTH: int
66
+ SQL_INTERVAL_YEAR: int
67
+ SQL_INTERVAL_YEAR_TO_MONTH: int
68
+ SQL_INTERVAL_DAY: int
69
+ SQL_INTERVAL_HOUR: int
70
+ SQL_INTERVAL_MINUTE: int
71
+ SQL_INTERVAL_SECOND: int
72
+ SQL_INTERVAL_DAY_TO_HOUR: int
73
+ SQL_INTERVAL_DAY_TO_MINUTE: int
74
+ SQL_INTERVAL_DAY_TO_SECOND: int
75
+ SQL_INTERVAL_HOUR_TO_MINUTE: int
76
+ SQL_INTERVAL_HOUR_TO_SECOND: int
77
+ SQL_INTERVAL_MINUTE_TO_SECOND: int
78
+ SQL_GUID: int
79
+ # SQLDescribeCol
80
+ SQL_NO_NULLS: int
81
+ SQL_NULLABLE: int
82
+ SQL_NULLABLE_UNKNOWN: int
83
+ # specific to pyodbc
84
+ SQL_WMETADATA: int
85
+
86
+ # SQL_CONVERT_X
87
+ SQL_CONVERT_FUNCTIONS: int
88
+ SQL_CONVERT_BIGINT: int
89
+ SQL_CONVERT_BINARY: int
90
+ SQL_CONVERT_BIT: int
91
+ SQL_CONVERT_CHAR: int
92
+ SQL_CONVERT_DATE: int
93
+ SQL_CONVERT_DECIMAL: int
94
+ SQL_CONVERT_DOUBLE: int
95
+ SQL_CONVERT_FLOAT: int
96
+ SQL_CONVERT_GUID: int
97
+ SQL_CONVERT_INTEGER: int
98
+ SQL_CONVERT_INTERVAL_DAY_TIME: int
99
+ SQL_CONVERT_INTERVAL_YEAR_MONTH: int
100
+ SQL_CONVERT_LONGVARBINARY: int
101
+ SQL_CONVERT_LONGVARCHAR: int
102
+ SQL_CONVERT_NUMERIC: int
103
+ SQL_CONVERT_REAL: int
104
+ SQL_CONVERT_SMALLINT: int
105
+ SQL_CONVERT_TIME: int
106
+ SQL_CONVERT_TIMESTAMP: int
107
+ SQL_CONVERT_TINYINT: int
108
+ SQL_CONVERT_VARBINARY: int
109
+ SQL_CONVERT_VARCHAR: int
110
+ SQL_CONVERT_WCHAR: int
111
+ SQL_CONVERT_WLONGVARCHAR: int
112
+ SQL_CONVERT_WVARCHAR: int
113
+
114
+ # transaction isolation
115
+ # ref: https://docs.microsoft.com/en-us/sql/relational-databases/native-client-odbc-cursors/properties/cursor-transaction-isolation-level
116
+ SQL_TXN_READ_COMMITTED: int
117
+ SQL_TXN_READ_UNCOMMITTED: int
118
+ SQL_TXN_REPEATABLE_READ: int
119
+ SQL_TXN_SERIALIZABLE: int
120
+
121
+ # outer join capabilities
122
+ SQL_OJ_LEFT: int
123
+ SQL_OJ_RIGHT: int
124
+ SQL_OJ_FULL: int
125
+ SQL_OJ_NESTED: int
126
+ SQL_OJ_NOT_ORDERED: int
127
+ SQL_OJ_INNER: int
128
+ SQL_OJ_ALL_COMPARISON_OPS: int
129
+
130
+ # other ODBC database constants
131
+ SQL_SCOPE_CURROW: int
132
+ SQL_SCOPE_TRANSACTION: int
133
+ SQL_SCOPE_SESSION: int
134
+ SQL_PC_UNKNOWN: int
135
+ SQL_PC_NOT_PSEUDO: int
136
+ SQL_PC_PSEUDO: int
137
+ # SQL_INDEX_BTREE: int
138
+ # SQL_INDEX_CLUSTERED: int
139
+ # SQL_INDEX_CONTENT: int
140
+ # SQL_INDEX_HASHED: int
141
+ # SQL_INDEX_OTHER: int
142
+
143
+ # attributes for the ODBC SQLGetInfo function
144
+ # https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqlgetinfo-function
145
+ SQL_ACCESSIBLE_PROCEDURES: int
146
+ SQL_ACCESSIBLE_TABLES: int
147
+ SQL_ACTIVE_ENVIRONMENTS: int
148
+ SQL_AGGREGATE_FUNCTIONS: int
149
+ SQL_ALTER_DOMAIN: int
150
+ SQL_ALTER_TABLE: int
151
+ SQL_ASYNC_MODE: int
152
+ SQL_BATCH_ROW_COUNT: int
153
+ SQL_BATCH_SUPPORT: int
154
+ SQL_BOOKMARK_PERSISTENCE: int
155
+ SQL_CATALOG_LOCATION: int
156
+ SQL_CATALOG_NAME: int
157
+ SQL_CATALOG_NAME_SEPARATOR: int
158
+ SQL_CATALOG_TERM: int
159
+ SQL_CATALOG_USAGE: int
160
+ SQL_COLLATION_SEQ: int
161
+ SQL_COLUMN_ALIAS: int
162
+ SQL_CONCAT_NULL_BEHAVIOR: int
163
+ SQL_CORRELATION_NAME: int
164
+ SQL_CREATE_ASSERTION: int
165
+ SQL_CREATE_CHARACTER_SET: int
166
+ SQL_CREATE_COLLATION: int
167
+ SQL_CREATE_DOMAIN: int
168
+ SQL_CREATE_SCHEMA: int
169
+ SQL_CREATE_TABLE: int
170
+ SQL_CREATE_TRANSLATION: int
171
+ SQL_CREATE_VIEW: int
172
+ SQL_CURSOR_COMMIT_BEHAVIOR: int
173
+ SQL_CURSOR_ROLLBACK_BEHAVIOR: int
174
+ # SQL_CURSOR_ROLLBACK_SQL_CURSOR_SENSITIVITY: int
175
+ SQL_DATABASE_NAME: int
176
+ SQL_DATA_SOURCE_NAME: int
177
+ SQL_DATA_SOURCE_READ_ONLY: int
178
+ SQL_DATETIME_LITERALS: int
179
+ SQL_DBMS_NAME: int
180
+ SQL_DBMS_VER: int
181
+ SQL_DDL_INDEX: int
182
+ SQL_DEFAULT_TXN_ISOLATION: int
183
+ SQL_DESCRIBE_PARAMETER: int
184
+ SQL_DM_VER: int
185
+ SQL_DRIVER_HDESC: int
186
+ SQL_DRIVER_HENV: int
187
+ SQL_DRIVER_HLIB: int
188
+ SQL_DRIVER_HSTMT: int
189
+ SQL_DRIVER_NAME: int
190
+ SQL_DRIVER_ODBC_VER: int
191
+ SQL_DRIVER_VER: int
192
+ SQL_DROP_ASSERTION: int
193
+ SQL_DROP_CHARACTER_SET: int
194
+ SQL_DROP_COLLATION: int
195
+ SQL_DROP_DOMAIN: int
196
+ SQL_DROP_SCHEMA: int
197
+ SQL_DROP_TABLE: int
198
+ SQL_DROP_TRANSLATION: int
199
+ SQL_DROP_VIEW: int
200
+ SQL_DYNAMIC_CURSOR_ATTRIBUTES1: int
201
+ SQL_DYNAMIC_CURSOR_ATTRIBUTES2: int
202
+ SQL_EXPRESSIONS_IN_ORDERBY: int
203
+ SQL_FILE_USAGE: int
204
+ SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1: int
205
+ SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2: int
206
+ SQL_GETDATA_EXTENSIONS: int
207
+ SQL_GROUP_BY: int
208
+ SQL_IDENTIFIER_CASE: int
209
+ SQL_IDENTIFIER_QUOTE_CHAR: int
210
+ SQL_INDEX_KEYWORDS: int
211
+ SQL_INFO_SCHEMA_VIEWS: int
212
+ SQL_INSERT_STATEMENT: int
213
+ SQL_INTEGRITY: int
214
+ SQL_KEYSET_CURSOR_ATTRIBUTES1: int
215
+ SQL_KEYSET_CURSOR_ATTRIBUTES2: int
216
+ SQL_KEYWORDS: int
217
+ SQL_LIKE_ESCAPE_CLAUSE: int
218
+ SQL_MAX_ASYNC_CONCURRENT_STATEMENTS: int
219
+ SQL_MAX_BINARY_LITERAL_LEN: int
220
+ SQL_MAX_CATALOG_NAME_LEN: int
221
+ SQL_MAX_CHAR_LITERAL_LEN: int
222
+ SQL_MAX_COLUMNS_IN_GROUP_BY: int
223
+ SQL_MAX_COLUMNS_IN_INDEX: int
224
+ SQL_MAX_COLUMNS_IN_ORDER_BY: int
225
+ SQL_MAX_COLUMNS_IN_SELECT: int
226
+ SQL_MAX_COLUMNS_IN_TABLE: int
227
+ SQL_MAX_COLUMN_NAME_LEN: int
228
+ SQL_MAX_CONCURRENT_ACTIVITIES: int
229
+ SQL_MAX_CURSOR_NAME_LEN: int
230
+ SQL_MAX_DRIVER_CONNECTIONS: int
231
+ SQL_MAX_IDENTIFIER_LEN: int
232
+ SQL_MAX_INDEX_SIZE: int
233
+ SQL_MAX_PROCEDURE_NAME_LEN: int
234
+ SQL_MAX_ROW_SIZE: int
235
+ SQL_MAX_ROW_SIZE_INCLUDES_LONG: int
236
+ SQL_MAX_SCHEMA_NAME_LEN: int
237
+ SQL_MAX_STATEMENT_LEN: int
238
+ SQL_MAX_TABLES_IN_SELECT: int
239
+ SQL_MAX_TABLE_NAME_LEN: int
240
+ SQL_MAX_USER_NAME_LEN: int
241
+ SQL_MULTIPLE_ACTIVE_TXN: int
242
+ SQL_MULT_RESULT_SETS: int
243
+ SQL_NEED_LONG_DATA_LEN: int
244
+ SQL_NON_NULLABLE_COLUMNS: int
245
+ SQL_NULL_COLLATION: int
246
+ SQL_NUMERIC_FUNCTIONS: int
247
+ SQL_ODBC_INTERFACE_CONFORMANCE: int
248
+ SQL_ODBC_VER: int
249
+ SQL_OJ_CAPABILITIES: int
250
+ SQL_ORDER_BY_COLUMNS_IN_SELECT: int
251
+ SQL_PARAM_ARRAY_ROW_COUNTS: int
252
+ SQL_PARAM_ARRAY_SELECTS: int
253
+ SQL_PARAM_TYPE_UNKNOWN: int
254
+ SQL_PARAM_INPUT: int
255
+ SQL_PARAM_INPUT_OUTPUT: int
256
+ SQL_PARAM_OUTPUT: int
257
+ SQL_RETURN_VALUE: int
258
+ SQL_RESULT_COL: int
259
+ SQL_PROCEDURES: int
260
+ SQL_PROCEDURE_TERM: int
261
+ SQL_QUOTED_IDENTIFIER_CASE: int
262
+ SQL_ROW_UPDATES: int
263
+ SQL_SCHEMA_TERM: int
264
+ SQL_SCHEMA_USAGE: int
265
+ SQL_SCROLL_OPTIONS: int
266
+ SQL_SEARCH_PATTERN_ESCAPE: int
267
+ SQL_SERVER_NAME: int
268
+ SQL_SPECIAL_CHARACTERS: int
269
+ SQL_SQL92_DATETIME_FUNCTIONS: int
270
+ SQL_SQL92_FOREIGN_KEY_DELETE_RULE: int
271
+ SQL_SQL92_FOREIGN_KEY_UPDATE_RULE: int
272
+ SQL_SQL92_GRANT: int
273
+ SQL_SQL92_NUMERIC_VALUE_FUNCTIONS: int
274
+ SQL_SQL92_PREDICATES: int
275
+ SQL_SQL92_RELATIONAL_JOIN_OPERATORS: int
276
+ SQL_SQL92_REVOKE: int
277
+ SQL_SQL92_ROW_VALUE_CONSTRUCTOR: int
278
+ SQL_SQL92_STRING_FUNCTIONS: int
279
+ SQL_SQL92_VALUE_EXPRESSIONS: int
280
+ SQL_SQL_CONFORMANCE: int
281
+ SQL_STANDARD_CLI_CONFORMANCE: int
282
+ SQL_STATIC_CURSOR_ATTRIBUTES1: int
283
+ SQL_STATIC_CURSOR_ATTRIBUTES2: int
284
+ SQL_STRING_FUNCTIONS: int
285
+ SQL_SUBQUERIES: int
286
+ SQL_SYSTEM_FUNCTIONS: int
287
+ SQL_TABLE_TERM: int
288
+ SQL_TIMEDATE_ADD_INTERVALS: int
289
+ SQL_TIMEDATE_DIFF_INTERVALS: int
290
+ SQL_TIMEDATE_FUNCTIONS: int
291
+ SQL_TXN_CAPABLE: int
292
+ SQL_TXN_ISOLATION_OPTION: int
293
+ SQL_UNION: int
294
+ SQL_USER_NAME: int
295
+ SQL_XOPEN_CLI_YEAR: int
296
+
297
+ # driver connect completion modes
298
+ SQL_DRIVER_COMPLETE: int
299
+ SQL_DRIVER_COMPLETE_REQUIRED: int
300
+ SQL_DRIVER_NOPROMPT: int
301
+ SQL_DRIVER_PROMPT: int
302
+
303
+ # pyodbc-specific constants
304
+ BinaryNull: Any # to distinguish binary NULL values from char NULL values
305
+ SQLWCHAR_SIZE: int
306
+
307
+
308
+ # module attributes
309
+ # https://www.python.org/dev/peps/pep-0249/#globals
310
+
311
+ # read-only
312
+ apilevel: Final[str] = '2.0'
313
+ paramstyle: Final[str] = 'qmark'
314
+ threadsafety: Final[int] = 1
315
+ version: Final[str] # not pep-0249
316
+ henv: Final[ctypes.c_void_p]
317
+
318
+ # read-write (not pep-0249)
319
+ lowercase: bool = False
320
+ native_uuid: bool = False
321
+ odbcversion: str = '3.X'
322
+ pooling: bool = True
323
+
324
+
325
+ # exceptions
326
+ # https://www.python.org/dev/peps/pep-0249/#exceptions
327
+ class Warning(Exception): ...
328
+ class Error(Exception): ...
329
+ class InterfaceError(Error): ...
330
+ class DatabaseError(Error): ...
331
+ class DataError(DatabaseError): ...
332
+ class OperationalError(DatabaseError): ...
333
+ class IntegrityError(DatabaseError): ...
334
+ class InternalError(DatabaseError): ...
335
+ class ProgrammingError(DatabaseError): ...
336
+ class NotSupportedError(DatabaseError): ...
337
+
338
+
339
+ class Connection:
340
+ """The ODBC connection class representing an ODBC connection to a database, for
341
+ managing database transactions and creating cursors.
342
+ https://www.python.org/dev/peps/pep-0249/#connection-objects
343
+
344
+ This class should not be instantiated directly, instead call pyodbc.connect() to
345
+ create a Connection object. Connection objects cannot be pickled.
346
+ """
347
+
348
+ @property
349
+ def autocommit(self) -> bool:
350
+ """Whether the database automatically executes a commit after every successful transaction.
351
+ Default is False.
352
+ """
353
+ ...
354
+
355
+ @autocommit.setter
356
+ def autocommit(self, value: bool) -> None:
357
+ ...
358
+
359
+ @property
360
+ def closed(self) -> bool:
361
+ """Returns True if the connection is closed, False otherwise."""
362
+ ...
363
+
364
+ @property
365
+ def fetch_decimal_as_string(self) -> bool:
366
+ """If True, DECIMAL and NUMERIC values will be fetched as strings using the
367
+ legacy local-aware path. If False (the default), values are fetched using a
368
+ binary representation that is not affected by the locale. A column whose
369
+ driver returns text in place of the binary representation is read as text."""
370
+ ...
371
+
372
+ @fetch_decimal_as_string.setter
373
+ def fetch_decimal_as_string(self, value: bool) -> None:
374
+ ...
375
+
376
+ @property
377
+ def hdbc(self) -> ctypes.c_void_p | None:
378
+ """ODBC handle for the connection."""
379
+ ...
380
+
381
+ @property
382
+ def compat_diagrec_byte_length(self) -> bool:
383
+ """Set to True if the driver incorrectly reports byte length instead of
384
+ character length for diagnostic messages.
385
+
386
+ See https://github.com/mkleehammer/pyodbc/issues/489."""
387
+ ...
388
+
389
+ @compat_diagrec_byte_length.setter
390
+ def compat_diagrec_byte_length(self, value: bool) -> None:
391
+ ...
392
+
393
+ @property
394
+ def maxwrite(self) -> int:
395
+ """The maximum bytes to write before using SQLPutData, default is zero for no maximum."""
396
+ ...
397
+
398
+ @maxwrite.setter
399
+ def maxwrite(self, value: int) -> None:
400
+ ...
401
+
402
+ @property
403
+ def readvar_initsize(self) -> int:
404
+ """The initial buffer size in bytes for reading values from variable-length columns."""
405
+ ...
406
+
407
+ @readvar_initsize.setter
408
+ def readvar_initsize(self, value: int) -> None:
409
+ ...
410
+
411
+ @property
412
+ def searchescape(self) -> str:
413
+ """The character for escaping search pattern characters like "%" and "_".
414
+ This is typically the backslash character but can be driver-specific."""
415
+ ...
416
+
417
+ @property
418
+ def timeout(self) -> int:
419
+ """The timeout in seconds for SQL queries, use zero (the default) for no timeout limit."""
420
+ ...
421
+
422
+ @timeout.setter
423
+ def timeout(self, value: int) -> None:
424
+ ...
425
+
426
+
427
+ # implemented dunder methods
428
+ def __enter__(self) -> Self: ...
429
+ def __exit__(self, exc_type, exc_value, traceback) -> None: ...
430
+
431
+
432
+ # functions for defining the text encoding used for data, metadata, sql, parameters, etc.
433
+
434
+ def setencoding(self,
435
+ encoding: str | None = None,
436
+ ctype: int | None = None) -> None:
437
+ """Set the text encoding for SQL statements and textual parameters sent to the database.
438
+
439
+ Args:
440
+ encoding: Text encoding codec, e.g. "utf-8".
441
+ ctype: The C data type when passing data - either pyodbc.SQL_CHAR or pyodbc.SQL_WCHAR. More
442
+ relevant for Python 2.7.
443
+ """
444
+ ...
445
+
446
+ def setdecoding(self,
447
+ sqltype: int,
448
+ encoding: str | None = None,
449
+ ctype: int | None = None) -> None:
450
+ """Set the text decoding used when reading SQL_CHAR or SQL_WCHAR data from the database.
451
+
452
+ Args:
453
+ sqltype: pyodbc.SQL_CHAR, pyodbc.SQL_WCHAR, or pyodbc.SQL_WMETADATA.
454
+ encoding: Text encoding codec, e.g. "utf-8".
455
+ ctype: The C data type to request from SQLGetData - either pyodbc.SQL_CHAR or
456
+ pyodbc.SQL_WCHAR. More relevant for Python 2.7.
457
+ """
458
+ ...
459
+
460
+
461
+ # functions for getting/setting connection attributes
462
+
463
+ def getinfo(self, infotype: int, /) -> Any:
464
+ """Retrieve general information about the driver and the data source, via SQLGetInfo.
465
+
466
+ Args:
467
+ infotype: Id of the information to retrieve.
468
+
469
+ Returns:
470
+ The value of the requested information.
471
+ """
472
+ ...
473
+
474
+ def set_attr(self, attr_id: int, value: int | str, /) -> None:
475
+ """Set an attribute on the connection, via SQLSetConnectAttr.
476
+
477
+ Args:
478
+ attr_id: Id for the attribute, as defined by ODBC or the driver.
479
+ value: The value of the attribute.
480
+ """
481
+ ...
482
+
483
+
484
+ # functions to handle non-standard database data types
485
+
486
+ def add_output_converter(self, sqltype: int, func: Callable | None, /) -> None:
487
+ """Register an output converter function that will be called whenever a value
488
+ with the given SQL type is read from the database. See the Wiki for details:
489
+ https://github.com/mkleehammer/pyodbc/wiki/Using-an-Output-Converter-function
490
+
491
+ Args:
492
+ sqltype: The SQL type for the values to convert.
493
+ func: The converter function.
494
+ """
495
+ ...
496
+
497
+ def get_output_converter(self, sqltype: int, /) -> Callable | None:
498
+ """Retrieve the (previously registered) converter function for the SQL type.
499
+
500
+ Args:
501
+ sqltype: The SQL type.
502
+
503
+ Returns:
504
+ The converter function if it exists, None otherwise.
505
+ """
506
+ ...
507
+
508
+ def remove_output_converter(self, sqltype: int, /) -> None:
509
+ """Delete a previously registered output converter function.
510
+
511
+ Args:
512
+ sqltype: The SQL type.
513
+ """
514
+ ...
515
+
516
+ def clear_output_converters(self) -> None:
517
+ """Delete all previously registered converter functions."""
518
+ ...
519
+
520
+
521
+ # functions for managing database transactions (in typical order of use)
522
+
523
+ def cursor(self) -> Cursor:
524
+ """Create a new cursor on the connection.
525
+
526
+ Returns:
527
+ A new cursor.
528
+ """
529
+ ...
530
+
531
+ def execute(self, sql: str, *params: Any) -> Cursor:
532
+ """A convenience function for running queries directly from a Connection object.
533
+ Creates a new cursor, runs the SQL query, and returns the new cursor.
534
+
535
+ Args:
536
+ sql: The SQL query.
537
+ *params: Any parameter values for the SQL query.
538
+
539
+ Returns:
540
+ A new cursor.
541
+ """
542
+ ...
543
+
544
+ def commit(self) -> None:
545
+ """Commit all pending transactions since the last commit/rollback. This includes
546
+ all SQL statements executed from ALL cursors created on this connection."""
547
+ ...
548
+
549
+ def rollback(self) -> None:
550
+ """Rollback all pending transactions since the last commit/rollback. This includes
551
+ all SQL statements executed from ALL cursors created on this connection."""
552
+ ...
553
+
554
+ def close(self) -> None:
555
+ """Close the connection. Any uncommitted SQL statements will be rolled back."""
556
+ ...
557
+
558
+
559
+ class Cursor:
560
+ """The class representing database cursors. Cursors are vehicles for executing SQL
561
+ statements and returning their results.
562
+ https://www.python.org/dev/peps/pep-0249/#cursor-objects
563
+
564
+ This class should not be instantiated directly, instead call cursor() from a Connection
565
+ object to create a Cursor object. Cursor objects cannot be pickled.
566
+ """
567
+
568
+ @property
569
+ def arraysize(self) -> int:
570
+ """The number of rows at a time to fetch with fetchmany(), default is 1."""
571
+ ...
572
+
573
+ @arraysize.setter
574
+ def arraysize(self, value: int) -> None:
575
+ ...
576
+
577
+ @property
578
+ def connection(self) -> Connection:
579
+ """The parent Connection object for the cursor."""
580
+ ...
581
+
582
+ @property
583
+ def description(self) -> tuple[tuple[str, Any, int, int, int, int, bool]]:
584
+ """The metadata for the columns returned in the last SQL SELECT statement, in
585
+ the form of a list of tuples. Each tuple contains seven fields:
586
+
587
+ 0. name of the column (or column alias)
588
+ 1. type code, the Python-equivalent class of the column, e.g. str for VARCHAR
589
+ 2. display size (pyodbc does not set this value)
590
+ 3. internal size (in bytes)
591
+ 4. precision
592
+ 5. scale
593
+ 6. nullable (True/False)
594
+
595
+ ref: https://peps.python.org/pep-0249/#description
596
+ """
597
+ ...
598
+
599
+ @property
600
+ def fast_executemany(self) -> bool:
601
+ """When this cursor property is False (the default), calls to executemany() do
602
+ nothing more than iterate over the provided list of parameters and calls execute()
603
+ on each set of parameters. This is typically slow. When fast_executemany is
604
+ True, the parameters are sent to the database in one bundle (with the SQL). This
605
+ is usually much faster, but there are limitations. Check the Wiki for details.
606
+ https://github.com/mkleehammer/pyodbc/wiki/Cursor#executemanysql-params-with-fast_executemanytrue
607
+ """
608
+ ...
609
+
610
+ @fast_executemany.setter
611
+ def fast_executemany(self, value: bool) -> None:
612
+ ...
613
+
614
+ @property
615
+ def rows_as_dicts(self) -> bool:
616
+ """If True, rows are returned as dicts instead of Row objects."""
617
+ ...
618
+
619
+ @rows_as_dicts.setter
620
+ def rows_as_dicts(self, value: bool) -> None:
621
+ ...
622
+
623
+ @property
624
+ def hstmt(self) -> ctypes.c_void_p | None:
625
+ """ODBC handle for the statement."""
626
+ ...
627
+
628
+ @property
629
+ def messages(self) -> list[tuple[str, str | bytes]] | None:
630
+ """Any descriptive messages returned by the last call to execute(), e.g. PRINT
631
+ statements, or None."""
632
+ ...
633
+
634
+ @property
635
+ def noscan(self) -> bool:
636
+ """Whether the driver should scan SQL strings for escape sequences, default is True."""
637
+ ...
638
+
639
+ @noscan.setter
640
+ def noscan(self, value: bool) -> None:
641
+ ...
642
+
643
+ @property
644
+ def rowcount(self) -> int:
645
+ """The number of rows modified by the last SQL statement. Has the value of -1
646
+ if the number of rows is unknown or unavailable.
647
+ """
648
+ ...
649
+
650
+
651
+ # implemented dunder methods
652
+ def __enter__(self) -> Self: ...
653
+ def __exit__(self, exc_type, exc_value, traceback) -> None: ...
654
+ def __iter__(self, /) -> Cursor: ...
655
+ def __next__(self, /) -> Row: ...
656
+
657
+
658
+ # functions for running SQL queries (in rough order of use)
659
+
660
+ def setinputsizes(self, sizes: Iterable[tuple[int, int, int]] | None, /) -> None:
661
+ """Explicitly declare the types and sizes of the parameters in a query. Set
662
+ to None to clear any previously registered input sizes.
663
+
664
+ Args:
665
+ sizes: A list of tuples, one tuple for each query parameter, where each
666
+ tuple contains:
667
+
668
+ 1. the column datatype
669
+ 2. the column size (char length or decimal precision)
670
+ 3. the decimal scale.
671
+
672
+ For example: [(pyodbc.SQL_WVARCHAR, 50, 0), (pyodbc.SQL_DECIMAL, 18, 4)]
673
+ """
674
+ ...
675
+
676
+ def setoutputsize(self) -> None:
677
+ """Not supported."""
678
+ ...
679
+
680
+ def execute(self, sql: str, *params: Any) -> Cursor:
681
+ """Run a SQL query and return the cursor. If the query returns multiple result
682
+ sets (generally because the SQL query contained multiple statements), retrieve
683
+ them by making multiple calls to the nextset() function.
684
+
685
+ Args:
686
+ sql: The SQL query.
687
+ *params: Any parameters for the SQL query, as positional arguments or a single iterable.
688
+
689
+ Returns:
690
+ The cursor, hence calls on the cursor can be chained.
691
+ """
692
+ ...
693
+
694
+ def executemany(self, sql: str, params: Sequence | Iterator | Generator, /) -> None:
695
+ """Run the SQL query against an iterable of parameters. The behavior of this
696
+ function depends heavily on the setting of the fast_executemany cursor property.
697
+ See the Wiki for details.
698
+ https://github.com/mkleehammer/pyodbc/wiki/Cursor#executemanysql-params-with-fast_executemanyfalse-the-default
699
+ https://github.com/mkleehammer/pyodbc/wiki/Cursor#executemanysql-params-with-fast_executemanytrue
700
+
701
+ Args:
702
+ sql: The SQL query.
703
+ *params: Any parameters for the SQL query, as an iterable of parameter sets.
704
+ """
705
+ ...
706
+
707
+ def fetchone(self) -> Row | None:
708
+ """Retrieve the next row in the current result set for the query.
709
+
710
+ Returns:
711
+ A row of results, or None if there is no more data to return.
712
+ """
713
+ ...
714
+
715
+ def fetchmany(self, size: int, /) -> list[Row]:
716
+ """Retrieve the next rows in the current result set for the query, as a list.
717
+
718
+ Args:
719
+ size: The number of rows to return.
720
+
721
+ Returns:
722
+ A list of rows, or an empty list if there is no more data to return.
723
+ """
724
+ ...
725
+
726
+ def fetchall(self) -> list[Row]:
727
+ """Retrieve all the remaining rows in the current result set for the query, as a list.
728
+
729
+ Returns:
730
+ A list of rows, or an empty list if there is no more data to return.
731
+ """
732
+ ...
733
+
734
+ def fetchval(self) -> Any:
735
+ """A convenience function for returning the first column of the first row from
736
+ the query.
737
+
738
+ Returns:
739
+ The value in the first column of the first row, or None if there is no data.
740
+ """
741
+ ...
742
+
743
+ def skip(self, count: int, /) -> None:
744
+ """Skip over rows in the current result set of a query.
745
+
746
+ Args:
747
+ count: The number of rows to skip.
748
+ """
749
+ ...
750
+
751
+ def nextset(self) -> bool:
752
+ """Switch to the next result set returned by the SQL query (this happens when
753
+ there are multiple statements within the SQL query that was just executed).
754
+
755
+ Returns:
756
+ True if there are more result sets, False otherwise.
757
+ """
758
+ ...
759
+
760
+ def commit(self) -> None:
761
+ """A convenience function for executing a commit on the parent connection.
762
+ Commits all pending transactions on the parent connection since the last
763
+ commit/rollback. This includes all SQL statements executed from ALL cursors
764
+ created on the parent connection, not just this cursor."""
765
+ ...
766
+
767
+ def rollback(self) -> None:
768
+ """A convenience function for executing a rollback on the parent connection.
769
+ Rolls back all pending transactions on the parent connection since the last
770
+ commit/rollback. This includes all SQL statements executed from ALL cursors
771
+ created on the parent connection, not just this cursor."""
772
+ ...
773
+
774
+ def cancel(self) -> None:
775
+ """Cancel the processing of the current query. Typically this has to be called
776
+ from a separate thread.
777
+ """
778
+ ...
779
+
780
+ def close(self) -> None:
781
+ """Close the cursor, discarding any remaining result sets and/or messages."""
782
+ ...
783
+
784
+
785
+ # functions to retrieve database metadata
786
+
787
+ def tables(self,
788
+ table: str | None = None,
789
+ catalog: str | None = None,
790
+ schema: str | None = None,
791
+ tableType: str | None = None) -> Cursor:
792
+ """Return information about tables in the database, typically from the
793
+ INFORMATION_SCHEMA.TABLES metadata view. Parameter values can include
794
+ wildcard characters.
795
+
796
+ Args:
797
+ table: Name of the database table.
798
+ catalog: Name of the catalog (database).
799
+ schema: Name of the table schema.
800
+ tableType: Kind of table, e.g. "BASE TABLE".
801
+
802
+ Returns:
803
+ The cursor object, containing table information in the result set.
804
+ """
805
+ ...
806
+
807
+ def tablePrivileges(self,
808
+ table: str | None = None,
809
+ catalog: str | None = None,
810
+ schema: str | None = None) -> Cursor:
811
+ """Return information about privileges granted for the tables in the
812
+ database.
813
+
814
+ Args:
815
+ table: Name of the database table.
816
+ catalog: Name of the catalog (database).
817
+ schema: Name of the table schema.
818
+
819
+ Returns:
820
+ The cursor object, containing table privilege info in the result set.
821
+ """
822
+ ...
823
+
824
+ def columns(self,
825
+ table: str | None = None,
826
+ catalog: str | None = None,
827
+ schema: str | None = None,
828
+ column: str | None = None) -> Cursor:
829
+ """Return information about columns in database tables, typically from the
830
+ INFORMATION_SCHEMA.COLUMNS metadata view. Parameter values can include
831
+ wildcard characters.
832
+
833
+ Args:
834
+ table: Name of the database table.
835
+ catalog: Name of the catalog (database).
836
+ schema: Name of the table schema.
837
+ column: Name of the column in the table.
838
+
839
+ Returns:
840
+ The cursor object, containing column information in the result set.
841
+ """
842
+ ...
843
+
844
+ def statistics(self,
845
+ table: str,
846
+ catalog: str | None = None,
847
+ schema: str | None = None,
848
+ unique: bool = False,
849
+ quick: bool = True) -> Cursor:
850
+ """Return statistical information about database tables. Parameter values
851
+ can include wildcard characters.
852
+
853
+ Args:
854
+ table: Name of the database table.
855
+ catalog: Name of the catalog (database).
856
+ schema: Name of the table schema.
857
+ unique: If True, include information about unique indexes only, not all indexes.
858
+ quick: If True, CARDINALITY and PAGES are returned only if they are readily
859
+ available, otherwise None is returned for them.
860
+
861
+ Returns:
862
+ The cursor object, containing statistical information in the result set.
863
+ """
864
+ ...
865
+
866
+ def rowIdColumns(self,
867
+ table: str,
868
+ catalog: str | None = None,
869
+ schema: str | None = None,
870
+ nullable: bool = True) -> Cursor:
871
+ """Return the column(s) in a database table that uniquely identify each row
872
+ (e.g. the primary key column). Parameter values can include wildcard characters.
873
+
874
+ Args:
875
+ table: Name of the database table.
876
+ catalog: Name of the catalog (database).
877
+ schema: Name of the table schema.
878
+ nullable: If True, include sets of columns that are nullable.
879
+
880
+ Returns:
881
+ The cursor object, containing the relevant column information in the result set.
882
+ """
883
+ ...
884
+
885
+ def rowVerColumns(self,
886
+ table: str,
887
+ catalog: str | None = None,
888
+ schema: str | None = None,
889
+ nullable: bool = True) -> Cursor:
890
+ """Return the column(s) in a database table that are updated whenever the row
891
+ is updated. Parameter values can include wildcard characters.
892
+
893
+ Args:
894
+ table: Name of the database table.
895
+ catalog: Name of the catalog (database).
896
+ schema: Name of the table schema.
897
+ nullable: If True, include sets of columns that are nullable.
898
+
899
+ Returns:
900
+ The cursor object, containing the relevant column information in the result set.
901
+ """
902
+ ...
903
+
904
+ def primaryKeys(self,
905
+ table: str,
906
+ catalog: str | None = None,
907
+ schema: str | None = None) -> Cursor:
908
+ """Return the column(s) in a database table that make up the primary key on
909
+ the table. Parameter values can include wildcard characters.
910
+
911
+ Args:
912
+ table: Name of the database table.
913
+ catalog: Name of the catalog (database).
914
+ schema: Name of the table schema.
915
+
916
+ Returns:
917
+ The cursor object, containing primary key information in the result set.
918
+ """
919
+ ...
920
+
921
+ def foreignKeys(self,
922
+ table: str | None = None,
923
+ catalog: str | None = None,
924
+ schema: str | None = None,
925
+ foreignTable: str | None = None,
926
+ foreignCatalog: str | None = None,
927
+ foreignSchema: str | None = None) -> Cursor:
928
+ """Return the foreign keys in a database table, i.e. any columns that refer to
929
+ primary key columns on another table. Parameter values can include wildcard characters.
930
+
931
+ Args:
932
+ table: Name of the database table.
933
+ catalog: Name of the catalog (database).
934
+ schema: Name of the table schema.
935
+ foreignTable: Name of the foreign database table.
936
+ foreignCatalog: Name of the foreign catalog (database).
937
+ foreignSchema: Name of the foreign table schema.
938
+
939
+ Returns:
940
+ The cursor object, containing foreign key information in the result set.
941
+ """
942
+ ...
943
+
944
+ def procedures(self,
945
+ procedure: str | None = None,
946
+ catalog: str | None = None,
947
+ schema: str | None = None) -> Cursor:
948
+ """Return information about stored procedures. Parameter values can include
949
+ wildcard characters.
950
+
951
+ Args:
952
+ procedure: Name of the stored procedure.
953
+ catalog: Name of the catalog (database).
954
+ schema: Name of the table schema.
955
+
956
+ Returns:
957
+ The cursor object, containing stored procedure information in the result set.
958
+ """
959
+ ...
960
+
961
+ def procedureColumns(self,
962
+ procedure: str | None = None,
963
+ catalog: str | None = None,
964
+ schema: str | None = None) -> Cursor:
965
+ """Return information about the columns used as input/output parameters in
966
+ stored procedures. Parameter values can include wildcard characters.
967
+
968
+ Args:
969
+ procedure: Name of the stored procedure.
970
+ catalog: Name of the catalog (database).
971
+ schema: Name of the table schema.
972
+
973
+ Returns:
974
+ The cursor object, containing stored procedure column information in the result set.
975
+ """
976
+ ...
977
+
978
+ def getTypeInfo(self, sqlType: int | None = None, /) -> Cursor:
979
+ """Return information about data types supported by the data source.
980
+
981
+ Args:
982
+ sqlType: The SQL data type.
983
+
984
+ Returns:
985
+ The cursor object, containing information about the SQL data type in the result set.
986
+ """
987
+ ...
988
+
989
+
990
+ class Row:
991
+ """The class representing a single record in the result set from a query. Objects of
992
+ this class behave somewhat similarly to a NamedTuple. Column values can be accessed
993
+ by column name (i.e. using dot notation) or by row index. Row objects can be pickled.
994
+ """
995
+
996
+ @property
997
+ def cursor_description(self) -> tuple[tuple[str, Any, int, int, int, int, bool]]:
998
+ """The metadata for the columns in this Row, as retrieved from the parent Cursor object."""
999
+ ...
1000
+
1001
+ # implemented dunder methods
1002
+ def __contains__(self, key, /) -> int: ...
1003
+ def __delattr__(self, name, /) -> None: ...
1004
+ def __delitem__(self, key, /) -> None: ...
1005
+ def __eq__(self, value, /) -> bool: ...
1006
+ def __ge__(self, value, /) -> bool: ...
1007
+ def __getattribute__(self, name, /) -> Any: ...
1008
+ def __getitem__(self, key, /) -> Any: ...
1009
+ def __gt__(self, value, /) -> bool: ...
1010
+ def __iter__(self) -> Iterator[Any]: ...
1011
+ def __le__(self, value, /) -> bool: ...
1012
+ def __len__(self, /) -> int: ...
1013
+ def __lt__(self, value, /) -> bool: ...
1014
+ def __ne__(self, value, /) -> bool: ...
1015
+ def __reduce__(self) -> Any: ...
1016
+ def __repr__(self, /) -> str: ...
1017
+ def __setattr__(self, name, value, /) -> None: ...
1018
+ def __setitem__(self, key, value, /) -> None: ...
1019
+
1020
+
1021
+ # module functions
1022
+
1023
+ def dataSources(*, scope: str | None = None) -> dict[str, str]:
1024
+ """Return all available Data Source Names (DSNs), typically from the odbcinst.ini file
1025
+ or the Windows ODBC Data Source Administrator.
1026
+
1027
+ Args:
1028
+ scope: optional filter ("user" or "system") to control which DSNs are returned.
1029
+
1030
+ Returns:
1031
+ A dictionary of DSNs and their textual descriptions.
1032
+ """
1033
+ ...
1034
+
1035
+ def drivers() -> list[str]:
1036
+ """Return the names of all available ODBC drivers, typically from the odbc.ini file or the
1037
+ Windows ODBC Data Source Administrator.
1038
+
1039
+ Returns:
1040
+ A list of driver names.
1041
+ """
1042
+ ...
1043
+
1044
+ def getDecimalSeparator() -> str:
1045
+ """Retrieve the decimal separator character used when parsing NUMERIC/DECIMAL values
1046
+ from the database, e.g. the "." in "1,234.56".
1047
+
1048
+ Returns:
1049
+ The decimal separator character.
1050
+ """
1051
+ ...
1052
+
1053
+ def setDecimalSeparator(sep: str, /) -> None:
1054
+ """Set the decimal separator character used when parsing NUMERIC/DECIMAL values
1055
+ from the database, e.g. the "." in "1,234.56".
1056
+
1057
+ Args:
1058
+ sep: The decimal separator character.
1059
+ """
1060
+ ...
1061
+
1062
+ def connect(connstring: str | None = None,
1063
+ /, *, # only positional parameters before, only named parameters after
1064
+ autocommit: bool = False,
1065
+ encoding: str = 'utf-16le',
1066
+ readonly: bool = False,
1067
+ timeout: int = 0,
1068
+ attrs_before: dict[int, int | bytes | bytearray | str | Sequence[str]] | None = None,
1069
+ **kwargs: Any) -> Connection:
1070
+ """Create a new ODBC connection to a database. See the Wiki for details:
1071
+ https://github.com/mkleehammer/pyodbc/wiki/The-pyodbc-Module#connect
1072
+
1073
+ Args:
1074
+ connstring: The connection string, which is passed verbatim to the driver manager.
1075
+ autocommit: If True, instructs the database to commit after each SQL statement.
1076
+ encoding: Encoding codec used when sending textual connection parameters to the database.
1077
+ readonly: To set the connection read-only. Not all drivers and/or databases support this.
1078
+ timeout: Set the connection timeout, in seconds. This is managed by the driver, not
1079
+ pyodbc, and not all drivers support this.
1080
+ driver_completion: One of SQL_DRIVER_PROMPT (only available on Windows),
1081
+ SQL_DRIVER_NO_PROMPT (the default), SQL_DRIVER_COMPLETE, or
1082
+ SQL_DRIVER_COMPLETE_REQUIRED.
1083
+ attrs_before: Set low-level connection attributes before a connection is attempted.
1084
+ **kwargs: These key/value pairs are used to construct the connection string, or add
1085
+ to it (as "key=value;" combinations).
1086
+
1087
+ Returns:
1088
+ A new Connection object.
1089
+ """
1090
+ ...