sqlspec 0.8.0__tar.gz → 0.9.0__tar.gz
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.
- {sqlspec-0.8.0 → sqlspec-0.9.0}/Makefile +2 -2
- {sqlspec-0.8.0 → sqlspec-0.9.0}/PKG-INFO +4 -1
- {sqlspec-0.8.0 → sqlspec-0.9.0}/README.md +1 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/pyproject.toml +31 -4
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/_typing.py +39 -6
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/adapters/adbc/__init__.py +2 -2
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/adapters/adbc/config.py +34 -11
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/adapters/adbc/driver.py +167 -108
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/adapters/aiosqlite/__init__.py +2 -2
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/adapters/aiosqlite/config.py +2 -2
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/adapters/aiosqlite/driver.py +28 -39
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/adapters/asyncmy/__init__.py +3 -3
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/adapters/asyncmy/config.py +11 -12
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/adapters/asyncmy/driver.py +25 -34
- sqlspec-0.9.0/sqlspec/adapters/asyncpg/__init__.py +9 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/adapters/asyncpg/config.py +17 -19
- sqlspec-0.9.0/sqlspec/adapters/asyncpg/driver.py +444 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/adapters/duckdb/__init__.py +2 -2
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/adapters/duckdb/config.py +2 -2
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/adapters/duckdb/driver.py +49 -49
- sqlspec-0.9.0/sqlspec/adapters/oracledb/__init__.py +16 -0
- sqlspec-0.9.0/sqlspec/adapters/oracledb/config/__init__.py +9 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/adapters/oracledb/config/_asyncio.py +9 -10
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/adapters/oracledb/config/_sync.py +8 -9
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/adapters/oracledb/driver.py +114 -41
- sqlspec-0.9.0/sqlspec/adapters/psqlpy/config.py +258 -0
- sqlspec-0.9.0/sqlspec/adapters/psqlpy/driver.py +335 -0
- sqlspec-0.9.0/sqlspec/adapters/psycopg/__init__.py +16 -0
- sqlspec-0.9.0/sqlspec/adapters/psycopg/config/__init__.py +9 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/adapters/psycopg/config/_async.py +12 -12
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/adapters/psycopg/config/_sync.py +13 -13
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/adapters/psycopg/driver.py +180 -218
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/adapters/sqlite/__init__.py +2 -2
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/adapters/sqlite/config.py +2 -2
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/adapters/sqlite/driver.py +43 -41
- sqlspec-0.9.0/sqlspec/base.py +729 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/exceptions.py +30 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/extensions/litestar/config.py +6 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/extensions/litestar/handlers.py +25 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/extensions/litestar/plugin.py +6 -1
- sqlspec-0.9.0/sqlspec/statement.py +373 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/typing.py +10 -1
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/fixtures/sql_utils.py +4 -2
- sqlspec-0.9.0/tests/integration/__init__.py +3 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/integration/test_adapters/test_adbc/__init__.py +4 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/integration/test_adapters/test_adbc/conftest.py +3 -3
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/integration/test_adapters/test_adbc/test_connection.py +4 -2
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/integration/test_adapters/test_adbc/test_driver_bigquery.py +54 -17
- sqlspec-0.9.0/tests/integration/test_adapters/test_adbc/test_driver_duckdb.py +444 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/integration/test_adapters/test_adbc/test_driver_postgres.py +37 -3
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/integration/test_adapters/test_adbc/test_driver_sqlite.py +125 -17
- sqlspec-0.9.0/tests/integration/test_adapters/test_aiosqlite/__init__.py +5 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/integration/test_adapters/test_aiosqlite/test_connection.py +3 -2
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/integration/test_adapters/test_aiosqlite/test_driver.py +11 -24
- sqlspec-0.9.0/tests/integration/test_adapters/test_asyncmy/__init__.py +3 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/integration/test_adapters/test_asyncmy/test_connection.py +6 -5
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/integration/test_adapters/test_asyncmy/test_driver.py +15 -10
- sqlspec-0.9.0/tests/integration/test_adapters/test_asyncpg/test_connection.py +42 -0
- sqlspec-0.9.0/tests/integration/test_adapters/test_asyncpg/test_driver.py +275 -0
- sqlspec-0.9.0/tests/integration/test_adapters/test_duckdb/__init__.py +5 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/integration/test_adapters/test_duckdb/test_connection.py +5 -2
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/integration/test_adapters/test_duckdb/test_driver.py +43 -9
- sqlspec-0.9.0/tests/integration/test_adapters/test_oracledb/__init__.py +5 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/integration/test_adapters/test_oracledb/test_connection.py +11 -11
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/integration/test_adapters/test_oracledb/test_driver_async.py +59 -24
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/integration/test_adapters/test_oracledb/test_driver_sync.py +55 -21
- sqlspec-0.9.0/tests/integration/test_adapters/test_psqlpy/test_connection.py +66 -0
- sqlspec-0.9.0/tests/integration/test_adapters/test_psqlpy/test_driver.py +191 -0
- sqlspec-0.9.0/tests/integration/test_adapters/test_psycopg/__init__.py +5 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/integration/test_adapters/test_psycopg/test_connection.py +36 -37
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/integration/test_adapters/test_psycopg/test_driver.py +48 -41
- sqlspec-0.9.0/tests/integration/test_adapters/test_sqlite/__init__.py +5 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/integration/test_adapters/test_sqlite/test_connection.py +5 -2
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/integration/test_adapters/test_sqlite/test_driver.py +6 -2
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/unit/test_adapters/test_adbc/test_config.py +5 -7
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/unit/test_adapters/test_aiosqlite/test_config.py +7 -7
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/unit/test_adapters/test_asyncmy/test_config.py +8 -8
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/unit/test_adapters/test_asyncpg/test_config.py +9 -9
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/unit/test_adapters/test_duckdb/test_config.py +6 -6
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/unit/test_adapters/test_oracledb/test_async_config.py +8 -8
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/unit/test_adapters/test_oracledb/test_sync_config.py +8 -8
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/unit/test_adapters/test_psycopg/test_async_config.py +5 -5
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/unit/test_adapters/test_psycopg/test_sync_config.py +5 -5
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/unit/test_adapters/test_sqlite/test_config.py +7 -7
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/unit/test_base.py +24 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/uv.lock +113 -20
- sqlspec-0.8.0/sqlspec/adapters/asyncpg/__init__.py +0 -9
- sqlspec-0.8.0/sqlspec/adapters/asyncpg/driver.py +0 -288
- sqlspec-0.8.0/sqlspec/adapters/oracledb/__init__.py +0 -16
- sqlspec-0.8.0/sqlspec/adapters/oracledb/config/__init__.py +0 -9
- sqlspec-0.8.0/sqlspec/adapters/psycopg/__init__.py +0 -11
- sqlspec-0.8.0/sqlspec/adapters/psycopg/config/__init__.py +0 -9
- sqlspec-0.8.0/sqlspec/base.py +0 -607
- sqlspec-0.8.0/tests/integration/test_adapters/test_adbc/test_driver_duckdb.py +0 -228
- sqlspec-0.8.0/tests/integration/test_adapters/test_aiosqlite/__init__.py +0 -1
- sqlspec-0.8.0/tests/integration/test_adapters/test_aiosqlite/conftest.py +0 -16
- sqlspec-0.8.0/tests/integration/test_adapters/test_duckdb/__init__.py +0 -1
- sqlspec-0.8.0/tests/integration/test_adapters/test_oracledb/__init__.py +0 -1
- sqlspec-0.8.0/tests/integration/test_adapters/test_psycopg/__init__.py +0 -1
- sqlspec-0.8.0/tests/integration/test_adapters/test_sqlite/__init__.py +0 -1
- {sqlspec-0.8.0 → sqlspec-0.9.0}/.gitignore +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/.pre-commit-config.yaml +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/CONTRIBUTING.rst +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/LICENSE +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/NOTICE +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/__init__.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/__metadata__.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/_serialization.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/adapters/__init__.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/adapters/oracledb/config/_common.py +0 -0
- {sqlspec-0.8.0/sqlspec/extensions → sqlspec-0.9.0/sqlspec/adapters/psqlpy}/__init__.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/adapters/psycopg/config/_common.py +0 -0
- {sqlspec-0.8.0/tests → sqlspec-0.9.0/sqlspec/extensions}/__init__.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/extensions/litestar/__init__.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/extensions/litestar/_utils.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/filters.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/py.typed +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/utils/__init__.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/utils/deprecation.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/utils/fixtures.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/utils/module_loader.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/utils/sync_tools.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/sqlspec/utils/text.py +0 -0
- {sqlspec-0.8.0/tests/integration → sqlspec-0.9.0/tests}/__init__.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/conftest.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/fixtures/__init__.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/fixtures/example_usage.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/integration/test_adapters/__init__.py +0 -0
- {sqlspec-0.8.0/tests/integration/test_adapters/test_asyncmy → sqlspec-0.9.0/tests/integration/test_adapters/test_asyncpg}/__init__.py +0 -0
- {sqlspec-0.8.0/tests/unit → sqlspec-0.9.0/tests/integration/test_adapters/test_psqlpy}/__init__.py +0 -0
- {sqlspec-0.8.0/tests/unit/test_adapters → sqlspec-0.9.0/tests/unit}/__init__.py +0 -0
- {sqlspec-0.8.0/tests/unit/test_adapters/test_duckdb → sqlspec-0.9.0/tests/unit/test_adapters}/__init__.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/unit/test_adapters/test_adbc/__init__.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/unit/test_adapters/test_aiosqlite/__init__.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/unit/test_adapters/test_asyncmy/__init__.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/unit/test_adapters/test_asyncpg/__init__.py +0 -0
- {sqlspec-0.8.0/tests/unit/test_utils → sqlspec-0.9.0/tests/unit/test_adapters/test_duckdb}/__init__.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/unit/test_adapters/test_oracledb/__init__.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/unit/test_adapters/test_psycopg/__init__.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/unit/test_adapters/test_sqlite/__init__.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/unit/test_typing.py +0 -0
- {sqlspec-0.8.0/tools → sqlspec-0.9.0/tests/unit/test_utils}/__init__.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/unit/test_utils/test_module_loader.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/unit/test_utils/test_sync_tools.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tests/unit/test_utils/test_text.py +0 -0
- /sqlspec-0.8.0/tests/integration/test_adapters/test_psycopg/conftest.py → /sqlspec-0.9.0/tools/__init__.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tools/build_docs.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tools/pypi_readme.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tools/sphinx_ext/__init__.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tools/sphinx_ext/changelog.py +0 -0
- {sqlspec-0.8.0 → sqlspec-0.9.0}/tools/sphinx_ext/missing_references.py +0 -0
|
@@ -118,7 +118,7 @@ clean: ## Cleanup temporary build a
|
|
|
118
118
|
.PHONY: test
|
|
119
119
|
test: ## Run the tests
|
|
120
120
|
@echo "${INFO} Running test cases... 🧪"
|
|
121
|
-
@uv run pytest tests
|
|
121
|
+
@uv run pytest -n 2 --dist=loadgroup tests
|
|
122
122
|
@echo "${OK} Tests complete ✨"
|
|
123
123
|
|
|
124
124
|
.PHONY: test-all
|
|
@@ -128,7 +128,7 @@ test-all: tests ## Run all tests
|
|
|
128
128
|
.PHONY: coverage
|
|
129
129
|
coverage: ## Run tests with coverage report
|
|
130
130
|
@echo "${INFO} Running tests with coverage... 📊"
|
|
131
|
-
@uv run pytest --cov -n
|
|
131
|
+
@uv run pytest --cov -n 2 --dist=loadgroup --quiet
|
|
132
132
|
@uv run coverage html >/dev/null 2>&1
|
|
133
133
|
@uv run coverage xml >/dev/null 2>&1
|
|
134
134
|
@echo "${OK} Coverage report generated ✨"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sqlspec
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.9.0
|
|
4
4
|
Summary: SQL Experiments in Python
|
|
5
5
|
Author-email: Cody Fincher <cody@litestar.dev>
|
|
6
6
|
Maintainer-email: Litestar Developers <hello@litestar.dev>
|
|
@@ -42,6 +42,8 @@ Provides-Extra: orjson
|
|
|
42
42
|
Requires-Dist: orjson; extra == 'orjson'
|
|
43
43
|
Provides-Extra: performance
|
|
44
44
|
Requires-Dist: sqlglot[rs]; extra == 'performance'
|
|
45
|
+
Provides-Extra: psqlpy
|
|
46
|
+
Requires-Dist: psqlpy; extra == 'psqlpy'
|
|
45
47
|
Provides-Extra: psycopg
|
|
46
48
|
Requires-Dist: psycopg[binary,pool]; extra == 'psycopg'
|
|
47
49
|
Provides-Extra: pydantic
|
|
@@ -102,6 +104,7 @@ This list is not final. If you have a driver you'd like to see added, please ope
|
|
|
102
104
|
| [`asyncpg`](https://magicstack.github.io/asyncpg/current/) | PostgreSQL | Async | ✅ |
|
|
103
105
|
| [`psycopg`](https://www.psycopg.org/) | PostgreSQL | Sync | ✅ |
|
|
104
106
|
| [`psycopg`](https://www.psycopg.org/) | PostgreSQL | Async | ✅ |
|
|
107
|
+
| [`psqlpy`](https://psqlpy-python.github.io/) | PostgreSQL | Async | ✅ |
|
|
105
108
|
| [`aiosqlite`](https://github.com/omnilib/aiosqlite) | SQLite | Async | ✅ |
|
|
106
109
|
| `sqlite3` | SQLite | Sync | ✅ |
|
|
107
110
|
| [`oracledb`](https://oracle.github.io/python-oracledb/) | Oracle | Async | ✅ |
|
|
@@ -43,6 +43,7 @@ This list is not final. If you have a driver you'd like to see added, please ope
|
|
|
43
43
|
| [`asyncpg`](https://magicstack.github.io/asyncpg/current/) | PostgreSQL | Async | ✅ |
|
|
44
44
|
| [`psycopg`](https://www.psycopg.org/) | PostgreSQL | Sync | ✅ |
|
|
45
45
|
| [`psycopg`](https://www.psycopg.org/) | PostgreSQL | Async | ✅ |
|
|
46
|
+
| [`psqlpy`](https://psqlpy-python.github.io/) | PostgreSQL | Async | ✅ |
|
|
46
47
|
| [`aiosqlite`](https://github.com/omnilib/aiosqlite) | SQLite | Async | ✅ |
|
|
47
48
|
| `sqlite3` | SQLite | Sync | ✅ |
|
|
48
49
|
| [`oracledb`](https://oracle.github.io/python-oracledb/) | Oracle | Async | ✅ |
|
|
@@ -7,7 +7,7 @@ maintainers = [{ name = "Litestar Developers", email = "hello@litestar.dev" }]
|
|
|
7
7
|
name = "sqlspec"
|
|
8
8
|
readme = "README.md"
|
|
9
9
|
requires-python = ">=3.9, <4.0"
|
|
10
|
-
version = "0.
|
|
10
|
+
version = "0.9.0"
|
|
11
11
|
|
|
12
12
|
[project.optional-dependencies]
|
|
13
13
|
adbc = ["adbc_driver_manager", "pyarrow"]
|
|
@@ -25,6 +25,7 @@ nanoid = ["fastnanoid>=0.4.1"]
|
|
|
25
25
|
oracledb = ["oracledb"]
|
|
26
26
|
orjson = ["orjson"]
|
|
27
27
|
performance = ["sqlglot[rs]"]
|
|
28
|
+
psqlpy = ["psqlpy"]
|
|
28
29
|
psycopg = ["psycopg[binary,pool]"]
|
|
29
30
|
pydantic = ["pydantic", "pydantic-extra-types"]
|
|
30
31
|
pymssql = ["pymssql"]
|
|
@@ -108,7 +109,7 @@ packages = ["sqlspec"]
|
|
|
108
109
|
allow_dirty = true
|
|
109
110
|
commit = false
|
|
110
111
|
commit_args = "--no-verify"
|
|
111
|
-
current_version = "0.
|
|
112
|
+
current_version = "0.9.0"
|
|
112
113
|
ignore_missing_files = false
|
|
113
114
|
ignore_missing_version = false
|
|
114
115
|
message = "chore(release): bump to v{new_version}"
|
|
@@ -175,7 +176,7 @@ exclude_lines = [
|
|
|
175
176
|
]
|
|
176
177
|
|
|
177
178
|
[tool.pytest.ini_options]
|
|
178
|
-
addopts = "-
|
|
179
|
+
addopts = ["-q", "-ra"]
|
|
179
180
|
asyncio_default_fixture_loop_scope = "function"
|
|
180
181
|
asyncio_mode = "auto"
|
|
181
182
|
filterwarnings = [
|
|
@@ -189,8 +190,32 @@ filterwarnings = [
|
|
|
189
190
|
"ignore::DeprecationWarning:websockets.connection",
|
|
190
191
|
"ignore::DeprecationWarning:websockets.legacy",
|
|
191
192
|
]
|
|
193
|
+
markers = [
|
|
194
|
+
"integration: marks tests that require an external database",
|
|
195
|
+
"postgres: marks tests specific to PostgreSQL",
|
|
196
|
+
"duckdb: marks tests specific to DuckDB",
|
|
197
|
+
"sqlite: marks tests specific to SQLite",
|
|
198
|
+
"bigquery: marks tests specific to Google BigQuery",
|
|
199
|
+
"mysql: marks tests specific to MySQL",
|
|
200
|
+
"oracle: marks tests specific to Oracle",
|
|
201
|
+
"spanner: marks tests specific to Google Cloud Spanner",
|
|
202
|
+
"mssql: marks tests specific to Microsoft SQL Server",
|
|
203
|
+
# Driver markers
|
|
204
|
+
"adbc: marks tests using ADBC drivers",
|
|
205
|
+
"aioodbc: marks tests using aioodbc",
|
|
206
|
+
"aiosqlite: marks tests using aiosqlite",
|
|
207
|
+
"asyncmy: marks tests using asyncmy",
|
|
208
|
+
"asyncpg: marks tests using asyncpg",
|
|
209
|
+
"duckdb_driver: marks tests using the duckdb driver",
|
|
210
|
+
"google_bigquery: marks tests using google-cloud-bigquery",
|
|
211
|
+
"google_spanner: marks tests using google-cloud-spanner",
|
|
212
|
+
"oracledb: marks tests using oracledb",
|
|
213
|
+
"psycopg: marks tests using psycopg",
|
|
214
|
+
"pymssql: marks tests using pymssql",
|
|
215
|
+
"pymysql: marks tests using pymysql",
|
|
216
|
+
"psqlpy: marks tests using psqlpy",
|
|
217
|
+
]
|
|
192
218
|
testpaths = ["tests"]
|
|
193
|
-
xfail_strict = true
|
|
194
219
|
|
|
195
220
|
[tool.mypy]
|
|
196
221
|
packages = ["sqlspec", "tests"]
|
|
@@ -220,6 +245,8 @@ module = [
|
|
|
220
245
|
"uvloop.*",
|
|
221
246
|
"asyncmy",
|
|
222
247
|
"asyncmy.*",
|
|
248
|
+
"pyarrow",
|
|
249
|
+
"pyarrow.*",
|
|
223
250
|
]
|
|
224
251
|
|
|
225
252
|
[tool.pyright]
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
# ruff: noqa: RUF100, PLR0913, A002, DOC201, PLR6301
|
|
1
2
|
"""This is a simple wrapper around a few important classes in each library.
|
|
2
3
|
|
|
3
4
|
This is used to ensure compatibility when one or more of the libraries are installed.
|
|
4
5
|
"""
|
|
5
6
|
|
|
7
|
+
from collections.abc import Iterable, Mapping
|
|
6
8
|
from enum import Enum
|
|
7
9
|
from typing import (
|
|
8
10
|
Any,
|
|
@@ -96,7 +98,7 @@ except ImportError:
|
|
|
96
98
|
|
|
97
99
|
def validate_python(
|
|
98
100
|
self,
|
|
99
|
-
object: Any,
|
|
101
|
+
object: Any,
|
|
100
102
|
/,
|
|
101
103
|
*,
|
|
102
104
|
strict: "Optional[bool]" = None,
|
|
@@ -127,10 +129,7 @@ try:
|
|
|
127
129
|
except ImportError:
|
|
128
130
|
import enum
|
|
129
131
|
from collections.abc import Iterable
|
|
130
|
-
from typing import
|
|
131
|
-
|
|
132
|
-
if TYPE_CHECKING:
|
|
133
|
-
from collections.abc import Iterable
|
|
132
|
+
from typing import Callable, Optional, Union
|
|
134
133
|
|
|
135
134
|
@dataclass_transform()
|
|
136
135
|
@runtime_checkable
|
|
@@ -174,7 +173,6 @@ except ImportError:
|
|
|
174
173
|
"""Placeholder init"""
|
|
175
174
|
|
|
176
175
|
def create_instance(self, **kwargs: Any) -> "T":
|
|
177
|
-
"""Placeholder implementation"""
|
|
178
176
|
return cast("T", kwargs)
|
|
179
177
|
|
|
180
178
|
def update_instance(self, instance: "T", **kwargs: Any) -> "T":
|
|
@@ -198,11 +196,46 @@ EmptyType = Union[Literal[EmptyEnum.EMPTY], UnsetType]
|
|
|
198
196
|
Empty: Final = EmptyEnum.EMPTY
|
|
199
197
|
|
|
200
198
|
|
|
199
|
+
try:
|
|
200
|
+
from pyarrow import Table as ArrowTable
|
|
201
|
+
|
|
202
|
+
PYARROW_INSTALLED = True
|
|
203
|
+
except ImportError:
|
|
204
|
+
|
|
205
|
+
@runtime_checkable
|
|
206
|
+
class ArrowTable(Protocol): # type: ignore[no-redef]
|
|
207
|
+
"""Placeholder Implementation"""
|
|
208
|
+
|
|
209
|
+
def to_batches(self, batch_size: int) -> Any: ...
|
|
210
|
+
def num_rows(self) -> int: ...
|
|
211
|
+
def num_columns(self) -> int: ...
|
|
212
|
+
def to_pydict(self) -> dict[str, Any]: ...
|
|
213
|
+
def to_string(self) -> str: ...
|
|
214
|
+
def from_arrays(
|
|
215
|
+
self,
|
|
216
|
+
arrays: list[Any],
|
|
217
|
+
names: "Optional[list[str]]" = None,
|
|
218
|
+
schema: "Optional[Any]" = None,
|
|
219
|
+
metadata: "Optional[Mapping[str, Any]]" = None,
|
|
220
|
+
) -> Any: ...
|
|
221
|
+
def from_pydict(
|
|
222
|
+
self,
|
|
223
|
+
mapping: dict[str, Any],
|
|
224
|
+
schema: "Optional[Any]" = None,
|
|
225
|
+
metadata: "Optional[Mapping[str, Any]]" = None,
|
|
226
|
+
) -> Any: ...
|
|
227
|
+
def from_batches(self, batches: Iterable[Any], schema: Optional[Any] = None) -> Any: ...
|
|
228
|
+
|
|
229
|
+
PYARROW_INSTALLED = False # pyright: ignore[reportConstantRedefinition]
|
|
230
|
+
|
|
231
|
+
|
|
201
232
|
__all__ = (
|
|
202
233
|
"LITESTAR_INSTALLED",
|
|
203
234
|
"MSGSPEC_INSTALLED",
|
|
235
|
+
"PYARROW_INSTALLED",
|
|
204
236
|
"PYDANTIC_INSTALLED",
|
|
205
237
|
"UNSET",
|
|
238
|
+
"ArrowTable",
|
|
206
239
|
"BaseModel",
|
|
207
240
|
"DTOData",
|
|
208
241
|
"DataclassProtocol",
|
|
@@ -14,11 +14,11 @@ if TYPE_CHECKING:
|
|
|
14
14
|
from collections.abc import Generator
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
__all__ = ("
|
|
17
|
+
__all__ = ("AdbcConfig",)
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
@dataclass
|
|
21
|
-
class
|
|
21
|
+
class AdbcConfig(NoPoolSyncConfig["Connection", "AdbcDriver"]):
|
|
22
22
|
"""Configuration for ADBC connections.
|
|
23
23
|
|
|
24
24
|
This class provides configuration options for ADBC database connections using the
|
|
@@ -55,17 +55,41 @@ class Adbc(NoPoolSyncConfig["Connection", "AdbcDriver"]):
|
|
|
55
55
|
"""
|
|
56
56
|
|
|
57
57
|
if isinstance(self.driver_name, str):
|
|
58
|
-
if self.driver_name != "adbc_driver_sqlite.dbapi.connect" and
|
|
58
|
+
if self.driver_name != "adbc_driver_sqlite.dbapi.connect" and self.driver_name in {
|
|
59
|
+
"sqlite",
|
|
60
|
+
"sqlite3",
|
|
61
|
+
"adbc_driver_sqlite",
|
|
62
|
+
}:
|
|
59
63
|
self.driver_name = "adbc_driver_sqlite.dbapi.connect"
|
|
60
|
-
elif self.driver_name != "adbc_driver_duckdb.dbapi.connect" and
|
|
64
|
+
elif self.driver_name != "adbc_driver_duckdb.dbapi.connect" and self.driver_name in {
|
|
65
|
+
"duckdb",
|
|
66
|
+
"adbc_driver_duckdb",
|
|
67
|
+
}:
|
|
61
68
|
self.driver_name = "adbc_driver_duckdb.dbapi.connect"
|
|
62
|
-
elif self.driver_name != "adbc_driver_postgresql.dbapi.connect" and
|
|
69
|
+
elif self.driver_name != "adbc_driver_postgresql.dbapi.connect" and self.driver_name in {
|
|
70
|
+
"postgres",
|
|
71
|
+
"adbc_driver_postgresql",
|
|
72
|
+
"postgresql",
|
|
73
|
+
"pg",
|
|
74
|
+
}:
|
|
63
75
|
self.driver_name = "adbc_driver_postgresql.dbapi.connect"
|
|
64
|
-
elif self.driver_name != "adbc_driver_snowflake.dbapi.connect" and
|
|
76
|
+
elif self.driver_name != "adbc_driver_snowflake.dbapi.connect" and self.driver_name in {
|
|
77
|
+
"snowflake",
|
|
78
|
+
"adbc_driver_snowflake",
|
|
79
|
+
"sf",
|
|
80
|
+
}:
|
|
65
81
|
self.driver_name = "adbc_driver_snowflake.dbapi.connect"
|
|
66
|
-
elif self.driver_name != "adbc_driver_bigquery.dbapi.connect" and
|
|
82
|
+
elif self.driver_name != "adbc_driver_bigquery.dbapi.connect" and self.driver_name in {
|
|
83
|
+
"bigquery",
|
|
84
|
+
"adbc_driver_bigquery",
|
|
85
|
+
"bq",
|
|
86
|
+
}:
|
|
67
87
|
self.driver_name = "adbc_driver_bigquery.dbapi.connect"
|
|
68
|
-
elif self.driver_name != "adbc_driver_flightsql.dbapi.connect" and
|
|
88
|
+
elif self.driver_name != "adbc_driver_flightsql.dbapi.connect" and self.driver_name in {
|
|
89
|
+
"flightsql",
|
|
90
|
+
"adbc_driver_flightsql",
|
|
91
|
+
"grpc",
|
|
92
|
+
}:
|
|
69
93
|
self.driver_name = "adbc_driver_flightsql.dbapi.connect"
|
|
70
94
|
return self.driver_name
|
|
71
95
|
|
|
@@ -153,11 +177,10 @@ class Adbc(NoPoolSyncConfig["Connection", "AdbcDriver"]):
|
|
|
153
177
|
"""
|
|
154
178
|
try:
|
|
155
179
|
connect_func = self._get_connect_func()
|
|
156
|
-
|
|
157
|
-
return connect_func(**_config)
|
|
180
|
+
return connect_func(**self.connection_config_dict)
|
|
158
181
|
except Exception as e:
|
|
159
182
|
# Include driver name in error message for better context
|
|
160
|
-
driver_name = self.driver_name if isinstance(self.driver_name, str) else "Unknown/
|
|
183
|
+
driver_name = self.driver_name if isinstance(self.driver_name, str) else "Unknown/Missing"
|
|
161
184
|
# Use the potentially modified driver_path from _get_connect_func if available,
|
|
162
185
|
# otherwise fallback to self.driver_name for the error message.
|
|
163
186
|
# This requires _get_connect_func to potentially return the used path or store it.
|