arrowsql 0.1.0__cp313-cp313-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.
Files changed (45) hide show
  1. arrowsql/__init__.py +653 -0
  2. arrowsql/_rust_auth.py +170 -0
  3. arrowsql/_server_sqlstate.py +11 -0
  4. arrowsql/_utf8_strings.py +78 -0
  5. arrowsql/agent.py +620 -0
  6. arrowsql/aio.py +533 -0
  7. arrowsql/arrow_parallel.py +464 -0
  8. arrowsql/async_query/__init__.py +40 -0
  9. arrowsql/async_query/_connection_context.py +39 -0
  10. arrowsql/async_query/_native.py +24 -0
  11. arrowsql/async_query/async_connection.py +160 -0
  12. arrowsql/async_query/async_cursor.py +225 -0
  13. arrowsql/async_query/async_execute.py +113 -0
  14. arrowsql/async_query/async_fetch.py +153 -0
  15. arrowsql/async_query/exception_translator.py +132 -0
  16. arrowsql/auth.py +913 -0
  17. arrowsql/bulk_parallel.py +385 -0
  18. arrowsql/connection.py +2377 -0
  19. arrowsql/connection_string_builder.py +114 -0
  20. arrowsql/connection_string_parser.py +417 -0
  21. arrowsql/constants.py +701 -0
  22. arrowsql/cursor.py +4516 -0
  23. arrowsql/db_connection.py +98 -0
  24. arrowsql/ddbc_bindings.cp313-win_amd64.pyd +0 -0
  25. arrowsql/ddbc_bindings.pyi +283 -0
  26. arrowsql/decimal_config.py +98 -0
  27. arrowsql/exceptions.py +378 -0
  28. arrowsql/helpers.py +436 -0
  29. arrowsql/logging.py +700 -0
  30. arrowsql/mssql_python.pyi +579 -0
  31. arrowsql/odbc_provider.py +269 -0
  32. arrowsql/parameter_helper.py +442 -0
  33. arrowsql/perf_timer.py +286 -0
  34. arrowsql/pooling.py +147 -0
  35. arrowsql/py.typed +1 -0
  36. arrowsql/row.py +462 -0
  37. arrowsql/type.py +160 -0
  38. arrowsql-0.1.0.dist-info/METADATA +146 -0
  39. arrowsql-0.1.0.dist-info/RECORD +45 -0
  40. arrowsql-0.1.0.dist-info/WHEEL +4 -0
  41. arrowsql-0.1.0.dist-info/entry_points.txt +2 -0
  42. arrowsql-0.1.0.dist-info/licenses/LICENSE +21 -0
  43. arrowsql-0.1.0.dist-info/licenses/LICENSE.upstream-mssql-python +47 -0
  44. arrowsql-0.1.0.dist-info/sboms/ddbc_bindings.cyclonedx.json +5195 -0
  45. mssql_python/__init__.py +39 -0
