sqlspec 0.16.2__cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.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.
Potentially problematic release.
This version of sqlspec might be problematic. Click here for more details.
- 51ff5a9eadfdefd49f98__mypyc.cpython-39-aarch64-linux-gnu.so +0 -0
- sqlspec/__init__.py +92 -0
- sqlspec/__main__.py +12 -0
- sqlspec/__metadata__.py +14 -0
- sqlspec/_serialization.py +77 -0
- sqlspec/_sql.py +1782 -0
- sqlspec/_typing.py +680 -0
- sqlspec/adapters/__init__.py +0 -0
- sqlspec/adapters/adbc/__init__.py +5 -0
- sqlspec/adapters/adbc/_types.py +12 -0
- sqlspec/adapters/adbc/config.py +361 -0
- sqlspec/adapters/adbc/driver.py +512 -0
- sqlspec/adapters/aiosqlite/__init__.py +19 -0
- sqlspec/adapters/aiosqlite/_types.py +13 -0
- sqlspec/adapters/aiosqlite/config.py +253 -0
- sqlspec/adapters/aiosqlite/driver.py +248 -0
- sqlspec/adapters/asyncmy/__init__.py +19 -0
- sqlspec/adapters/asyncmy/_types.py +12 -0
- sqlspec/adapters/asyncmy/config.py +180 -0
- sqlspec/adapters/asyncmy/driver.py +274 -0
- sqlspec/adapters/asyncpg/__init__.py +21 -0
- sqlspec/adapters/asyncpg/_types.py +17 -0
- sqlspec/adapters/asyncpg/config.py +229 -0
- sqlspec/adapters/asyncpg/driver.py +344 -0
- sqlspec/adapters/bigquery/__init__.py +18 -0
- sqlspec/adapters/bigquery/_types.py +12 -0
- sqlspec/adapters/bigquery/config.py +298 -0
- sqlspec/adapters/bigquery/driver.py +558 -0
- sqlspec/adapters/duckdb/__init__.py +22 -0
- sqlspec/adapters/duckdb/_types.py +12 -0
- sqlspec/adapters/duckdb/config.py +504 -0
- sqlspec/adapters/duckdb/driver.py +368 -0
- sqlspec/adapters/oracledb/__init__.py +32 -0
- sqlspec/adapters/oracledb/_types.py +14 -0
- sqlspec/adapters/oracledb/config.py +317 -0
- sqlspec/adapters/oracledb/driver.py +538 -0
- sqlspec/adapters/psqlpy/__init__.py +16 -0
- sqlspec/adapters/psqlpy/_types.py +11 -0
- sqlspec/adapters/psqlpy/config.py +214 -0
- sqlspec/adapters/psqlpy/driver.py +530 -0
- sqlspec/adapters/psycopg/__init__.py +32 -0
- sqlspec/adapters/psycopg/_types.py +17 -0
- sqlspec/adapters/psycopg/config.py +426 -0
- sqlspec/adapters/psycopg/driver.py +796 -0
- sqlspec/adapters/sqlite/__init__.py +15 -0
- sqlspec/adapters/sqlite/_types.py +11 -0
- sqlspec/adapters/sqlite/config.py +240 -0
- sqlspec/adapters/sqlite/driver.py +294 -0
- sqlspec/base.py +571 -0
- sqlspec/builder/__init__.py +62 -0
- sqlspec/builder/_base.py +473 -0
- sqlspec/builder/_column.py +320 -0
- sqlspec/builder/_ddl.py +1346 -0
- sqlspec/builder/_ddl_utils.py +103 -0
- sqlspec/builder/_delete.py +76 -0
- sqlspec/builder/_insert.py +421 -0
- sqlspec/builder/_merge.py +71 -0
- sqlspec/builder/_parsing_utils.py +164 -0
- sqlspec/builder/_select.py +170 -0
- sqlspec/builder/_update.py +188 -0
- sqlspec/builder/mixins/__init__.py +55 -0
- sqlspec/builder/mixins/_cte_and_set_ops.py +222 -0
- sqlspec/builder/mixins/_delete_operations.py +41 -0
- sqlspec/builder/mixins/_insert_operations.py +244 -0
- sqlspec/builder/mixins/_join_operations.py +149 -0
- sqlspec/builder/mixins/_merge_operations.py +562 -0
- sqlspec/builder/mixins/_order_limit_operations.py +135 -0
- sqlspec/builder/mixins/_pivot_operations.py +153 -0
- sqlspec/builder/mixins/_select_operations.py +604 -0
- sqlspec/builder/mixins/_update_operations.py +202 -0
- sqlspec/builder/mixins/_where_clause.py +644 -0
- sqlspec/cli.py +247 -0
- sqlspec/config.py +395 -0
- sqlspec/core/__init__.py +63 -0
- sqlspec/core/cache.cpython-39-aarch64-linux-gnu.so +0 -0
- sqlspec/core/cache.py +871 -0
- sqlspec/core/compiler.cpython-39-aarch64-linux-gnu.so +0 -0
- sqlspec/core/compiler.py +417 -0
- sqlspec/core/filters.cpython-39-aarch64-linux-gnu.so +0 -0
- sqlspec/core/filters.py +830 -0
- sqlspec/core/hashing.cpython-39-aarch64-linux-gnu.so +0 -0
- sqlspec/core/hashing.py +310 -0
- sqlspec/core/parameters.cpython-39-aarch64-linux-gnu.so +0 -0
- sqlspec/core/parameters.py +1237 -0
- sqlspec/core/result.cpython-39-aarch64-linux-gnu.so +0 -0
- sqlspec/core/result.py +677 -0
- sqlspec/core/splitter.cpython-39-aarch64-linux-gnu.so +0 -0
- sqlspec/core/splitter.py +819 -0
- sqlspec/core/statement.cpython-39-aarch64-linux-gnu.so +0 -0
- sqlspec/core/statement.py +676 -0
- sqlspec/driver/__init__.py +19 -0
- sqlspec/driver/_async.py +502 -0
- sqlspec/driver/_common.py +631 -0
- sqlspec/driver/_sync.py +503 -0
- sqlspec/driver/mixins/__init__.py +6 -0
- sqlspec/driver/mixins/_result_tools.py +193 -0
- sqlspec/driver/mixins/_sql_translator.py +86 -0
- sqlspec/exceptions.py +193 -0
- sqlspec/extensions/__init__.py +0 -0
- sqlspec/extensions/aiosql/__init__.py +10 -0
- sqlspec/extensions/aiosql/adapter.py +461 -0
- sqlspec/extensions/litestar/__init__.py +6 -0
- sqlspec/extensions/litestar/_utils.py +52 -0
- sqlspec/extensions/litestar/cli.py +48 -0
- sqlspec/extensions/litestar/config.py +92 -0
- sqlspec/extensions/litestar/handlers.py +260 -0
- sqlspec/extensions/litestar/plugin.py +145 -0
- sqlspec/extensions/litestar/providers.py +454 -0
- sqlspec/loader.cpython-39-aarch64-linux-gnu.so +0 -0
- sqlspec/loader.py +760 -0
- sqlspec/migrations/__init__.py +35 -0
- sqlspec/migrations/base.py +414 -0
- sqlspec/migrations/commands.py +443 -0
- sqlspec/migrations/loaders.py +402 -0
- sqlspec/migrations/runner.py +213 -0
- sqlspec/migrations/tracker.py +140 -0
- sqlspec/migrations/utils.py +129 -0
- sqlspec/protocols.py +407 -0
- sqlspec/py.typed +0 -0
- sqlspec/storage/__init__.py +23 -0
- sqlspec/storage/backends/__init__.py +0 -0
- sqlspec/storage/backends/base.py +163 -0
- sqlspec/storage/backends/fsspec.py +386 -0
- sqlspec/storage/backends/obstore.py +459 -0
- sqlspec/storage/capabilities.py +102 -0
- sqlspec/storage/registry.py +239 -0
- sqlspec/typing.py +299 -0
- sqlspec/utils/__init__.py +3 -0
- sqlspec/utils/correlation.py +150 -0
- sqlspec/utils/deprecation.py +106 -0
- sqlspec/utils/fixtures.cpython-39-aarch64-linux-gnu.so +0 -0
- sqlspec/utils/fixtures.py +58 -0
- sqlspec/utils/logging.py +127 -0
- sqlspec/utils/module_loader.py +89 -0
- sqlspec/utils/serializers.py +4 -0
- sqlspec/utils/singleton.py +32 -0
- sqlspec/utils/sync_tools.cpython-39-aarch64-linux-gnu.so +0 -0
- sqlspec/utils/sync_tools.py +237 -0
- sqlspec/utils/text.cpython-39-aarch64-linux-gnu.so +0 -0
- sqlspec/utils/text.py +96 -0
- sqlspec/utils/type_guards.cpython-39-aarch64-linux-gnu.so +0 -0
- sqlspec/utils/type_guards.py +1139 -0
- sqlspec-0.16.2.dist-info/METADATA +365 -0
- sqlspec-0.16.2.dist-info/RECORD +148 -0
- sqlspec-0.16.2.dist-info/WHEEL +7 -0
- sqlspec-0.16.2.dist-info/entry_points.txt +2 -0
- sqlspec-0.16.2.dist-info/licenses/LICENSE +21 -0
- sqlspec-0.16.2.dist-info/licenses/NOTICE +29 -0
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sqlspec
|
|
3
|
+
Version: 0.16.2
|
|
4
|
+
Summary: SQL Experiments in Python
|
|
5
|
+
Project-URL: Discord, https://discord.gg/litestar
|
|
6
|
+
Project-URL: Issue, https://github.com/litestar-org/sqlspec/issues/
|
|
7
|
+
Project-URL: Source, https://github.com/litestar-org/sqlspec
|
|
8
|
+
Author-email: Cody Fincher <cody@litestar.dev>
|
|
9
|
+
Maintainer-email: Litestar Developers <hello@litestar.dev>
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
License-File: NOTICE
|
|
13
|
+
Requires-Python: <4.0,>=3.9
|
|
14
|
+
Requires-Dist: eval-type-backport; python_version < '3.10'
|
|
15
|
+
Requires-Dist: mypy-extensions
|
|
16
|
+
Requires-Dist: rich-click
|
|
17
|
+
Requires-Dist: sqlglot>=19.9.0
|
|
18
|
+
Requires-Dist: typing-extensions
|
|
19
|
+
Provides-Extra: adbc
|
|
20
|
+
Requires-Dist: adbc-driver-manager; extra == 'adbc'
|
|
21
|
+
Requires-Dist: pyarrow; extra == 'adbc'
|
|
22
|
+
Provides-Extra: aioodbc
|
|
23
|
+
Requires-Dist: aioodbc; extra == 'aioodbc'
|
|
24
|
+
Provides-Extra: aiosql
|
|
25
|
+
Requires-Dist: aiosql; extra == 'aiosql'
|
|
26
|
+
Provides-Extra: aiosqlite
|
|
27
|
+
Requires-Dist: aiosqlite; extra == 'aiosqlite'
|
|
28
|
+
Provides-Extra: asyncmy
|
|
29
|
+
Requires-Dist: asyncmy; extra == 'asyncmy'
|
|
30
|
+
Provides-Extra: asyncpg
|
|
31
|
+
Requires-Dist: asyncpg; extra == 'asyncpg'
|
|
32
|
+
Provides-Extra: attrs
|
|
33
|
+
Requires-Dist: attrs; extra == 'attrs'
|
|
34
|
+
Requires-Dist: cattrs; extra == 'attrs'
|
|
35
|
+
Provides-Extra: bigquery
|
|
36
|
+
Requires-Dist: google-cloud-bigquery; extra == 'bigquery'
|
|
37
|
+
Provides-Extra: cli
|
|
38
|
+
Requires-Dist: rich-click; extra == 'cli'
|
|
39
|
+
Provides-Extra: duckdb
|
|
40
|
+
Requires-Dist: duckdb; extra == 'duckdb'
|
|
41
|
+
Provides-Extra: fastapi
|
|
42
|
+
Requires-Dist: fastapi; extra == 'fastapi'
|
|
43
|
+
Provides-Extra: flask
|
|
44
|
+
Requires-Dist: flask; extra == 'flask'
|
|
45
|
+
Provides-Extra: fsspec
|
|
46
|
+
Requires-Dist: fsspec; extra == 'fsspec'
|
|
47
|
+
Provides-Extra: litestar
|
|
48
|
+
Requires-Dist: litestar; extra == 'litestar'
|
|
49
|
+
Provides-Extra: msgspec
|
|
50
|
+
Requires-Dist: msgspec; extra == 'msgspec'
|
|
51
|
+
Provides-Extra: mypyc
|
|
52
|
+
Provides-Extra: nanoid
|
|
53
|
+
Requires-Dist: fastnanoid>=0.4.1; extra == 'nanoid'
|
|
54
|
+
Provides-Extra: obstore
|
|
55
|
+
Requires-Dist: obstore; extra == 'obstore'
|
|
56
|
+
Provides-Extra: opentelemetry
|
|
57
|
+
Requires-Dist: opentelemetry-instrumentation; extra == 'opentelemetry'
|
|
58
|
+
Provides-Extra: oracledb
|
|
59
|
+
Requires-Dist: oracledb; extra == 'oracledb'
|
|
60
|
+
Provides-Extra: orjson
|
|
61
|
+
Requires-Dist: orjson; extra == 'orjson'
|
|
62
|
+
Provides-Extra: pandas
|
|
63
|
+
Requires-Dist: pandas; extra == 'pandas'
|
|
64
|
+
Requires-Dist: pyarrow; extra == 'pandas'
|
|
65
|
+
Provides-Extra: performance
|
|
66
|
+
Requires-Dist: msgspec; extra == 'performance'
|
|
67
|
+
Requires-Dist: sqlglot[rs]; extra == 'performance'
|
|
68
|
+
Provides-Extra: polars
|
|
69
|
+
Requires-Dist: polars; extra == 'polars'
|
|
70
|
+
Requires-Dist: pyarrow; extra == 'polars'
|
|
71
|
+
Provides-Extra: prometheus
|
|
72
|
+
Requires-Dist: prometheus-client; extra == 'prometheus'
|
|
73
|
+
Provides-Extra: psqlpy
|
|
74
|
+
Requires-Dist: psqlpy; extra == 'psqlpy'
|
|
75
|
+
Provides-Extra: psycopg
|
|
76
|
+
Requires-Dist: psycopg[binary,pool]; extra == 'psycopg'
|
|
77
|
+
Provides-Extra: pydantic
|
|
78
|
+
Requires-Dist: pydantic; extra == 'pydantic'
|
|
79
|
+
Requires-Dist: pydantic-extra-types; extra == 'pydantic'
|
|
80
|
+
Provides-Extra: pymssql
|
|
81
|
+
Requires-Dist: pymssql; extra == 'pymssql'
|
|
82
|
+
Provides-Extra: pymysql
|
|
83
|
+
Requires-Dist: pymysql; extra == 'pymysql'
|
|
84
|
+
Provides-Extra: spanner
|
|
85
|
+
Requires-Dist: google-cloud-spanner; extra == 'spanner'
|
|
86
|
+
Provides-Extra: uuid
|
|
87
|
+
Requires-Dist: uuid-utils; extra == 'uuid'
|
|
88
|
+
Description-Content-Type: text/markdown
|
|
89
|
+
|
|
90
|
+
# SQLSpec
|
|
91
|
+
|
|
92
|
+
## A Query Mapper for Python
|
|
93
|
+
|
|
94
|
+
SQLSpec is an experimental Python library designed to streamline and modernize your SQL interactions across a variety of database systems. While still in its early stages, SQLSpec aims to provide a flexible, typed, and extensible interface for working with SQL in Python.
|
|
95
|
+
|
|
96
|
+
**Note**: SQLSpec is currently under active development and the API is subject to change. It is not yet ready for production use. Contributions are welcome!
|
|
97
|
+
|
|
98
|
+
## Core Features (Current and Planned)
|
|
99
|
+
|
|
100
|
+
### Currently Implemented
|
|
101
|
+
|
|
102
|
+
- **Consistent Database Session Interface**: Provides a consistent connectivity interface for interacting with one or more database systems, including SQLite, Postgres, DuckDB, MySQL, Oracle, SQL Server, Spanner, BigQuery, and more.
|
|
103
|
+
- **Emphasis on RAW SQL and Minimal Abstractions**: SQLSpec is a library for working with SQL in Python. Its goals are to offer minimal abstractions between the user and the database. It does not aim to be an ORM library.
|
|
104
|
+
- **Type-Safe Queries**: Quickly map SQL queries to typed objects using libraries such as Pydantic, Msgspec, Attrs, etc.
|
|
105
|
+
- **Extensible Design**: Easily add support for new database dialects or extend existing functionality to meet your specific needs. Easily add support for async and sync database drivers.
|
|
106
|
+
- **Minimal Dependencies**: SQLSpec is designed to be lightweight and can run on its own or with other libraries such as `litestar`, `fastapi`, `flask` and more. (Contributions welcome!)
|
|
107
|
+
- **Support for Async and Sync Database Drivers**: SQLSpec supports both async and sync database drivers, allowing you to choose the style that best fits your application.
|
|
108
|
+
|
|
109
|
+
### Experimental Features (API will change rapidly)
|
|
110
|
+
|
|
111
|
+
- **SQL Builder API**: Type-safe query builder with method chaining (experimental and subject to significant changes)
|
|
112
|
+
- **Dynamic Query Manipulation**: Apply filters to pre-defined queries with a fluent API. Safely manipulate queries without SQL injection risk.
|
|
113
|
+
- **Dialect Validation and Conversion**: Use `sqlglot` to validate your SQL against specific dialects and seamlessly convert between them.
|
|
114
|
+
- **Storage Operations**: Direct export to Parquet, CSV, JSON with Arrow integration
|
|
115
|
+
- **Instrumentation**: OpenTelemetry and Prometheus metrics support
|
|
116
|
+
- **Basic Migration Management**: A mechanism to generate empty migration files where you can add your own SQL and intelligently track which migrations have been applied.
|
|
117
|
+
|
|
118
|
+
## What SQLSpec Is Not (Yet)
|
|
119
|
+
|
|
120
|
+
SQLSpec is a work in progress. While it offers a solid foundation for modern SQL interactions, it does not yet include every feature you might find in a mature ORM or database toolkit. The focus is on building a robust, flexible core that can be extended over time.
|
|
121
|
+
|
|
122
|
+
## Examples
|
|
123
|
+
|
|
124
|
+
We've talked about what SQLSpec is not, so let's look at what it can do.
|
|
125
|
+
|
|
126
|
+
These are just a few examples that demonstrate SQLSpec's flexibility. Each of the bundled adapters offers the same config and driver interfaces.
|
|
127
|
+
|
|
128
|
+
### Basic Usage
|
|
129
|
+
|
|
130
|
+
```python
|
|
131
|
+
from sqlspec import SQLSpec
|
|
132
|
+
from sqlspec.adapters.sqlite import SqliteConfig
|
|
133
|
+
from pydantic import BaseModel
|
|
134
|
+
# Create SQLSpec instance and configure database
|
|
135
|
+
sql = SQLSpec()
|
|
136
|
+
config = sql.add_config(SqliteConfig(database=":memory:"))
|
|
137
|
+
|
|
138
|
+
# Execute queries with automatic result mapping
|
|
139
|
+
with sql.provide_session(config) as session:
|
|
140
|
+
# Simple query
|
|
141
|
+
result = session.execute("SELECT 'Hello, SQLSpec!' as message")
|
|
142
|
+
print(result.get_first()) # {'message': 'Hello, SQLSpec!'}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### SQL Builder Example (Experimental)
|
|
146
|
+
|
|
147
|
+
**Warning**: The SQL Builder API is highly experimental and will change significantly.
|
|
148
|
+
|
|
149
|
+
```python
|
|
150
|
+
from sqlspec import sql
|
|
151
|
+
|
|
152
|
+
# Build a simple query
|
|
153
|
+
query = sql.select("id", "name", "email").from_("users").where("active = ?", True)
|
|
154
|
+
print(query.build().sql) # SELECT id, name, email FROM users WHERE active = ?
|
|
155
|
+
|
|
156
|
+
# More complex example with joins
|
|
157
|
+
query = (
|
|
158
|
+
sql.select("u.name", "COUNT(o.id) as order_count")
|
|
159
|
+
.from_("users u")
|
|
160
|
+
.left_join("orders o", "u.id = o.user_id")
|
|
161
|
+
.where("u.created_at > ?", "2024-01-01")
|
|
162
|
+
.group_by("u.name")
|
|
163
|
+
.having("COUNT(o.id) > ?", 5)
|
|
164
|
+
.order_by("order_count", desc=True)
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
# Execute the built query
|
|
168
|
+
with sql.provide_session(config) as session:
|
|
169
|
+
results = session.execute(query.build())
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### DuckDB LLM
|
|
173
|
+
|
|
174
|
+
This is a quick implementation using some of the built-in Secret and Extension management features of SQLSpec's DuckDB integration.
|
|
175
|
+
|
|
176
|
+
It allows you to communicate with any compatible OpenAPI conversations endpoint (such as Ollama). This example:
|
|
177
|
+
|
|
178
|
+
- auto installs the `open_prompt` DuckDB extensions
|
|
179
|
+
- automatically creates the correct `open_prompt` compatible secret required to use the extension
|
|
180
|
+
|
|
181
|
+
```py
|
|
182
|
+
# /// script
|
|
183
|
+
# dependencies = [
|
|
184
|
+
# "sqlspec[duckdb,performance]",
|
|
185
|
+
# ]
|
|
186
|
+
# ///
|
|
187
|
+
import os
|
|
188
|
+
|
|
189
|
+
from sqlspec import SQLSpec
|
|
190
|
+
from sqlspec.adapters.duckdb import DuckDBConfig
|
|
191
|
+
from pydantic import BaseModel
|
|
192
|
+
|
|
193
|
+
class ChatMessage(BaseModel):
|
|
194
|
+
message: str
|
|
195
|
+
|
|
196
|
+
sql = SQLSpec()
|
|
197
|
+
etl_config = sql.add_config(
|
|
198
|
+
DuckDBConfig(
|
|
199
|
+
extensions=[{"name": "open_prompt"}],
|
|
200
|
+
secrets=[
|
|
201
|
+
{
|
|
202
|
+
"secret_type": "open_prompt",
|
|
203
|
+
"name": "open_prompt",
|
|
204
|
+
"value": {
|
|
205
|
+
"api_url": "http://127.0.0.1:11434/v1/chat/completions",
|
|
206
|
+
"model_name": "gemma3:1b",
|
|
207
|
+
"api_timeout": "120",
|
|
208
|
+
},
|
|
209
|
+
}
|
|
210
|
+
],
|
|
211
|
+
)
|
|
212
|
+
)
|
|
213
|
+
with sql.provide_session(etl_config) as session:
|
|
214
|
+
result = session.select_one(
|
|
215
|
+
"SELECT open_prompt(?)",
|
|
216
|
+
"Can you write a haiku about DuckDB?",
|
|
217
|
+
schema_type=ChatMessage
|
|
218
|
+
)
|
|
219
|
+
print(result) # result is a ChatMessage pydantic model
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### DuckDB Gemini Embeddings
|
|
223
|
+
|
|
224
|
+
In this example, we are again using DuckDB. However, we are going to use the built-in to call the Google Gemini embeddings service directly from the database.
|
|
225
|
+
|
|
226
|
+
This example will:
|
|
227
|
+
|
|
228
|
+
- auto installs the `http_client` and `vss` (vector similarity search) DuckDB extensions
|
|
229
|
+
- when a connection is created, it ensures that the `generate_embeddings` macro exists in the DuckDB database
|
|
230
|
+
- Execute a simple query to call the Google API
|
|
231
|
+
|
|
232
|
+
```py
|
|
233
|
+
# /// script
|
|
234
|
+
# dependencies = [
|
|
235
|
+
# "sqlspec[duckdb,performance]",
|
|
236
|
+
# ]
|
|
237
|
+
# ///
|
|
238
|
+
import os
|
|
239
|
+
|
|
240
|
+
from sqlspec import SQLSpec
|
|
241
|
+
from sqlspec.adapters.duckdb import DuckDBConfig
|
|
242
|
+
|
|
243
|
+
EMBEDDING_MODEL = "gemini-embedding-exp-03-07"
|
|
244
|
+
GOOGLE_API_KEY = os.environ.get("GOOGLE_API_KEY")
|
|
245
|
+
API_URL = (
|
|
246
|
+
f"https://generativelanguage.googleapis.com/v1beta/models/{EMBEDDING_MODEL}:embedContent?key=${GOOGLE_API_KEY}"
|
|
247
|
+
)
|
|
248
|
+
|
|
249
|
+
sql = SQLSpec()
|
|
250
|
+
etl_config = sql.add_config(
|
|
251
|
+
DuckDBConfig(
|
|
252
|
+
extensions=[{"name": "vss"}, {"name": "http_client"}],
|
|
253
|
+
on_connection_create=lambda connection: connection.execute(f"""
|
|
254
|
+
CREATE IF NOT EXISTS MACRO generate_embedding(q) AS (
|
|
255
|
+
WITH __request AS (
|
|
256
|
+
SELECT http_post(
|
|
257
|
+
'{API_URL}',
|
|
258
|
+
headers => MAP {{
|
|
259
|
+
'accept': 'application/json',
|
|
260
|
+
}},
|
|
261
|
+
params => MAP {{
|
|
262
|
+
'model': 'models/{EMBEDDING_MODEL}',
|
|
263
|
+
'parts': [{{ 'text': q }}],
|
|
264
|
+
'taskType': 'SEMANTIC_SIMILARITY'
|
|
265
|
+
}}
|
|
266
|
+
) AS response
|
|
267
|
+
)
|
|
268
|
+
SELECT *
|
|
269
|
+
FROM __request,
|
|
270
|
+
);
|
|
271
|
+
"""),
|
|
272
|
+
)
|
|
273
|
+
)
|
|
274
|
+
with sql.provide_session(etl_config) as session:
|
|
275
|
+
result = session.execute("SELECT generate_embedding('example text')")
|
|
276
|
+
print(result.get_first()) # result is a dictionary when `schema_type` is omitted.
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### Basic Litestar Integration
|
|
280
|
+
|
|
281
|
+
In this example we are going to demonstrate how to create a basic configuration that integrates into Litestar.
|
|
282
|
+
|
|
283
|
+
```py
|
|
284
|
+
# /// script
|
|
285
|
+
# dependencies = [
|
|
286
|
+
# "sqlspec[aiosqlite]",
|
|
287
|
+
# "litestar[standard]",
|
|
288
|
+
# ]
|
|
289
|
+
# ///
|
|
290
|
+
|
|
291
|
+
from litestar import Litestar, get
|
|
292
|
+
|
|
293
|
+
from sqlspec.adapters.aiosqlite import AiosqliteConfig, AiosqliteDriver
|
|
294
|
+
from sqlspec.extensions.litestar import DatabaseConfig, SQLSpec
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
@get("/")
|
|
298
|
+
async def simple_sqlite(db_session: AiosqliteDriver) -> dict[str, str]:
|
|
299
|
+
return await db_session.select_one("SELECT 'Hello, world!' AS greeting")
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
sqlspec = SQLSpec(
|
|
303
|
+
config=DatabaseConfig(
|
|
304
|
+
config=AiosqliteConfig(),
|
|
305
|
+
commit_mode="autocommit"
|
|
306
|
+
)
|
|
307
|
+
)
|
|
308
|
+
app = Litestar(route_handlers=[simple_sqlite], plugins=[sqlspec])
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
## Inspiration and Future Direction
|
|
312
|
+
|
|
313
|
+
SQLSpec originally drew inspiration from features found in the `aiosql` library. This is a great library for working with and executing SQL stored in files. It's unclear how much of an overlap there will be between the two libraries, but it's possible that some features will be contributed back to `aiosql` where appropriate.
|
|
314
|
+
|
|
315
|
+
## Current Focus: Universal Connectivity
|
|
316
|
+
|
|
317
|
+
The primary goal at this stage is to establish a **native connectivity interface** that works seamlessly across all supported database environments. This means you can connect to any of the supported databases using a consistent API, regardless of the underlying driver or dialect.
|
|
318
|
+
|
|
319
|
+
## Adapters: Completed, In Progress, and Planned
|
|
320
|
+
|
|
321
|
+
This list is not final. If you have a driver you'd like to see added, please open an issue or submit a PR!
|
|
322
|
+
|
|
323
|
+
| Driver | Database | Mode | Status |
|
|
324
|
+
| :----------------------------------------------------------------------------------------------------------- | :--------- | :------ | :--------- |
|
|
325
|
+
| [`adbc`](https://arrow.apache.org/adbc/) | Postgres | Sync | ✅ |
|
|
326
|
+
| [`adbc`](https://arrow.apache.org/adbc/) | SQLite | Sync | ✅ |
|
|
327
|
+
| [`adbc`](https://arrow.apache.org/adbc/) | Snowflake | Sync | ✅ |
|
|
328
|
+
| [`adbc`](https://arrow.apache.org/adbc/) | DuckDB | Sync | ✅ |
|
|
329
|
+
| [`asyncpg`](https://magicstack.github.io/asyncpg/current/) | PostgreSQL | Async | ✅ |
|
|
330
|
+
| [`psycopg`](https://www.psycopg.org/) | PostgreSQL | Sync | ✅ |
|
|
331
|
+
| [`psycopg`](https://www.psycopg.org/) | PostgreSQL | Async | ✅ |
|
|
332
|
+
| [`psqlpy`](https://psqlpy-python.github.io/) | PostgreSQL | Async | ✅ |
|
|
333
|
+
| [`aiosqlite`](https://github.com/omnilib/aiosqlite) | SQLite | Async | ✅ |
|
|
334
|
+
| `sqlite3` | SQLite | Sync | ✅ |
|
|
335
|
+
| [`oracledb`](https://oracle.github.io/python-oracledb/) | Oracle | Async | ✅ |
|
|
336
|
+
| [`oracledb`](https://oracle.github.io/python-oracledb/) | Oracle | Sync | ✅ |
|
|
337
|
+
| [`duckdb`](https://duckdb.org/) | DuckDB | Sync | ✅ |
|
|
338
|
+
| [`bigquery`](https://googleapis.dev/python/bigquery/latest/index.html) | BigQuery | Sync | ✅ |
|
|
339
|
+
| [`spanner`](https://googleapis.dev/python/spanner/latest/index.html) | Spanner | Sync | 🗓️ |
|
|
340
|
+
| [`sqlserver`](https://docs.microsoft.com/en-us/sql/connect/python/pyodbc/python-sql-driver-for-pyodbc?view=sql-server-ver16) | SQL Server | Sync | 🗓️ |
|
|
341
|
+
| [`mysql`](https://dev.mysql.com/doc/connector-python/en/connector-python-api-mysql-connector-python.html) | MySQL | Sync | 🗓️ |
|
|
342
|
+
| [`asyncmy`](https://github.com/long2ice/asyncmy) | MySQL | Async | ✅ |
|
|
343
|
+
| [`snowflake`](https://docs.snowflake.com) | Snowflake | Sync | 🗓️ |
|
|
344
|
+
|
|
345
|
+
## Proposed Project Structure
|
|
346
|
+
|
|
347
|
+
- `sqlspec/`:
|
|
348
|
+
- `adapters/`: Contains all database drivers and associated configuration.
|
|
349
|
+
- `extensions/`:
|
|
350
|
+
- `litestar/`: Litestar framework integration ✅
|
|
351
|
+
- `fastapi/`: Future home of `fastapi` integration.
|
|
352
|
+
- `flask/`: Future home of `flask` integration.
|
|
353
|
+
- `*/`: Future home of your favorite framework integration
|
|
354
|
+
- `base.py`: Contains base protocols for database configurations.
|
|
355
|
+
- `statement/`: Contains the SQL statement system with builders, validation, and transformation.
|
|
356
|
+
- `storage/`: Contains unified storage operations for data import/export.
|
|
357
|
+
- `utils/`: Contains utility functions used throughout the project.
|
|
358
|
+
- `exceptions.py`: Contains custom exceptions for SQLSpec.
|
|
359
|
+
- `typing.py`: Contains type hints, type guards and several facades for optional libraries that are not required for the core functionality of SQLSpec.
|
|
360
|
+
|
|
361
|
+
## Get Involved
|
|
362
|
+
|
|
363
|
+
SQLSpec is an open-source project, and contributions are welcome! Whether you're interested in adding support for new databases, improving the query interface, or simply providing feedback, your input is valuable.
|
|
364
|
+
|
|
365
|
+
**Disclaimer**: SQLSpec is under active development. Expect changes and improvements as the project evolves.
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
51ff5a9eadfdefd49f98__mypyc.cpython-39-aarch64-linux-gnu.so,sha256=7T4foO0oy1KQRxA3vNxKguy-02foRfCDkH6XHAV-gA0,2207776
|
|
2
|
+
sqlspec/__init__.py,sha256=8_TR9bXd7bkA4qBGCzTHNawH7KXaJ4YlnCJzJwvgud8,2066
|
|
3
|
+
sqlspec/__main__.py,sha256=lXBKZMOXA1uY735Rnsb-GS7aXy0nt22tYmd2X9FcxrY,253
|
|
4
|
+
sqlspec/__metadata__.py,sha256=IUw6MCTy1oeUJ1jAVYbuJLkOWbiAWorZ5W-E-SAD9N4,395
|
|
5
|
+
sqlspec/_serialization.py,sha256=6U5-smk2h2yl0i6am2prtOLJTdu4NJQdcLlSfSUMaUQ,2590
|
|
6
|
+
sqlspec/_sql.py,sha256=FIYp2u5NgIBc375Jkt2ZfA81Xs7ABcKY92A5rwWXuFE,60340
|
|
7
|
+
sqlspec/_typing.py,sha256=jv-7QHGLrJLfnP86bR-Xcmj3PDoddNZEKDz_vYRBiAU,22684
|
|
8
|
+
sqlspec/base.py,sha256=lVLzFD-nzEU6QnwnU0kRWh3XWjbvXWX0XnnUViYBoQk,21767
|
|
9
|
+
sqlspec/cli.py,sha256=3ZxPwl4neNWyrAkM9J9ccC_gaFigDJbhuZfx15JVE7E,9903
|
|
10
|
+
sqlspec/config.py,sha256=s7csxGK0SlTvB9jOvHlKKm4Y272RInQrUd6hGXwy31Q,14974
|
|
11
|
+
sqlspec/exceptions.py,sha256=mCqNJ0JSPA-TUPpAfdctwwqJWbiNsWap5ATNNRdczwU,6159
|
|
12
|
+
sqlspec/loader.cpython-39-aarch64-linux-gnu.so,sha256=Ezli_jB5ISTJk4ZZgiju7csGlAGGn-jx-8shKPugHFQ,201312
|
|
13
|
+
sqlspec/loader.py,sha256=sIK4I8L1Qe6hyoi6OHuaaAUUTdj4UrsRca16fuMs8HM,27259
|
|
14
|
+
sqlspec/protocols.py,sha256=iwwy7zdIBV7TcoxIYpKuTvN5fGiULQac2f4a-saxyKU,12937
|
|
15
|
+
sqlspec/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
|
+
sqlspec/typing.py,sha256=JEq2VsTaLdNZ1HAqj3n_HgQgdwlQQOCcZx3VBiPs0UA,7393
|
|
17
|
+
sqlspec/adapters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
|
+
sqlspec/adapters/adbc/__init__.py,sha256=CqBaEahvHbQ5NxmBJuuCtZ8v5wuaPgbqSSe9WUhglWY,336
|
|
19
|
+
sqlspec/adapters/adbc/_types.py,sha256=htTZ20qVo6Iod_ooUTLGd0xAL8AUYA4qeOexTaLQG3Q,351
|
|
20
|
+
sqlspec/adapters/adbc/config.py,sha256=UdS_4q5tsXKPEilD2dLtk9H1BI02CTSvhIWEDChrPEs,13871
|
|
21
|
+
sqlspec/adapters/adbc/driver.py,sha256=nYS6e6DXxZ8lHzUFvXvC8qtcGSBTvK8IF_NlBbw56pg,20217
|
|
22
|
+
sqlspec/adapters/aiosqlite/__init__.py,sha256=q2YXU9WCL2RSYFvd0DiXz5PeCaezCRmrqmQVd86V2so,577
|
|
23
|
+
sqlspec/adapters/aiosqlite/_types.py,sha256=M8VqaW6iCigfExhdJM2yPAN09Ue2yBoBL59-QXGBObo,355
|
|
24
|
+
sqlspec/adapters/aiosqlite/config.py,sha256=F_trn-H2KcB1sH1fXdGKYNLcDFwu28WszTBoESK8D0c,9036
|
|
25
|
+
sqlspec/adapters/aiosqlite/driver.py,sha256=pU6uyvZSDrUsgkLkBW1guq6wno5FOyqt9Tg8dg6L7HM,9644
|
|
26
|
+
sqlspec/adapters/asyncmy/__init__.py,sha256=wBgak4MA3ySaGQHUxrnv3HdSVQKKRWf1_DmENL0LkWs,531
|
|
27
|
+
sqlspec/adapters/asyncmy/_types.py,sha256=WbwREzJkLYmqd4c7A7cu04WaD5g7-n35ZETHZvbP1Z8,250
|
|
28
|
+
sqlspec/adapters/asyncmy/config.py,sha256=8fGiiFjIaT_y6OcVj_7dTK9sSuLqucMRsGcRPoYigy8,6557
|
|
29
|
+
sqlspec/adapters/asyncmy/driver.py,sha256=W_RLuGrGlqLl5aZBfMu4ZxBcgKZDPOmoJuAD-wpZeKM,11215
|
|
30
|
+
sqlspec/adapters/asyncpg/__init__.py,sha256=h3lg3pLBLrS9ABBt5yKFKhGL69RpOlASYSqVCuAuURY,567
|
|
31
|
+
sqlspec/adapters/asyncpg/_types.py,sha256=p65WrqfUl2cx5Md759_aV8m_gHP-PyCzNk48bLhDQkc,425
|
|
32
|
+
sqlspec/adapters/asyncpg/config.py,sha256=KdJ2BEtkIA3X3BY4C86zCOUH1-U3AT8ZPNYOpbN0e3A,8752
|
|
33
|
+
sqlspec/adapters/asyncpg/driver.py,sha256=jKDnh5Cz-LTCQvSGaYPgDysl7aocVZ9Wfxy_ERz0RUw,14286
|
|
34
|
+
sqlspec/adapters/bigquery/__init__.py,sha256=1nzkWubO4ZObuK27QoeGfS05ed5v02NU4GaXrvqjlw0,504
|
|
35
|
+
sqlspec/adapters/bigquery/_types.py,sha256=gECmbiSmZmnR-xJpmznhnva4SbhhdcYQ09jBdqMAmOs,255
|
|
36
|
+
sqlspec/adapters/bigquery/config.py,sha256=KYVvhcd4MyU2ak0t1mX3bd3EXlVMEciO7YPaDtZsPc8,11975
|
|
37
|
+
sqlspec/adapters/bigquery/driver.py,sha256=3y8gwrYTt6ktPKE0ihGk5Dj7yvL52Gc8uT1b1ynaCuA,24016
|
|
38
|
+
sqlspec/adapters/duckdb/__init__.py,sha256=iovQlYGfizYpIZpbc1YymK2xt6pZ4ApQj6I0Q0lHc3I,603
|
|
39
|
+
sqlspec/adapters/duckdb/_types.py,sha256=4p5nuD1yNs0fmQ5sGxKFx2ru6jUCPrpsYgqfh-uZHM8,270
|
|
40
|
+
sqlspec/adapters/duckdb/config.py,sha256=krVy5BsS7f2Uv4vmZrwpxlXzbe-MweS6JbHm809NJqE,18610
|
|
41
|
+
sqlspec/adapters/duckdb/driver.py,sha256=HDRPYh1k0JnnnaPpyv8oONn7UAYDCQyTK4fsgFDv6uk,15003
|
|
42
|
+
sqlspec/adapters/oracledb/__init__.py,sha256=AUsZ8m9tDgNwxv9m4LtkIs9Ib6hOtBrGNm-Ee4HWNq0,843
|
|
43
|
+
sqlspec/adapters/oracledb/_types.py,sha256=yPJTQE37HYVgvxI3USonWvFJ2VcfaNnXqfgKNVphmcQ,400
|
|
44
|
+
sqlspec/adapters/oracledb/config.py,sha256=yZITXSWuHKwrjVcuaTLyR9RtVb3WtzmWlBQTjvyUtPo,11383
|
|
45
|
+
sqlspec/adapters/oracledb/driver.py,sha256=mckrpid-XI-3juWbTXfy0JuYuZl3NS-ZB9P2VcJMSTI,22534
|
|
46
|
+
sqlspec/adapters/psqlpy/__init__.py,sha256=ABve2Oj-G-fxMO8WRJ0XzxEw2cs5H3INDnmUI99l8gc,526
|
|
47
|
+
sqlspec/adapters/psqlpy/_types.py,sha256=tG4jwQtBB6mCX5KU5x3hAhxsQUQlQEzbCsYhU3IouVc,269
|
|
48
|
+
sqlspec/adapters/psqlpy/config.py,sha256=h9IZr0vv6-rS7RLHSVsaIdCGgLsTdXQJSSgw4HI99d4,7866
|
|
49
|
+
sqlspec/adapters/psqlpy/driver.py,sha256=e9gHrmjXj7QGE_DxCTA3DhjvckSuFGO7pcdm3kqNv1c,20346
|
|
50
|
+
sqlspec/adapters/psycopg/__init__.py,sha256=swmTz8xlj6LvB-i78tBSE_T-sez2e6lFJW2cMzNJEVE,862
|
|
51
|
+
sqlspec/adapters/psycopg/_types.py,sha256=UJBKDWgARoSR6UxSy8zcIP7HSHTpXU5moJTsjDj0M4M,563
|
|
52
|
+
sqlspec/adapters/psycopg/config.py,sha256=tyxP1WbLQlwvdWdykG_iluIaQg0O6GLUwMLtfaRQ3sE,16268
|
|
53
|
+
sqlspec/adapters/psycopg/driver.py,sha256=qMRaoUI1RF0JLGEEIWzZJTyPd5jEaRFq6ZY0dkukrCQ,33434
|
|
54
|
+
sqlspec/adapters/sqlite/__init__.py,sha256=wDN0StuJxCy0VX1fVYDngTFUP5Cx8d0-foeJeJaEVOw,484
|
|
55
|
+
sqlspec/adapters/sqlite/_types.py,sha256=4Nqolhk8s4mwLw13BwUjuyhAbM9BsKwJCvcmjMWkhaY,246
|
|
56
|
+
sqlspec/adapters/sqlite/config.py,sha256=jTomeuHahwMN9huOnQclAuJyiFL1m8hoexQxWCn0Ckg,9166
|
|
57
|
+
sqlspec/adapters/sqlite/driver.py,sha256=uAhasoCNOV30gTvl1EUpofRcm8YiEW5RnVy07XyypzI,12103
|
|
58
|
+
sqlspec/builder/__init__.py,sha256=E3UGimdSOUK_ZGxFEOsCduwWWwTxcqoLe3Rvh4KbGNY,1429
|
|
59
|
+
sqlspec/builder/_base.py,sha256=yz-6e-x66vrNne6z5zq4Ae0C3p0mHEEIe1Y8er-A0pg,17812
|
|
60
|
+
sqlspec/builder/_column.py,sha256=46baZj403BKfGjZcMc9LtQfMLeMQ7ROPyFL64V7dDM0,13124
|
|
61
|
+
sqlspec/builder/_ddl.py,sha256=A_fV4d92o2ZOhX150YMSsQDm3veQTQrwlxgLdFMBBfg,48184
|
|
62
|
+
sqlspec/builder/_ddl_utils.py,sha256=1mFSNe9w5rZXA1Ud4CTuca7eibi0XayHrIPcnEgRB7s,4034
|
|
63
|
+
sqlspec/builder/_delete.py,sha256=xWA5nQB3UB8kpEGXN2k5ynt4cGZ7blkNoURpI0bKoeg,2264
|
|
64
|
+
sqlspec/builder/_insert.py,sha256=rARWh5olbur6oPP_3FoAuJp8irj5cRLW0mKdWEx2cqU,16896
|
|
65
|
+
sqlspec/builder/_merge.py,sha256=95PLQSKA3zjk0wTZG3m817fTZpsS95PrS2qF34iLAP8,2004
|
|
66
|
+
sqlspec/builder/_parsing_utils.py,sha256=LyvFJ6nCU7b-h8QFyg4cYtcc0RKVzI_sHTeOVrU1_s8,7102
|
|
67
|
+
sqlspec/builder/_select.py,sha256=m5sfyuAssjlNimLLNBAeFooVIfM2FgKN1boPfdsOkaA,5785
|
|
68
|
+
sqlspec/builder/_update.py,sha256=UFHM_uWVY5RnZQ6winiyjKNtBryKRAXJlXtCVQdifyw,6015
|
|
69
|
+
sqlspec/builder/mixins/__init__.py,sha256=YXhAzKmQbQtne5j26SKWY8PUxwosl0RhlhLoahAdkj0,1885
|
|
70
|
+
sqlspec/builder/mixins/_cte_and_set_ops.py,sha256=p5O9m_jvpaWxv1XP9Ys2DRI-qOTq30rr2EwYjAbIT8o,9088
|
|
71
|
+
sqlspec/builder/mixins/_delete_operations.py,sha256=l0liajnoAfRgtWtyStuAIfxreEFRkNO4DtBwyGqAfic,1198
|
|
72
|
+
sqlspec/builder/mixins/_insert_operations.py,sha256=3ZuVNAPgJG0fzOPaprwUPa0Un3NP7erHwtCg8AGZWD8,9500
|
|
73
|
+
sqlspec/builder/mixins/_join_operations.py,sha256=hZKuKCGjPRX379g0DblADRXdU8mtEiEOEerxCRHuo28,7280
|
|
74
|
+
sqlspec/builder/mixins/_merge_operations.py,sha256=e9QDv1s84-2F2ZAZrr7UJtKXhy3X0NDN7AZ--8mOTKw,24193
|
|
75
|
+
sqlspec/builder/mixins/_order_limit_operations.py,sha256=ABPuFSqHRv7XaS9-3HNZO3Jn0QovhJrkYT158xxduns,4835
|
|
76
|
+
sqlspec/builder/mixins/_pivot_operations.py,sha256=j5vdzXuEqB1Jn3Ie_QjVwSH2_OEi65oZ64bQJHd3jXo,6108
|
|
77
|
+
sqlspec/builder/mixins/_select_operations.py,sha256=ArFWrEGk6ZDiwfi5gUseGTBHCzsSKWfF2EjJlJWL2Ek,25021
|
|
78
|
+
sqlspec/builder/mixins/_update_operations.py,sha256=lk9VRM0KGmYhofbWChemJxSZF6I0LhrRgqMXVmXZMeU,8650
|
|
79
|
+
sqlspec/builder/mixins/_where_clause.py,sha256=jqz58H9X2ZDsiQH9DeBrrQJf-Am7-x1ApJH47U2DFfo,33789
|
|
80
|
+
sqlspec/core/__init__.py,sha256=rU_xGsXhqIOnBbyB2InhJknYePm5NQ2DSWdBigror4g,1775
|
|
81
|
+
sqlspec/core/cache.cpython-39-aarch64-linux-gnu.so,sha256=fk0SmHMXp32Dy8dX2LLHIXmDVGIkaacrMhtTklKpN4Y,201304
|
|
82
|
+
sqlspec/core/cache.py,sha256=cLL9bd5wn1oeMzn5E5Ym0sAemA8U4QP6B55x4L9-26I,27044
|
|
83
|
+
sqlspec/core/compiler.cpython-39-aarch64-linux-gnu.so,sha256=Nu__TZvO7cAglBfGAKr4LZUWjWwufEMDxULNjW-oIyE,201312
|
|
84
|
+
sqlspec/core/compiler.py,sha256=pfBRrMFvrNuCwQgzKNljNTYH3imARlek3Ja5mJkHI88,14652
|
|
85
|
+
sqlspec/core/filters.cpython-39-aarch64-linux-gnu.so,sha256=mzCHYKwKynxUT3mAIwRyFaA3wGMeHY_wmEjT-P5K2I0,201312
|
|
86
|
+
sqlspec/core/filters.py,sha256=X0wRd0vNOFgeOK98ReeTyKt408GCnnmE9p45Bvur3kw,31351
|
|
87
|
+
sqlspec/core/hashing.cpython-39-aarch64-linux-gnu.so,sha256=PNq2OtnDGWfWP5ReMRqH3-UM0DXVAai5G_Wu6FjSfpg,201312
|
|
88
|
+
sqlspec/core/hashing.py,sha256=4KyAFWtFDMYreoBGGPQppEuMWO6_NrRYlw9Lm-qeJqo,10429
|
|
89
|
+
sqlspec/core/parameters.cpython-39-aarch64-linux-gnu.so,sha256=VKlIzerMINXgSPnnvmLVuPboK-RMAUq-i8yR6UDwkgA,201320
|
|
90
|
+
sqlspec/core/parameters.py,sha256=yLnGt_tqqpb28xrgnq3oQ-1mcf45Pjf6uE3c0ag5JJ4,54265
|
|
91
|
+
sqlspec/core/result.cpython-39-aarch64-linux-gnu.so,sha256=ouz17WKpnQKwsniThHlJhLwiwXvylYouV8-C0BM1FYI,201312
|
|
92
|
+
sqlspec/core/result.py,sha256=VnxiTW7m6QfQkKRA8U_WtX198HelX2TCHd4aKPmKHHo,21340
|
|
93
|
+
sqlspec/core/splitter.cpython-39-aarch64-linux-gnu.so,sha256=0I4w0fPCbDE9Yi9iXQYqrxCKvfZezaquzLKMbAWZF0w,201312
|
|
94
|
+
sqlspec/core/splitter.py,sha256=cb2P1B0q5vvALHi3SEJ7VdbRHH2GWsftrmJi9PYMbeE,28089
|
|
95
|
+
sqlspec/core/statement.cpython-39-aarch64-linux-gnu.so,sha256=BPtj1iRlEHSwnYJntpzL35f_kN5L11OBLCgiD0D0hb4,201312
|
|
96
|
+
sqlspec/core/statement.py,sha256=HsbSu0qnfJzpL_s1kwfxtWnyuCfAq8WjYRc3YQqxkDw,25700
|
|
97
|
+
sqlspec/driver/__init__.py,sha256=QVpDRQGd1GreIP199en6qDbq-cZJcEF5go68DINagUk,569
|
|
98
|
+
sqlspec/driver/_async.py,sha256=29XYWjeIuIwElO3QFUtEqQZq1ss2Ulueh0UD-aX2x-E,19636
|
|
99
|
+
sqlspec/driver/_common.py,sha256=bjJCBfM5YaU-98vEnEc5qFcjWvaUVEcQS6v3gGC0UKw,26313
|
|
100
|
+
sqlspec/driver/_sync.py,sha256=pCKNHj46HcZYn9292FWyoWkNc6gj4ArUT8ttik4YyRQ,19408
|
|
101
|
+
sqlspec/driver/mixins/__init__.py,sha256=gN4pQyJXxNy0xi91dcMJGA7DQ7TbjGjQI24SSpZc6Go,248
|
|
102
|
+
sqlspec/driver/mixins/_result_tools.py,sha256=8z-W4py3BOtn3WB7ElpsVAEjGRozgHsfymTE_oXqcnw,7576
|
|
103
|
+
sqlspec/driver/mixins/_sql_translator.py,sha256=jmwlocjSqj-ZMfssMva6GR8t-CRlDVwU3ec2ve0l3JE,3322
|
|
104
|
+
sqlspec/extensions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
105
|
+
sqlspec/extensions/aiosql/__init__.py,sha256=-9cefc9pYPf9vCgALoB-y1DtmcgRjKe2azfl6RIarAA,414
|
|
106
|
+
sqlspec/extensions/aiosql/adapter.py,sha256=CXkNZaZq86ZhfYFGx4IFbkHmbIFQKMd9CS6Q2jkMCok,16009
|
|
107
|
+
sqlspec/extensions/litestar/__init__.py,sha256=tOmQ7RHSWOot7p30gk0efxxuP0OCq1opyyZqNmQY7FE,320
|
|
108
|
+
sqlspec/extensions/litestar/_utils.py,sha256=o-FuUj1_WkDrLxQxiP6hXDak66XfyRP3QLyEVKrIRjI,1954
|
|
109
|
+
sqlspec/extensions/litestar/cli.py,sha256=X4DlAx3Ry-ccOjAQSxe8SMtyJKCFJVLTbENPU_efKuU,1356
|
|
110
|
+
sqlspec/extensions/litestar/config.py,sha256=3UI_vhtbupCLsf1nhUgUpRlCoUS5c0GsAjWvegT0c3c,4462
|
|
111
|
+
sqlspec/extensions/litestar/handlers.py,sha256=3LreU8rZvuHaJnKlN09ttu4wSorWJedsuKgeLT-cOEc,9993
|
|
112
|
+
sqlspec/extensions/litestar/plugin.py,sha256=I0aRnL4oZPUYk7pYhZSL3yikl7ViM0kr33kVmH4W-MU,5637
|
|
113
|
+
sqlspec/extensions/litestar/providers.py,sha256=5LRb5JvRV_XZdNOKkdaIy3j5x-dFCcAi1ea1pgwuapI,18882
|
|
114
|
+
sqlspec/migrations/__init__.py,sha256=n9y2yLQb02zMz36bPXnrInsSIMLunwHvO7e8UvCYBJc,1061
|
|
115
|
+
sqlspec/migrations/base.py,sha256=D5-k0m4SnmVU0QRRPcMCvMAyEoAaceYYmD8JprSozDA,13251
|
|
116
|
+
sqlspec/migrations/commands.py,sha256=LUAOOJcfolv75ZRV33zjdZ9kocyJSJet5hEZhUVIemU,18490
|
|
117
|
+
sqlspec/migrations/loaders.py,sha256=wz-VUd1fEtOg-b1yWnLTTNtHkZkrjw-4o5hEqwUxbS0,12952
|
|
118
|
+
sqlspec/migrations/runner.py,sha256=OxzindA2EzjCAVqI59LxfWC02Ful-aPsOYY9yUV7ypA,7330
|
|
119
|
+
sqlspec/migrations/tracker.py,sha256=-gfHgvcYo1uBdr9FKrIxaU_0v734K5gpdLMuoaX29nQ,5013
|
|
120
|
+
sqlspec/migrations/utils.py,sha256=gWnCOdr8pwfkgG-FSUJgRz4q9TlCgOXY_B7n59NrgVA,3746
|
|
121
|
+
sqlspec/storage/__init__.py,sha256=bLrUfW_E41HH-Pi5kqFTPVYZiSsxlG7OZO1xP23nDSI,691
|
|
122
|
+
sqlspec/storage/capabilities.py,sha256=vyousxls9jISsykgoybpNHlGWN6Hq_pKcsZ5DmKGWvU,3045
|
|
123
|
+
sqlspec/storage/registry.py,sha256=NV-NdAcMdGqU5bHbXbkMuU_HRYuEgii7B4ldXnVSIo4,9529
|
|
124
|
+
sqlspec/storage/backends/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
125
|
+
sqlspec/storage/backends/base.py,sha256=KS2JRZILoH_R_xsfKtYkqQ5a1r5OOBDSE5KbibTmhGY,5730
|
|
126
|
+
sqlspec/storage/backends/fsspec.py,sha256=YVr8X_q5F4Xrr9SyfUDve1dZ9E6KppuM8w6tvLwPKpc,16050
|
|
127
|
+
sqlspec/storage/backends/obstore.py,sha256=8DEpiF3SCfbWx-NxoQXZ8piJOr-9f1WURYK69hCDhnQ,19864
|
|
128
|
+
sqlspec/utils/__init__.py,sha256=DJiG2RGFaL9C0lLZStByzgR_GiPHfdkypAkTEGjTakw,211
|
|
129
|
+
sqlspec/utils/correlation.py,sha256=2jvkAY3nkU3UxNU_9pbBR6cz3A1Q1cGG9IaWSSOIb1Q,4195
|
|
130
|
+
sqlspec/utils/deprecation.py,sha256=L5ylPlkrWahXZ3q2Yta2ReFh4pA8rZapLNw9u_mOOEE,3794
|
|
131
|
+
sqlspec/utils/fixtures.cpython-39-aarch64-linux-gnu.so,sha256=5Jf720LqnnVfWz9FBSu0x6JOdHRa7guVtQyREMFm6l0,201312
|
|
132
|
+
sqlspec/utils/fixtures.py,sha256=Qm2uNMaL_6l6tlij-Pm3tLwD906iFK_OXhwZqOx3WgY,1807
|
|
133
|
+
sqlspec/utils/logging.py,sha256=ZEaj7J8oALrs_-p535vSUFo2tfrHkOEcL5pK2JGGFgM,3708
|
|
134
|
+
sqlspec/utils/module_loader.py,sha256=m5PSN9NwOLd0ZJBuqMVYVi-vaIQMBCVd25vnM3-rv3k,2823
|
|
135
|
+
sqlspec/utils/serializers.py,sha256=TKsRryRcYMnb8Z8MGkYGClIxcYvC8CW7MsrPQTJqEcY,154
|
|
136
|
+
sqlspec/utils/singleton.py,sha256=SKnszJi1NPeERgX7IjVIGYAYx4XqR1E_rph3bU6olAU,1047
|
|
137
|
+
sqlspec/utils/sync_tools.cpython-39-aarch64-linux-gnu.so,sha256=eGrBYBENRpoNWncdAClGmI8u7zOJghYclbIaNDvWODA,201320
|
|
138
|
+
sqlspec/utils/sync_tools.py,sha256=WRuk1ZEhb_0CRrumAdnmi-i-dV6qVd3cgJyZw8RY9QQ,7390
|
|
139
|
+
sqlspec/utils/text.cpython-39-aarch64-linux-gnu.so,sha256=KLt5RKHUwln81EdglYltVweHlXr4rWkpK-BQbYUbsyI,201304
|
|
140
|
+
sqlspec/utils/text.py,sha256=n5K0gvXvyCc8jNteNKsBOymwf_JnQ65f3lu0YaYq4Ys,2898
|
|
141
|
+
sqlspec/utils/type_guards.cpython-39-aarch64-linux-gnu.so,sha256=jYCwBMFv9Jl1N9ZN1TMnzSwmGLlgHnBrt31GOy7s4EQ,201320
|
|
142
|
+
sqlspec/utils/type_guards.py,sha256=9C4SRebO4JiQrMzcJZFUA0KjSU48G26RmX6lbijyjBg,30476
|
|
143
|
+
sqlspec-0.16.2.dist-info/METADATA,sha256=uxIDZpVGDc5LNmEdLfdULbelze5R5WSAxXwRYXZ42ZQ,16822
|
|
144
|
+
sqlspec-0.16.2.dist-info/WHEEL,sha256=VBXJbhT7HSAW3Is97O7vHGdxCIJnPao2LW7TqhpUSHw,184
|
|
145
|
+
sqlspec-0.16.2.dist-info/entry_points.txt,sha256=G-ZqY1Nuuw3Iys7nXw23f6ILenk_Lt47VdK2mhJCWHg,53
|
|
146
|
+
sqlspec-0.16.2.dist-info/RECORD,,
|
|
147
|
+
sqlspec-0.16.2.dist-info/licenses/LICENSE,sha256=MdujfZ6l5HuLz4mElxlu049itenOR3gnhN1_Nd3nVcM,1078
|
|
148
|
+
sqlspec-0.16.2.dist-info/licenses/NOTICE,sha256=Lyir8ozXWov7CyYS4huVaOCNrtgL17P-bNV-5daLntQ,1634
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Litestar Organization
|
|
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,29 @@
|
|
|
1
|
+
# Early versions of this utility adapt code from `aoisql`.
|
|
2
|
+
# BSD 2-Clause License
|
|
3
|
+
Copyright (c) 2014-2017, Honza Pokorny
|
|
4
|
+
Copyright (c) 2018, William Vaughn
|
|
5
|
+
All rights reserved.
|
|
6
|
+
|
|
7
|
+
Redistribution and use in source and binary forms, with or without
|
|
8
|
+
modification, are permitted provided that the following conditions are met:
|
|
9
|
+
|
|
10
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
11
|
+
list of conditions and the following disclaimer.
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
17
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
18
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
19
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
|
20
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
21
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
22
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
23
|
+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
24
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
25
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
26
|
+
|
|
27
|
+
The views and conclusions contained in the software and documentation are those
|
|
28
|
+
of the authors and should not be interpreted as representing official policies,
|
|
29
|
+
either expressed or implied, of the aiosql Project.
|