@@ -0,0 +1,146 @@
1
+ Metadata-Version: 2.4
2
+ Name: arrowsql
3
+ Version: 0.1.0
4
+ Classifier: Development Status :: 3 - Alpha
5
+ Classifier: Intended Audience :: Developers
6
+ Classifier: Operating System :: POSIX :: Linux
7
+ Classifier: Operating System :: MacOS
8
+ Classifier: Operating System :: Microsoft :: Windows
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Python :: 3 :: Only
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Programming Language :: Python :: 3.14
16
+ Classifier: Programming Language :: Python :: 3.15
17
+ Classifier: Programming Language :: Python :: Free Threading :: 2 - Beta
18
+ Classifier: Programming Language :: Python :: Implementation :: CPython
19
+ Classifier: Programming Language :: Rust
20
+ Classifier: Topic :: Database
21
+ Classifier: Typing :: Typed
22
+ Requires-Dist: pyarrow>=14 ; extra == 'arrow'
23
+ Requires-Dist: mssql-python-rs==0.4.0 ; extra == 'async-preview'
24
+ Requires-Dist: azure-identity ; extra == 'azure'
25
+ Provides-Extra: arrow
26
+ Provides-Extra: async-preview
27
+ Provides-Extra: azure
28
+ License-File: LICENSE
29
+ License-File: LICENSE.upstream-mssql-python
30
+ Summary: mssql-python with its ODBC/C++ core replaced by Rust (PyO3 + mssql-tds)
31
+ Keywords: mssql,sql server,tds,dbapi,arrow,asyncio,pyo3
32
+ Author: BMS Suisse
33
+ License-Expression: MIT
34
+ Requires-Python: >=3.10
35
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
36
+ Project-URL: Changelog, https://github.com/bmsuisse/arrowsql/blob/main/CHANGELOG.md
37
+ Project-URL: Homepage, https://github.com/bmsuisse/arrowsql
38
+ Project-URL: Issues, https://github.com/bmsuisse/arrowsql/issues
39
+ Project-URL: Repository, https://github.com/bmsuisse/arrowsql
40
+ Project-URL: Upstream, https://github.com/microsoft/mssql-python
41
+
42
+ <p align="center">
43
+ <picture>
44
+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/logo-dark.svg">
45
+ <img src="docs/assets/logo.svg" alt="arrowsql" width="420">
46
+ </picture>
47
+ </p>
48
+
49
+ <p align="center">
50
+ Fast SQL Server driver for Python with a Rust core. Drop-in for
51
+ <a href="https://github.com/microsoft/mssql-python">mssql-python</a>, Arrow-native.
52
+ </p>
53
+
54
+ <p align="center">
55
+ <a href="https://pypi.org/project/arrowsql/"><img src="https://img.shields.io/pypi/v/arrowsql" alt="PyPI"></a>
56
+ <a href="https://pypi.org/project/arrowsql/"><img src="https://img.shields.io/pypi/pyversions/arrowsql" alt="Python versions"></a>
57
+ <a href="https://github.com/bmsuisse/arrowsql/actions/workflows/ci.yml"><img src="https://github.com/bmsuisse/arrowsql/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
58
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="MIT license"></a>
59
+ </p>
60
+
61
+ - **2-7x faster than mssql-python**, up to 10x faster than pyodbc on large reads.
62
+ - **Arrow out of the box:** results go straight to DuckDB, polars, pyarrow and Delta, no pyarrow required.
63
+ - **Parallel reads and bulk loads** over several connections.
64
+ - **No ODBC driver:** native TDS in Rust, zero required dependencies, wheels for Linux, macOS and Windows.
65
+ - **Drop-in:** same DB-API, same connection strings; `import mssql_python` keeps working.
66
+
67
+ ## Install
68
+
69
+ ```bash
70
+ pip install arrowsql
71
+ ```
72
+
73
+ Extras: `arrowsql[arrow]` (pyarrow for `cursor.arrow()`), `arrowsql[azure]` (Entra ID login).
74
+ Do not install it next to Microsoft's `mssql-python`: both provide the `mssql_python` package.
75
+
76
+ ## Quick start
77
+
78
+ ```python
79
+ import arrowsql
80
+
81
+ conn = arrowsql.connect("Server=myserver;Database=sales;Uid=app;Pwd=...;Encrypt=yes")
82
+ cur = conn.cursor()
83
+ cur.execute("SELECT id, total FROM dbo.orders WHERE customer_id = ?", (42,))
84
+ for row in cur.fetchall():
85
+ print(row.id, row.total)
86
+ ```
87
+
88
+ ## Arrow, DuckDB, polars
89
+
90
+ ```python
91
+ import duckdb
92
+
93
+ t = cur.execute("SELECT * FROM dbo.orders").fetchall_arrow() # native Arrow table
94
+ duckdb.sql("SELECT customer_id, sum(total) FROM t GROUP BY 1").show()
95
+
96
+ # Large tables: read over 8 connections and stream into DuckDB, deltalake or polars
97
+ with arrowsql.read_arrow_stream(conn_str, "SELECT * FROM dbo.orders",
98
+ partition_on="id", partitions=8) as stream:
99
+ duckdb.sql("SELECT avg(total) FROM stream").show()
100
+ ```
101
+
102
+ String columns travel as UTF-8 on SQL Server 2019+ (about half the bytes). More in [examples/](examples/).
103
+
104
+ ## Bulk loads
105
+
106
+ ```python
107
+ cur.bulkcopy_arrow("dbo.orders", arrow_table) # Arrow -> TDS bulk load
108
+ arrowsql.write_arrow(conn_str, "dbo.orders", arrow_table, workers=8) # in parallel
109
+ ```
110
+
111
+ ## Async and agent mode
112
+
113
+ - `arrowsql.aio`: native asyncio with a connection pool; cancelling a task cancels the query
114
+ ([docs/ASYNC.md](docs/ASYNC.md)).
115
+ - `arrowsql-agent -c "SELECT ..."`: bounded, typed output and JSON errors for LLM agents
116
+ ([docs/AGENT_MODE.md](docs/AGENT_MODE.md)).
117
+
118
+ ## Benchmarks
119
+
120
+ NYC taxi data (2.96M rows x 20 columns), SQL Server 2022 on the same host. Compare ratios: the box was shared.
121
+
122
+ | | mssql-python | arrowsql | pyodbc |
123
+ |---|---:|---:|---:|
124
+ | `fetchall()`, 100k rows | 0.351 s | **0.117 s** | 0.865 s |
125
+ | `fetchmany`, 3M rows | 9.74 s | **2.75 s** | 27.0 s |
126
+ | Arrow, 3M rows over 8 connections | 4.25 s | **0.59 s** | – |
127
+ | Bulk load, 3M rows (8 workers) | 12.35 s | **1.82 s** | – |
128
+ | `executemany`, 100k rows | 1.26 s | **0.65 s** | 0.76 s |
129
+ | 16 threads x point lookups | 2.40 s | **0.43 s** | – |
130
+
131
+ Reproduce: `scripts/bench_reproduce.sh`. Full matrix: [benchmarks/RESULTS.md](benchmarks/RESULTS.md).
132
+
133
+ ## Docs
134
+
135
+ [Compatibility](docs/CONTRACT.md) ·
136
+ [Platforms and connection strings](docs/PLATFORMS_AND_CONNECTION.md) ·
137
+ [Features](docs/FEATURES.md) ·
138
+ [Architecture](docs/ARCHITECTURE.md) ·
139
+ [Performance notes](docs/PERFORMANCE_RESEARCH.md) ·
140
+ [Contributing](CONTRIBUTING.md)
141
+
142
+ ## License
143
+
144
+ MIT. Builds on [microsoft/mssql-python](https://github.com/microsoft/mssql-python) and
145
+ [mssql-tds](https://github.com/microsoft/mssql-rs) (both MIT).
146
+
@@ -0,0 +1,45 @@
1
+ arrowsql/__init__.py,sha256=Mdm_f65lPcZyvrmhjeGD7eRZCNTfD2GF5OkMxU2Rd-Q,18338
2
+ arrowsql/_rust_auth.py,sha256=67JH0C56MvNZvZTlKjo3q0RGABP-5-mN-qveilJXKNE,7195
3
+ arrowsql/_server_sqlstate.py,sha256=igzd9gLVf6AHugHxJIz4URal4eUmmZ4d9_Eb5R581Ik,356
4
+ arrowsql/_utf8_strings.py,sha256=BwUBBISk_E9f5nZLm2JhEQgFIy5GKUB_ysmNRUwPzVI,3607
5
+ arrowsql/agent.py,sha256=GjbROhCWAfx5auHYBELByRVUlxzCOJ8OYtoM7aYG6XM,21477
6
+ arrowsql/aio.py,sha256=yy9vd6Zaq7JlncXxpVJvWjqFlsZloiN2z-4aKcQINj8,18710
7
+ arrowsql/arrow_parallel.py,sha256=xEPx1Uf3TXWd4ayyffI8ishfO01-dz64zq4PQ_tgGpQ,19600
8
+ arrowsql/async_query/__init__.py,sha256=WGzuwRAiMLTZvg0ZIsiYaprBYg2fJysNhs3-2ArxyiA,1128
9
+ arrowsql/async_query/_connection_context.py,sha256=ABqj3nt-JKxFomCbQ8EHtDv8VsH_nAhO5ZilipafJ9E,1747
10
+ arrowsql/async_query/_native.py,sha256=DuDBl2ZiWSzsneTTd0aELMZ7rFuF_mYLIRbo3SXH0Mo,944
11
+ arrowsql/async_query/async_connection.py,sha256=bN0VB7nliWTKGZH52jraXGbd92q3vnIiqtq25k5ipGg,6247
12
+ arrowsql/async_query/async_cursor.py,sha256=nQ56DMd7OBSeciN1a0dMjHsr7Z4g_VzBd5EHyQlICwk,8367
13
+ arrowsql/async_query/async_execute.py,sha256=D5z92-W9q1sFRoMDQ-ZVudlF6TpFqVGsuQqxIhfDAMk,4343
14
+ arrowsql/async_query/async_fetch.py,sha256=dlXO3AJmwosmmkmZP5lKtUWEs9L0nF6xtBaudnzRFk8,6422
15
+ arrowsql/async_query/exception_translator.py,sha256=x55DXuXO9HwXpmRPD90ReyDQq650F32c_uzz3c7_Ews,4752
16
+ arrowsql/auth.py,sha256=eUet5AQ5nH2SVafSI0rarTExOdvwtnqCXDIZNVHMnSk,43660
17
+ arrowsql/bulk_parallel.py,sha256=dnLIjjOPBvduhWtgYlXi4koyt7B5Qx1BPBT_SBYq5VE,14895
18
+ arrowsql/connection.py,sha256=MmKX7KX1VEjJIUKT7Zh98mHCYoZ1hvdurKuWTTD6DdM,114299
19
+ arrowsql/connection_string_builder.py,sha256=oloMYNZew_Q4JSA-E2fUuDzYN_s30Hi3Tq0xHPWAR24,3800
20
+ arrowsql/connection_string_parser.py,sha256=GitkcK_7dkveO7BXoLpKDFQvbkBuFAOLmDvdAXSUABA,15756
21
+ arrowsql/constants.py,sha256=X4L_8-QpAVDgod0O0CEiU3pA5Dg2cI75cUmZVGFyc3M,23339
22
+ arrowsql/cursor.py,sha256=WrMSFECLgrFP8HKCvv75eV3U0Qz1y81ZPEUzAOTUKsY,203809
23
+ arrowsql/db_connection.py,sha256=RO9L17e27588ZM7GtpRDp8vcIW54YcudJc__JoQ83PY,5038
24
+ arrowsql/ddbc_bindings.cp313-win_amd64.pyd,sha256=qq4VOo-lcieuNfCRMR8sDyJchFyyYtDKXA0oXS3zha0,8059392
25
+ arrowsql/ddbc_bindings.pyi,sha256=RJPr-O4o18PZ9WJ115qleYdr-nX1AkONdprnldlPeCM,9489
26
+ arrowsql/decimal_config.py,sha256=URkrrxnQbuxoKGU066FfsZAH5EugcBlmXmsM97pDAOs,3300
27
+ arrowsql/exceptions.py,sha256=iDgkwRS8NjA9fLSOlrZe_fG55e-x7BgQqIKJu9rqRFw,16639
28
+ arrowsql/helpers.py,sha256=OQclwwThQsMfdceQfDg9Wk67xWjeWTTPy3DK5WNA0Z0,16331
29
+ arrowsql/logging.py,sha256=f3_Sc5W7I6DYSWk-Gzw2RLTJ7TQBvrDfoGTCQjL7Yqc,27178
30
+ arrowsql/mssql_python.pyi,sha256=rfV5SJVhNVfPJ9GjK4tevYh3CXQaINNU9kWGNsikZDk,18591
31
+ arrowsql/odbc_provider.py,sha256=SIDarL7iZs80KzK06NDTz0Jk4YQ7m466Aix3rS1wghs,10792
32
+ arrowsql/parameter_helper.py,sha256=t2VwiFmHZby_7HL8zwKJ6-nOdkg15teN_yvh1dsRss0,16305
33
+ arrowsql/perf_timer.py,sha256=vWljDAG8Zn2f3SC0764uAAD-oi8Sv6V9_J8yIknszcw,8275
34
+ arrowsql/pooling.py,sha256=LyuKzKkFO_qScQCJuK4Bxg_6Uk6XL3-D2F5O5w5fTto,5725
35
+ arrowsql/py.typed,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
36
+ arrowsql/row.py,sha256=BKqN2L16_yYWurKvz314XIHfh2EpGXjYMNwa64xZ54Y,19746
37
+ arrowsql/type.py,sha256=lHCeVzFK1PyU3WS1NtBkvqSipFZetsyOW8AhGs4z-1g,4160
38
+ arrowsql-0.1.0.dist-info/METADATA,sha256=heeFpKGlI-QfAmL6HaxfjS22hSzm93uSRvWmIQ9wdx0,6044
39
+ arrowsql-0.1.0.dist-info/WHEEL,sha256=1CCnYT4CkPGtkem-vV3hqFTPRTmfZy2aMkAyn2cGMqA,97
40
+ arrowsql-0.1.0.dist-info/entry_points.txt,sha256=R9Kq7qXgYWNHhCtGYKKS4D6UuxM6j4mzJRivP7x7z_0,53
41
+ arrowsql-0.1.0.dist-info/licenses/LICENSE,sha256=7r3wJA7nPY7MknTKbnVc9_4gXvlr7MtYFEg8mi2yoN0,1116
42
+ arrowsql-0.1.0.dist-info/licenses/LICENSE.upstream-mssql-python,sha256=tMWsxLSz13xS8IQOwtLLNnrtInvjvKds2j5xmJAVsZA,2694
43
+ arrowsql-0.1.0.dist-info/sboms/ddbc_bindings.cyclonedx.json,sha256=-i3rdEB_a8cP1sFT5i0XqNiw7m-NNgTCNLQbQPci9wE,164974
44
+ mssql_python/__init__.py,sha256=hjGQtXnHfqtW_XwdjBnfVZV36lGK8aK9A6E7EKSCM0M,1347
45
+ arrowsql-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.16.0)
3
+ Root-Is-Purelib: false
4
+ Tag: cp313-cp313-win_amd64
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ arrowsql-agent=arrowsql.agent:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 BMS Bau-Material-Systeme AG / bmsuisse
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,47 @@
1
+ MIT License
2
+ All files licensed under the MIT license except the dynamic-link libraries (DLLs) in the mssql_python\libs\win folder,
3
+ which are subject to different licensing terms. Please review the licensing details for each component below.
4
+
5
+ A. MIT License
6
+ ==================================================================
7
+ Copyright (c) Microsoft Corporation.
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ of this software and associated documentation files (the "Software"), to deal
11
+ in the Software without restriction, including without limitation the rights
12
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ copies of the Software, and to permit persons to whom the Software is
14
+ furnished to do so, subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in all
17
+ copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ SOFTWARE
26
+
27
+
28
+ B. MICROSOFT LICENSES
29
+ ==================================================================
30
+ The following dynamic-link libraries (DLLs) in the mssql_python\libs\win folder fall under different Microsoft licenses.
31
+ Below is a breakdown of these components by their respective licenses.
32
+
33
+ 1. Microsoft ODBC Driver 18 End User License Agreement (EULA)
34
+ These components are part of the Microsoft ODBC Driver 18 for SQL Server and are governed by the Microsoft ODBC Driver 18 EULA.
35
+
36
+ - msodbcsqlr18.rll: Resource library containing localized error messages for the ODBC driver.
37
+ - msodbcdiag18.dll: Diagnostic library for handling error reporting and troubleshooting.
38
+ - msodbcsql18.dll: Core ODBC driver enabling connectivity between SQL Server and applications.
39
+
40
+ For official licensing terms, refer to: mssql_python\libs\win\MICROSOFT_ODBC_DRIVER_FOR_SQL_SERVER_LICENSE.txt
41
+
42
+ 2. Microsoft Visual C++ Redistributable EULA
43
+ These components are part of the Microsoft Visual C++ Redistributable and are governed by the Microsoft Visual C++ Redistributable EULA.
44
+
45
+ - msvcp140.dll: Microsoft C++ Standard Library runtime, required for running C++ applications.
46
+
47
+ For redistribution and usage terms, refer to: mssql_python\libs\win\libs\win\MICROSOFT_VISUAL_STUDIO_LICENSE.txt