sqlspec 0.47.0__cp314-cp314-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.
- f68e0789eb443ecb1c2c__mypyc.cp314-win_amd64.pyd +0 -0
- sqlspec/__init__.py +167 -0
- sqlspec/__main__.py +12 -0
- sqlspec/__metadata__.py +14 -0
- sqlspec/_typing.py +714 -0
- sqlspec/adapters/__init__.py +0 -0
- sqlspec/adapters/adbc/__init__.py +13 -0
- sqlspec/adapters/adbc/_typing.py +106 -0
- sqlspec/adapters/adbc/adk/__init__.py +5 -0
- sqlspec/adapters/adbc/adk/store.py +1280 -0
- sqlspec/adapters/adbc/config.py +378 -0
- sqlspec/adapters/adbc/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/adbc/core.py +922 -0
- sqlspec/adapters/adbc/data_dictionary.py +339 -0
- sqlspec/adapters/adbc/driver.py +534 -0
- sqlspec/adapters/adbc/events/__init__.py +5 -0
- sqlspec/adapters/adbc/events/store.py +285 -0
- sqlspec/adapters/adbc/litestar/__init__.py +5 -0
- sqlspec/adapters/adbc/litestar/store.py +534 -0
- sqlspec/adapters/adbc/type_converter.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/adbc/type_converter.py +142 -0
- sqlspec/adapters/aiomysql/__init__.py +21 -0
- sqlspec/adapters/aiomysql/_typing.py +137 -0
- sqlspec/adapters/aiomysql/adk/__init__.py +5 -0
- sqlspec/adapters/aiomysql/adk/store.py +678 -0
- sqlspec/adapters/aiomysql/config.py +305 -0
- sqlspec/adapters/aiomysql/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/aiomysql/core.py +536 -0
- sqlspec/adapters/aiomysql/data_dictionary.py +121 -0
- sqlspec/adapters/aiomysql/driver.py +386 -0
- sqlspec/adapters/aiomysql/events/__init__.py +5 -0
- sqlspec/adapters/aiomysql/events/store.py +104 -0
- sqlspec/adapters/aiomysql/litestar/__init__.py +5 -0
- sqlspec/adapters/aiomysql/litestar/store.py +314 -0
- sqlspec/adapters/aiosqlite/__init__.py +26 -0
- sqlspec/adapters/aiosqlite/_typing.py +109 -0
- sqlspec/adapters/aiosqlite/adk/__init__.py +5 -0
- sqlspec/adapters/aiosqlite/adk/store.py +829 -0
- sqlspec/adapters/aiosqlite/config.py +315 -0
- sqlspec/adapters/aiosqlite/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/aiosqlite/core.py +315 -0
- sqlspec/adapters/aiosqlite/data_dictionary.py +202 -0
- sqlspec/adapters/aiosqlite/driver.py +311 -0
- sqlspec/adapters/aiosqlite/events/__init__.py +5 -0
- sqlspec/adapters/aiosqlite/events/store.py +20 -0
- sqlspec/adapters/aiosqlite/litestar/__init__.py +5 -0
- sqlspec/adapters/aiosqlite/litestar/store.py +279 -0
- sqlspec/adapters/aiosqlite/pool.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/aiosqlite/pool.py +734 -0
- sqlspec/adapters/asyncmy/__init__.py +21 -0
- sqlspec/adapters/asyncmy/_typing.py +113 -0
- sqlspec/adapters/asyncmy/adk/__init__.py +5 -0
- sqlspec/adapters/asyncmy/adk/store.py +644 -0
- sqlspec/adapters/asyncmy/config.py +307 -0
- sqlspec/adapters/asyncmy/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/asyncmy/core.py +538 -0
- sqlspec/adapters/asyncmy/data_dictionary.py +122 -0
- sqlspec/adapters/asyncmy/driver.py +391 -0
- sqlspec/adapters/asyncmy/events/__init__.py +5 -0
- sqlspec/adapters/asyncmy/events/store.py +104 -0
- sqlspec/adapters/asyncmy/litestar/__init__.py +5 -0
- sqlspec/adapters/asyncmy/litestar/store.py +296 -0
- sqlspec/adapters/asyncpg/__init__.py +26 -0
- sqlspec/adapters/asyncpg/_typing.py +103 -0
- sqlspec/adapters/asyncpg/adk/__init__.py +5 -0
- sqlspec/adapters/asyncpg/adk/store.py +483 -0
- sqlspec/adapters/asyncpg/config.py +575 -0
- sqlspec/adapters/asyncpg/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/asyncpg/core.py +480 -0
- sqlspec/adapters/asyncpg/data_dictionary.py +157 -0
- sqlspec/adapters/asyncpg/driver.py +487 -0
- sqlspec/adapters/asyncpg/events/__init__.py +6 -0
- sqlspec/adapters/asyncpg/events/_hub.py +181 -0
- sqlspec/adapters/asyncpg/events/backend.py +210 -0
- sqlspec/adapters/asyncpg/events/store.py +40 -0
- sqlspec/adapters/asyncpg/litestar/__init__.py +5 -0
- sqlspec/adapters/asyncpg/litestar/store.py +251 -0
- sqlspec/adapters/bigquery/__init__.py +15 -0
- sqlspec/adapters/bigquery/_typing.py +108 -0
- sqlspec/adapters/bigquery/config.py +362 -0
- sqlspec/adapters/bigquery/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/bigquery/core.py +768 -0
- sqlspec/adapters/bigquery/data_dictionary.py +120 -0
- sqlspec/adapters/bigquery/driver.py +542 -0
- sqlspec/adapters/bigquery/events/__init__.py +5 -0
- sqlspec/adapters/bigquery/events/store.py +139 -0
- sqlspec/adapters/bigquery/litestar/__init__.py +5 -0
- sqlspec/adapters/bigquery/litestar/store.py +325 -0
- sqlspec/adapters/bigquery/type_converter.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/bigquery/type_converter.py +107 -0
- sqlspec/adapters/cockroach_asyncpg/__init__.py +26 -0
- sqlspec/adapters/cockroach_asyncpg/_typing.py +73 -0
- sqlspec/adapters/cockroach_asyncpg/adk/__init__.py +3 -0
- sqlspec/adapters/cockroach_asyncpg/adk/store.py +465 -0
- sqlspec/adapters/cockroach_asyncpg/config.py +248 -0
- sqlspec/adapters/cockroach_asyncpg/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/cockroach_asyncpg/core.py +55 -0
- sqlspec/adapters/cockroach_asyncpg/data_dictionary.py +110 -0
- sqlspec/adapters/cockroach_asyncpg/driver.py +142 -0
- sqlspec/adapters/cockroach_asyncpg/events/__init__.py +3 -0
- sqlspec/adapters/cockroach_asyncpg/events/store.py +20 -0
- sqlspec/adapters/cockroach_asyncpg/litestar/__init__.py +3 -0
- sqlspec/adapters/cockroach_asyncpg/litestar/store.py +142 -0
- sqlspec/adapters/cockroach_psycopg/__init__.py +39 -0
- sqlspec/adapters/cockroach_psycopg/_typing.py +137 -0
- sqlspec/adapters/cockroach_psycopg/adk/__init__.py +13 -0
- sqlspec/adapters/cockroach_psycopg/adk/store.py +1039 -0
- sqlspec/adapters/cockroach_psycopg/config.py +511 -0
- sqlspec/adapters/cockroach_psycopg/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/cockroach_psycopg/core.py +63 -0
- sqlspec/adapters/cockroach_psycopg/data_dictionary.py +220 -0
- sqlspec/adapters/cockroach_psycopg/driver.py +273 -0
- sqlspec/adapters/cockroach_psycopg/events/__init__.py +6 -0
- sqlspec/adapters/cockroach_psycopg/events/store.py +34 -0
- sqlspec/adapters/cockroach_psycopg/litestar/__init__.py +3 -0
- sqlspec/adapters/cockroach_psycopg/litestar/store.py +327 -0
- sqlspec/adapters/duckdb/__init__.py +29 -0
- sqlspec/adapters/duckdb/_typing.py +104 -0
- sqlspec/adapters/duckdb/adk/__init__.py +14 -0
- sqlspec/adapters/duckdb/adk/store.py +935 -0
- sqlspec/adapters/duckdb/config.py +386 -0
- sqlspec/adapters/duckdb/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/duckdb/core.py +332 -0
- sqlspec/adapters/duckdb/data_dictionary.py +140 -0
- sqlspec/adapters/duckdb/driver.py +426 -0
- sqlspec/adapters/duckdb/events/__init__.py +5 -0
- sqlspec/adapters/duckdb/events/store.py +57 -0
- sqlspec/adapters/duckdb/litestar/__init__.py +5 -0
- sqlspec/adapters/duckdb/litestar/store.py +330 -0
- sqlspec/adapters/duckdb/pool.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/duckdb/pool.py +350 -0
- sqlspec/adapters/duckdb/type_converter.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/duckdb/type_converter.py +118 -0
- sqlspec/adapters/mysqlconnector/__init__.py +39 -0
- sqlspec/adapters/mysqlconnector/_typing.py +186 -0
- sqlspec/adapters/mysqlconnector/adk/__init__.py +15 -0
- sqlspec/adapters/mysqlconnector/adk/store.py +1183 -0
- sqlspec/adapters/mysqlconnector/config.py +421 -0
- sqlspec/adapters/mysqlconnector/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/mysqlconnector/core.py +472 -0
- sqlspec/adapters/mysqlconnector/data_dictionary.py +230 -0
- sqlspec/adapters/mysqlconnector/driver.py +516 -0
- sqlspec/adapters/mysqlconnector/events/__init__.py +8 -0
- sqlspec/adapters/mysqlconnector/events/store.py +98 -0
- sqlspec/adapters/mysqlconnector/litestar/__init__.py +5 -0
- sqlspec/adapters/mysqlconnector/litestar/store.py +426 -0
- sqlspec/adapters/oracledb/__init__.py +39 -0
- sqlspec/adapters/oracledb/_json_handlers.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/oracledb/_json_handlers.py +196 -0
- sqlspec/adapters/oracledb/_param_types.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/oracledb/_param_types.py +46 -0
- sqlspec/adapters/oracledb/_typing.py +258 -0
- sqlspec/adapters/oracledb/_uuid_handlers.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/oracledb/_uuid_handlers.py +163 -0
- sqlspec/adapters/oracledb/_vector_handlers.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/oracledb/_vector_handlers.py +228 -0
- sqlspec/adapters/oracledb/adk/__init__.py +21 -0
- sqlspec/adapters/oracledb/adk/store.py +2453 -0
- sqlspec/adapters/oracledb/config.py +575 -0
- sqlspec/adapters/oracledb/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/oracledb/core.py +820 -0
- sqlspec/adapters/oracledb/data_dictionary.py +404 -0
- sqlspec/adapters/oracledb/driver.py +1277 -0
- sqlspec/adapters/oracledb/events/__init__.py +16 -0
- sqlspec/adapters/oracledb/events/_hub.py +345 -0
- sqlspec/adapters/oracledb/events/backend.py +300 -0
- sqlspec/adapters/oracledb/events/store.py +420 -0
- sqlspec/adapters/oracledb/litestar/__init__.py +5 -0
- sqlspec/adapters/oracledb/litestar/store.py +781 -0
- sqlspec/adapters/oracledb/migrations.py +539 -0
- sqlspec/adapters/oracledb/type_converter.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/oracledb/type_converter.py +211 -0
- sqlspec/adapters/psqlpy/__init__.py +18 -0
- sqlspec/adapters/psqlpy/_typing.py +121 -0
- sqlspec/adapters/psqlpy/adk/__init__.py +5 -0
- sqlspec/adapters/psqlpy/adk/store.py +591 -0
- sqlspec/adapters/psqlpy/config.py +376 -0
- sqlspec/adapters/psqlpy/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/psqlpy/core.py +694 -0
- sqlspec/adapters/psqlpy/data_dictionary.py +121 -0
- sqlspec/adapters/psqlpy/driver.py +411 -0
- sqlspec/adapters/psqlpy/events/__init__.py +6 -0
- sqlspec/adapters/psqlpy/events/_hub.py +204 -0
- sqlspec/adapters/psqlpy/events/backend.py +210 -0
- sqlspec/adapters/psqlpy/events/store.py +20 -0
- sqlspec/adapters/psqlpy/litestar/__init__.py +5 -0
- sqlspec/adapters/psqlpy/litestar/store.py +270 -0
- sqlspec/adapters/psqlpy/type_converter.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/psqlpy/type_converter.py +113 -0
- sqlspec/adapters/psycopg/__init__.py +38 -0
- sqlspec/adapters/psycopg/_typing.py +218 -0
- sqlspec/adapters/psycopg/adk/__init__.py +10 -0
- sqlspec/adapters/psycopg/adk/store.py +1106 -0
- sqlspec/adapters/psycopg/config.py +695 -0
- sqlspec/adapters/psycopg/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/psycopg/core.py +520 -0
- sqlspec/adapters/psycopg/data_dictionary.py +278 -0
- sqlspec/adapters/psycopg/driver.py +1033 -0
- sqlspec/adapters/psycopg/events/__init__.py +20 -0
- sqlspec/adapters/psycopg/events/_hub.py +388 -0
- sqlspec/adapters/psycopg/events/backend.py +398 -0
- sqlspec/adapters/psycopg/events/store.py +42 -0
- sqlspec/adapters/psycopg/litestar/__init__.py +5 -0
- sqlspec/adapters/psycopg/litestar/store.py +554 -0
- sqlspec/adapters/psycopg/type_converter.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/psycopg/type_converter.py +93 -0
- sqlspec/adapters/pymysql/__init__.py +21 -0
- sqlspec/adapters/pymysql/_typing.py +92 -0
- sqlspec/adapters/pymysql/adk/__init__.py +5 -0
- sqlspec/adapters/pymysql/adk/store.py +657 -0
- sqlspec/adapters/pymysql/config.py +176 -0
- sqlspec/adapters/pymysql/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/pymysql/core.py +469 -0
- sqlspec/adapters/pymysql/data_dictionary.py +120 -0
- sqlspec/adapters/pymysql/driver.py +271 -0
- sqlspec/adapters/pymysql/events/__init__.py +5 -0
- sqlspec/adapters/pymysql/events/store.py +50 -0
- sqlspec/adapters/pymysql/litestar/__init__.py +5 -0
- sqlspec/adapters/pymysql/litestar/store.py +232 -0
- sqlspec/adapters/pymysql/pool.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/pymysql/pool.py +184 -0
- sqlspec/adapters/spanner/__init__.py +33 -0
- sqlspec/adapters/spanner/_typing.py +102 -0
- sqlspec/adapters/spanner/adk/__init__.py +5 -0
- sqlspec/adapters/spanner/adk/store.py +758 -0
- sqlspec/adapters/spanner/config.py +355 -0
- sqlspec/adapters/spanner/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/spanner/core.py +263 -0
- sqlspec/adapters/spanner/data_dictionary.py +120 -0
- sqlspec/adapters/spanner/driver.py +407 -0
- sqlspec/adapters/spanner/events/__init__.py +5 -0
- sqlspec/adapters/spanner/events/store.py +187 -0
- sqlspec/adapters/spanner/litestar/__init__.py +5 -0
- sqlspec/adapters/spanner/litestar/store.py +291 -0
- sqlspec/adapters/spanner/type_converter.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/spanner/type_converter.py +342 -0
- sqlspec/adapters/sqlite/__init__.py +19 -0
- sqlspec/adapters/sqlite/_typing.py +123 -0
- sqlspec/adapters/sqlite/adk/__init__.py +5 -0
- sqlspec/adapters/sqlite/adk/store.py +992 -0
- sqlspec/adapters/sqlite/config.py +240 -0
- sqlspec/adapters/sqlite/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/sqlite/core.py +357 -0
- sqlspec/adapters/sqlite/data_dictionary.py +198 -0
- sqlspec/adapters/sqlite/driver.py +527 -0
- sqlspec/adapters/sqlite/events/__init__.py +5 -0
- sqlspec/adapters/sqlite/events/store.py +20 -0
- sqlspec/adapters/sqlite/litestar/__init__.py +5 -0
- sqlspec/adapters/sqlite/litestar/store.py +316 -0
- sqlspec/adapters/sqlite/pool.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/sqlite/pool.py +237 -0
- sqlspec/adapters/sqlite/type_converter.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/sqlite/type_converter.py +114 -0
- sqlspec/base.py +832 -0
- sqlspec/builder/__init__.py +181 -0
- sqlspec/builder/_base.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_base.py +1071 -0
- sqlspec/builder/_column.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_column.py +521 -0
- sqlspec/builder/_ddl.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_ddl.py +1691 -0
- sqlspec/builder/_delete.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_delete.py +95 -0
- sqlspec/builder/_dml.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_dml.py +386 -0
- sqlspec/builder/_explain.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_explain.py +579 -0
- sqlspec/builder/_expression_wrappers.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_expression_wrappers.py +46 -0
- sqlspec/builder/_factory.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_factory.py +1884 -0
- sqlspec/builder/_insert.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_insert.py +405 -0
- sqlspec/builder/_join.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_join.py +489 -0
- sqlspec/builder/_merge.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_merge.py +823 -0
- sqlspec/builder/_parsing_utils.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_parsing_utils.py +295 -0
- sqlspec/builder/_select.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_select.py +1666 -0
- sqlspec/builder/_temporal.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_temporal.py +167 -0
- sqlspec/builder/_update.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_update.py +173 -0
- sqlspec/builder/_vector_distance.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_vector_distance.py +330 -0
- sqlspec/cli.py +1095 -0
- sqlspec/config.py +2383 -0
- sqlspec/core/__init__.py +372 -0
- sqlspec/core/_correlation.cp314-win_amd64.pyd +0 -0
- sqlspec/core/_correlation.py +176 -0
- sqlspec/core/_pagination.py +42 -0
- sqlspec/core/_pool.cp314-win_amd64.pyd +0 -0
- sqlspec/core/_pool.py +76 -0
- sqlspec/core/cache.cp314-win_amd64.pyd +0 -0
- sqlspec/core/cache.py +1085 -0
- sqlspec/core/compiler.cp314-win_amd64.pyd +0 -0
- sqlspec/core/compiler.py +1090 -0
- sqlspec/core/config_runtime.cp314-win_amd64.pyd +0 -0
- sqlspec/core/config_runtime.py +174 -0
- sqlspec/core/explain.cp314-win_amd64.pyd +0 -0
- sqlspec/core/explain.py +275 -0
- sqlspec/core/filters.cp314-win_amd64.pyd +0 -0
- sqlspec/core/filters.py +969 -0
- sqlspec/core/hashing.cp314-win_amd64.pyd +0 -0
- sqlspec/core/hashing.py +266 -0
- sqlspec/core/metrics.cp314-win_amd64.pyd +0 -0
- sqlspec/core/metrics.py +83 -0
- sqlspec/core/parameters/__init__.py +72 -0
- sqlspec/core/parameters/_alignment.cp314-win_amd64.pyd +0 -0
- sqlspec/core/parameters/_alignment.py +283 -0
- sqlspec/core/parameters/_converter.cp314-win_amd64.pyd +0 -0
- sqlspec/core/parameters/_converter.py +554 -0
- sqlspec/core/parameters/_processor.cp314-win_amd64.pyd +0 -0
- sqlspec/core/parameters/_processor.py +1182 -0
- sqlspec/core/parameters/_registry.cp314-win_amd64.pyd +0 -0
- sqlspec/core/parameters/_registry.py +206 -0
- sqlspec/core/parameters/_transformers.cp314-win_amd64.pyd +0 -0
- sqlspec/core/parameters/_transformers.py +324 -0
- sqlspec/core/parameters/_types.cp314-win_amd64.pyd +0 -0
- sqlspec/core/parameters/_types.py +536 -0
- sqlspec/core/parameters/_validator.cp314-win_amd64.pyd +0 -0
- sqlspec/core/parameters/_validator.py +171 -0
- sqlspec/core/pipeline.cp314-win_amd64.pyd +0 -0
- sqlspec/core/pipeline.py +333 -0
- sqlspec/core/query_modifiers.cp314-win_amd64.pyd +0 -0
- sqlspec/core/query_modifiers.py +508 -0
- sqlspec/core/result/__init__.py +25 -0
- sqlspec/core/result/_base.cp314-win_amd64.pyd +0 -0
- sqlspec/core/result/_base.py +1232 -0
- sqlspec/core/result/_io.cp314-win_amd64.pyd +0 -0
- sqlspec/core/result/_io.py +28 -0
- sqlspec/core/splitter.cp314-win_amd64.pyd +0 -0
- sqlspec/core/splitter.py +1021 -0
- sqlspec/core/sqlcommenter.cp314-win_amd64.pyd +0 -0
- sqlspec/core/sqlcommenter.py +249 -0
- sqlspec/core/stack.cp314-win_amd64.pyd +0 -0
- sqlspec/core/stack.py +163 -0
- sqlspec/core/statement.cp314-win_amd64.pyd +0 -0
- sqlspec/core/statement.py +1865 -0
- sqlspec/core/type_converter.cp314-win_amd64.pyd +0 -0
- sqlspec/core/type_converter.py +340 -0
- sqlspec/data_dictionary/__init__.py +22 -0
- sqlspec/data_dictionary/_loader.cp314-win_amd64.pyd +0 -0
- sqlspec/data_dictionary/_loader.py +138 -0
- sqlspec/data_dictionary/_registry.cp314-win_amd64.pyd +0 -0
- sqlspec/data_dictionary/_registry.py +74 -0
- sqlspec/data_dictionary/_types.cp314-win_amd64.pyd +0 -0
- sqlspec/data_dictionary/_types.py +121 -0
- sqlspec/data_dictionary/dialects/__init__.py +21 -0
- sqlspec/data_dictionary/dialects/bigquery.cp314-win_amd64.pyd +0 -0
- sqlspec/data_dictionary/dialects/bigquery.py +81 -0
- sqlspec/data_dictionary/dialects/cockroachdb.cp314-win_amd64.pyd +0 -0
- sqlspec/data_dictionary/dialects/cockroachdb.py +54 -0
- sqlspec/data_dictionary/dialects/duckdb.cp314-win_amd64.pyd +0 -0
- sqlspec/data_dictionary/dialects/duckdb.py +47 -0
- sqlspec/data_dictionary/dialects/mysql.cp314-win_amd64.pyd +0 -0
- sqlspec/data_dictionary/dialects/mysql.py +53 -0
- sqlspec/data_dictionary/dialects/oracle.cp314-win_amd64.pyd +0 -0
- sqlspec/data_dictionary/dialects/oracle.py +197 -0
- sqlspec/data_dictionary/dialects/postgres.cp314-win_amd64.pyd +0 -0
- sqlspec/data_dictionary/dialects/postgres.py +69 -0
- sqlspec/data_dictionary/dialects/spanner.cp314-win_amd64.pyd +0 -0
- sqlspec/data_dictionary/dialects/spanner.py +37 -0
- sqlspec/data_dictionary/dialects/sqlite.cp314-win_amd64.pyd +0 -0
- sqlspec/data_dictionary/dialects/sqlite.py +59 -0
- sqlspec/data_dictionary/sql/.gitkeep +0 -0
- sqlspec/data_dictionary/sql/bigquery/columns.sql +23 -0
- sqlspec/data_dictionary/sql/bigquery/foreign_keys.sql +34 -0
- sqlspec/data_dictionary/sql/bigquery/indexes.sql +19 -0
- sqlspec/data_dictionary/sql/bigquery/tables.sql +33 -0
- sqlspec/data_dictionary/sql/bigquery/version.sql +3 -0
- sqlspec/data_dictionary/sql/cockroachdb/columns.sql +34 -0
- sqlspec/data_dictionary/sql/cockroachdb/foreign_keys.sql +40 -0
- sqlspec/data_dictionary/sql/cockroachdb/indexes.sql +32 -0
- sqlspec/data_dictionary/sql/cockroachdb/tables.sql +44 -0
- sqlspec/data_dictionary/sql/cockroachdb/version.sql +3 -0
- sqlspec/data_dictionary/sql/duckdb/columns.sql +23 -0
- sqlspec/data_dictionary/sql/duckdb/foreign_keys.sql +36 -0
- sqlspec/data_dictionary/sql/duckdb/indexes.sql +19 -0
- sqlspec/data_dictionary/sql/duckdb/tables.sql +38 -0
- sqlspec/data_dictionary/sql/duckdb/version.sql +3 -0
- sqlspec/data_dictionary/sql/mysql/columns.sql +23 -0
- sqlspec/data_dictionary/sql/mysql/foreign_keys.sql +28 -0
- sqlspec/data_dictionary/sql/mysql/indexes.sql +26 -0
- sqlspec/data_dictionary/sql/mysql/tables.sql +33 -0
- sqlspec/data_dictionary/sql/mysql/version.sql +3 -0
- sqlspec/data_dictionary/sql/oracle/columns.sql +23 -0
- sqlspec/data_dictionary/sql/oracle/foreign_keys.sql +48 -0
- sqlspec/data_dictionary/sql/oracle/indexes.sql +44 -0
- sqlspec/data_dictionary/sql/oracle/tables.sql +25 -0
- sqlspec/data_dictionary/sql/oracle/version.sql +20 -0
- sqlspec/data_dictionary/sql/postgres/columns.sql +34 -0
- sqlspec/data_dictionary/sql/postgres/foreign_keys.sql +40 -0
- sqlspec/data_dictionary/sql/postgres/indexes.sql +56 -0
- sqlspec/data_dictionary/sql/postgres/tables.sql +44 -0
- sqlspec/data_dictionary/sql/postgres/version.sql +3 -0
- sqlspec/data_dictionary/sql/spanner/columns.sql +23 -0
- sqlspec/data_dictionary/sql/spanner/foreign_keys.sql +70 -0
- sqlspec/data_dictionary/sql/spanner/indexes.sql +30 -0
- sqlspec/data_dictionary/sql/spanner/tables.sql +9 -0
- sqlspec/data_dictionary/sql/spanner/version.sql +3 -0
- sqlspec/data_dictionary/sql/sqlite/columns.sql +23 -0
- sqlspec/data_dictionary/sql/sqlite/foreign_keys.sql +22 -0
- sqlspec/data_dictionary/sql/sqlite/indexes.sql +7 -0
- sqlspec/data_dictionary/sql/sqlite/tables.sql +28 -0
- sqlspec/data_dictionary/sql/sqlite/version.sql +3 -0
- sqlspec/dialects/__init__.py +22 -0
- sqlspec/dialects/_compat.cp314-win_amd64.pyd +0 -0
- sqlspec/dialects/_compat.py +14 -0
- sqlspec/dialects/postgres/__init__.py +9 -0
- sqlspec/dialects/postgres/_generators.cp314-win_amd64.pyd +0 -0
- sqlspec/dialects/postgres/_generators.py +57 -0
- sqlspec/dialects/postgres/_operators.cp314-win_amd64.pyd +0 -0
- sqlspec/dialects/postgres/_operators.py +81 -0
- sqlspec/dialects/postgres/_paradedb.py +50 -0
- sqlspec/dialects/postgres/_pgvector.py +36 -0
- sqlspec/dialects/spanner/__init__.py +6 -0
- sqlspec/dialects/spanner/_generators.cp314-win_amd64.pyd +0 -0
- sqlspec/dialects/spanner/_generators.py +206 -0
- sqlspec/dialects/spanner/_spangres.py +77 -0
- sqlspec/dialects/spanner/_spanner.py +179 -0
- sqlspec/driver/__init__.py +49 -0
- sqlspec/driver/_async.cp314-win_amd64.pyd +0 -0
- sqlspec/driver/_async.py +1830 -0
- sqlspec/driver/_common.cp314-win_amd64.pyd +0 -0
- sqlspec/driver/_common.py +2292 -0
- sqlspec/driver/_exception_handler.cp314-win_amd64.pyd +0 -0
- sqlspec/driver/_exception_handler.py +108 -0
- sqlspec/driver/_query_cache.cp314-win_amd64.pyd +0 -0
- sqlspec/driver/_query_cache.py +96 -0
- sqlspec/driver/_sql_helpers.cp314-win_amd64.pyd +0 -0
- sqlspec/driver/_sql_helpers.py +139 -0
- sqlspec/driver/_storage_helpers.cp314-win_amd64.pyd +0 -0
- sqlspec/driver/_storage_helpers.py +153 -0
- sqlspec/driver/_sync.cp314-win_amd64.pyd +0 -0
- sqlspec/driver/_sync.py +1817 -0
- sqlspec/exceptions.cp314-win_amd64.pyd +0 -0
- sqlspec/exceptions.py +480 -0
- sqlspec/extensions/__init__.py +0 -0
- sqlspec/extensions/adk/__init__.py +84 -0
- sqlspec/extensions/adk/_config_utils.py +199 -0
- sqlspec/extensions/adk/_types.cp314-win_amd64.pyd +0 -0
- sqlspec/extensions/adk/_types.py +41 -0
- sqlspec/extensions/adk/artifact/__init__.py +57 -0
- sqlspec/extensions/adk/artifact/_types.cp314-win_amd64.pyd +0 -0
- sqlspec/extensions/adk/artifact/_types.py +32 -0
- sqlspec/extensions/adk/artifact/service.py +508 -0
- sqlspec/extensions/adk/artifact/store.py +361 -0
- sqlspec/extensions/adk/converters.py +212 -0
- sqlspec/extensions/adk/memory/__init__.py +69 -0
- sqlspec/extensions/adk/memory/_types.cp314-win_amd64.pyd +0 -0
- sqlspec/extensions/adk/memory/_types.py +30 -0
- sqlspec/extensions/adk/memory/converters.py +225 -0
- sqlspec/extensions/adk/memory/service.py +316 -0
- sqlspec/extensions/adk/memory/store.py +525 -0
- sqlspec/extensions/adk/migrations/0001_create_adk_tables.py +184 -0
- sqlspec/extensions/adk/migrations/__init__.py +0 -0
- sqlspec/extensions/adk/service.py +279 -0
- sqlspec/extensions/adk/store.py +590 -0
- sqlspec/extensions/events/__init__.py +51 -0
- sqlspec/extensions/events/_channel.py +703 -0
- sqlspec/extensions/events/_hints.cp314-win_amd64.pyd +0 -0
- sqlspec/extensions/events/_hints.py +45 -0
- sqlspec/extensions/events/_models.py +23 -0
- sqlspec/extensions/events/_payload.cp314-win_amd64.pyd +0 -0
- sqlspec/extensions/events/_payload.py +69 -0
- sqlspec/extensions/events/_protocols.py +134 -0
- sqlspec/extensions/events/_queue.py +462 -0
- sqlspec/extensions/events/_store.py +209 -0
- sqlspec/extensions/events/migrations/0001_create_event_queue.py +59 -0
- sqlspec/extensions/events/migrations/__init__.py +3 -0
- sqlspec/extensions/fastapi/__init__.py +22 -0
- sqlspec/extensions/fastapi/extension.py +391 -0
- sqlspec/extensions/fastapi/providers.cp314-win_amd64.pyd +0 -0
- sqlspec/extensions/fastapi/providers.py +712 -0
- sqlspec/extensions/flask/__init__.py +38 -0
- sqlspec/extensions/flask/_state.py +87 -0
- sqlspec/extensions/flask/_utils.py +71 -0
- sqlspec/extensions/flask/extension.py +539 -0
- sqlspec/extensions/litestar/__init__.py +31 -0
- sqlspec/extensions/litestar/_utils.py +52 -0
- sqlspec/extensions/litestar/channels.py +165 -0
- sqlspec/extensions/litestar/cli.py +102 -0
- sqlspec/extensions/litestar/config.py +90 -0
- sqlspec/extensions/litestar/handlers.py +316 -0
- sqlspec/extensions/litestar/migrations/0001_create_session_table.py +137 -0
- sqlspec/extensions/litestar/migrations/__init__.py +3 -0
- sqlspec/extensions/litestar/plugin.py +1066 -0
- sqlspec/extensions/litestar/providers.cp314-win_amd64.pyd +0 -0
- sqlspec/extensions/litestar/providers.py +784 -0
- sqlspec/extensions/litestar/store.py +298 -0
- sqlspec/extensions/otel/__init__.py +58 -0
- sqlspec/extensions/prometheus/__init__.py +113 -0
- sqlspec/extensions/sanic/__init__.py +19 -0
- sqlspec/extensions/sanic/_state.py +43 -0
- sqlspec/extensions/sanic/_utils.py +127 -0
- sqlspec/extensions/sanic/extension.py +647 -0
- sqlspec/extensions/starlette/__init__.py +22 -0
- sqlspec/extensions/starlette/_state.py +42 -0
- sqlspec/extensions/starlette/_utils.py +96 -0
- sqlspec/extensions/starlette/extension.py +374 -0
- sqlspec/extensions/starlette/middleware.py +281 -0
- sqlspec/loader.cp314-win_amd64.pyd +0 -0
- sqlspec/loader.py +727 -0
- sqlspec/migrations/__init__.py +39 -0
- sqlspec/migrations/base.cp314-win_amd64.pyd +0 -0
- sqlspec/migrations/base.py +862 -0
- sqlspec/migrations/commands.py +2151 -0
- sqlspec/migrations/context.cp314-win_amd64.pyd +0 -0
- sqlspec/migrations/context.py +157 -0
- sqlspec/migrations/fix.cp314-win_amd64.pyd +0 -0
- sqlspec/migrations/fix.py +204 -0
- sqlspec/migrations/loaders.cp314-win_amd64.pyd +0 -0
- sqlspec/migrations/loaders.py +443 -0
- sqlspec/migrations/runner.cp314-win_amd64.pyd +0 -0
- sqlspec/migrations/runner.py +1195 -0
- sqlspec/migrations/squash.cp314-win_amd64.pyd +0 -0
- sqlspec/migrations/squash.py +490 -0
- sqlspec/migrations/templates.cp314-win_amd64.pyd +0 -0
- sqlspec/migrations/templates.py +234 -0
- sqlspec/migrations/tracker.cp314-win_amd64.pyd +0 -0
- sqlspec/migrations/tracker.py +792 -0
- sqlspec/migrations/utils.cp314-win_amd64.pyd +0 -0
- sqlspec/migrations/utils.py +256 -0
- sqlspec/migrations/validation.cp314-win_amd64.pyd +0 -0
- sqlspec/migrations/validation.py +359 -0
- sqlspec/migrations/version.cp314-win_amd64.pyd +0 -0
- sqlspec/migrations/version.py +446 -0
- sqlspec/observability/__init__.py +57 -0
- sqlspec/observability/_common.cp314-win_amd64.pyd +0 -0
- sqlspec/observability/_common.py +77 -0
- sqlspec/observability/_config.cp314-win_amd64.pyd +0 -0
- sqlspec/observability/_config.py +364 -0
- sqlspec/observability/_diagnostics.cp314-win_amd64.pyd +0 -0
- sqlspec/observability/_diagnostics.py +74 -0
- sqlspec/observability/_dispatcher.cp314-win_amd64.pyd +0 -0
- sqlspec/observability/_dispatcher.py +200 -0
- sqlspec/observability/_formatters/__init__.py +13 -0
- sqlspec/observability/_formatters/_aws.cp314-win_amd64.pyd +0 -0
- sqlspec/observability/_formatters/_aws.py +102 -0
- sqlspec/observability/_formatters/_azure.cp314-win_amd64.pyd +0 -0
- sqlspec/observability/_formatters/_azure.py +96 -0
- sqlspec/observability/_formatters/_base.cp314-win_amd64.pyd +0 -0
- sqlspec/observability/_formatters/_base.py +57 -0
- sqlspec/observability/_formatters/_gcp.cp314-win_amd64.pyd +0 -0
- sqlspec/observability/_formatters/_gcp.py +131 -0
- sqlspec/observability/_formatting.py +58 -0
- sqlspec/observability/_observer.cp314-win_amd64.pyd +0 -0
- sqlspec/observability/_observer.py +361 -0
- sqlspec/observability/_runtime.cp314-win_amd64.pyd +0 -0
- sqlspec/observability/_runtime.py +461 -0
- sqlspec/observability/_sampling.cp314-win_amd64.pyd +0 -0
- sqlspec/observability/_sampling.py +188 -0
- sqlspec/observability/_spans.cp314-win_amd64.pyd +0 -0
- sqlspec/observability/_spans.py +161 -0
- sqlspec/protocols.py +955 -0
- sqlspec/py.typed +0 -0
- sqlspec/service.py +433 -0
- sqlspec/storage/__init__.py +48 -0
- sqlspec/storage/_arrow_payload.py +68 -0
- sqlspec/storage/_paths.cp314-win_amd64.pyd +0 -0
- sqlspec/storage/_paths.py +58 -0
- sqlspec/storage/_utils.py +46 -0
- sqlspec/storage/backends/__init__.py +1 -0
- sqlspec/storage/backends/base.cp314-win_amd64.pyd +0 -0
- sqlspec/storage/backends/base.py +374 -0
- sqlspec/storage/backends/fsspec.py +574 -0
- sqlspec/storage/backends/local.py +468 -0
- sqlspec/storage/backends/obstore.py +956 -0
- sqlspec/storage/errors.cp314-win_amd64.pyd +0 -0
- sqlspec/storage/errors.py +102 -0
- sqlspec/storage/pipeline.cp314-win_amd64.pyd +0 -0
- sqlspec/storage/pipeline.py +628 -0
- sqlspec/storage/registry.cp314-win_amd64.pyd +0 -0
- sqlspec/storage/registry.py +329 -0
- sqlspec/typing.py +405 -0
- sqlspec/utils/__init__.py +7 -0
- sqlspec/utils/arrow_helpers.py +384 -0
- sqlspec/utils/config_tools.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/config_tools.py +314 -0
- sqlspec/utils/correlation.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/correlation.py +134 -0
- sqlspec/utils/deprecation.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/deprecation.py +157 -0
- sqlspec/utils/dispatch.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/dispatch.py +101 -0
- sqlspec/utils/fixtures.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/fixtures.py +260 -0
- sqlspec/utils/logging.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/logging.py +251 -0
- sqlspec/utils/module_loader.py +306 -0
- sqlspec/utils/portal.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/portal.py +377 -0
- sqlspec/utils/schema.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/schema.py +1040 -0
- sqlspec/utils/serializers/__init__.py +30 -0
- sqlspec/utils/serializers/_json.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/serializers/_json.py +415 -0
- sqlspec/utils/serializers/_numpy.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/serializers/_numpy.py +65 -0
- sqlspec/utils/serializers/_schema.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/serializers/_schema.py +285 -0
- sqlspec/utils/singleton.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/singleton.py +41 -0
- sqlspec/utils/sync_tools.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/sync_tools.py +316 -0
- sqlspec/utils/text.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/text.py +109 -0
- sqlspec/utils/type_converters.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/type_converters.py +216 -0
- sqlspec/utils/type_guards.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/type_guards.py +1508 -0
- sqlspec/utils/uuids.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/uuids.py +241 -0
- sqlspec-0.47.0.dist-info/METADATA +202 -0
- sqlspec-0.47.0.dist-info/RECORD +621 -0
- sqlspec-0.47.0.dist-info/WHEEL +4 -0
- sqlspec-0.47.0.dist-info/entry_points.txt +6 -0
- sqlspec-0.47.0.dist-info/licenses/LICENSE +21 -0
sqlspec/protocols.py
ADDED
|
@@ -0,0 +1,955 @@
|
|
|
1
|
+
"""Runtime-checkable protocols for type safety and runtime checks.
|
|
2
|
+
|
|
3
|
+
This module provides protocols that can be used for static type checking
|
|
4
|
+
and runtime isinstance() checks.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from typing import TYPE_CHECKING, Any, ClassVar, Protocol, overload, runtime_checkable
|
|
8
|
+
|
|
9
|
+
from typing_extensions import Self
|
|
10
|
+
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
|
+
from collections.abc import AsyncIterator, Callable, Iterator, Mapping, Sequence
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
|
|
15
|
+
from sqlglot import exp
|
|
16
|
+
from sqlglot.dialects.dialect import DialectType
|
|
17
|
+
|
|
18
|
+
from sqlspec.config import ExtensionConfigs
|
|
19
|
+
from sqlspec.core import StatementConfig
|
|
20
|
+
from sqlspec.typing import (
|
|
21
|
+
ArrowRecordBatch,
|
|
22
|
+
ArrowTable,
|
|
23
|
+
ColumnMetadata,
|
|
24
|
+
ForeignKeyMetadata,
|
|
25
|
+
IndexMetadata,
|
|
26
|
+
TableMetadata,
|
|
27
|
+
VersionInfo,
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
__all__ = (
|
|
31
|
+
"ArrowTableStatsProtocol",
|
|
32
|
+
"AsyncDataDictionaryProtocol",
|
|
33
|
+
"AsyncDeleteProtocol",
|
|
34
|
+
"AsyncReadBytesProtocol",
|
|
35
|
+
"AsyncReadableProtocol",
|
|
36
|
+
"AsyncWriteBytesProtocol",
|
|
37
|
+
"CursorMetadataProtocol",
|
|
38
|
+
"DictProtocol",
|
|
39
|
+
"HasAddListenerProtocol",
|
|
40
|
+
"HasAsDictProtocol",
|
|
41
|
+
"HasConfigProtocol",
|
|
42
|
+
"HasConnectionConfigProtocol",
|
|
43
|
+
"HasDataProtocol",
|
|
44
|
+
"HasDatabaseUrlAndBindKeyProtocol",
|
|
45
|
+
"HasErrorsProtocol",
|
|
46
|
+
"HasExecuteProtocol",
|
|
47
|
+
"HasExpressionAndParametersProtocol",
|
|
48
|
+
"HasExpressionAndSQLProtocol",
|
|
49
|
+
"HasExpressionProtocol",
|
|
50
|
+
"HasExtensionConfigProtocol",
|
|
51
|
+
"HasFieldNameProtocol",
|
|
52
|
+
"HasFilterAttributesProtocol",
|
|
53
|
+
"HasGetDataProtocol",
|
|
54
|
+
"HasLastRowIdProtocol",
|
|
55
|
+
"HasMigrationConfigProtocol",
|
|
56
|
+
"HasNameProtocol",
|
|
57
|
+
"HasNotifiesProtocol",
|
|
58
|
+
"HasParameterBuilderProtocol",
|
|
59
|
+
"HasRowcountProtocol",
|
|
60
|
+
"HasSQLGlotExpressionProtocol",
|
|
61
|
+
"HasSqlStateProtocol",
|
|
62
|
+
"HasSqliteErrorProtocol",
|
|
63
|
+
"HasStatementConfigFactoryProtocol",
|
|
64
|
+
"HasStatementConfigProtocol",
|
|
65
|
+
"HasStatementTypeProtocol",
|
|
66
|
+
"HasTracerProviderProtocol",
|
|
67
|
+
"HasTypeCodeProtocol",
|
|
68
|
+
"HasTypecodeProtocol",
|
|
69
|
+
"HasTypecodeSizedProtocol",
|
|
70
|
+
"HasValueProtocol",
|
|
71
|
+
"HasWhereProtocol",
|
|
72
|
+
"MappingLikeProtocol",
|
|
73
|
+
"NotificationProtocol",
|
|
74
|
+
"ObjectStoreProtocol",
|
|
75
|
+
"PipelineCapableProtocol",
|
|
76
|
+
"QueryResultProtocol",
|
|
77
|
+
"ReadableProtocol",
|
|
78
|
+
"SQLBuilderProtocol",
|
|
79
|
+
"SpanAttributeProtocol",
|
|
80
|
+
"SpannerParamTypesProtocol",
|
|
81
|
+
"StatementProtocol",
|
|
82
|
+
"SupportsArrayProtocol",
|
|
83
|
+
"SupportsArrowResults",
|
|
84
|
+
"SupportsCloseProtocol",
|
|
85
|
+
"SupportsDtypeStrProtocol",
|
|
86
|
+
"SupportsJsonTypeProtocol",
|
|
87
|
+
"SyncDataDictionaryProtocol",
|
|
88
|
+
"WithMethodProtocol",
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
@runtime_checkable
|
|
93
|
+
class ReadableProtocol(Protocol):
|
|
94
|
+
"""Protocol for objects that have a read method (e.g., LOBs)."""
|
|
95
|
+
|
|
96
|
+
def read(self, size: "int | None" = None) -> "bytes | str":
|
|
97
|
+
"""Read content from the object."""
|
|
98
|
+
...
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
@runtime_checkable
|
|
102
|
+
class AsyncReadableProtocol(Protocol):
|
|
103
|
+
"""Protocol for objects that have an async read method."""
|
|
104
|
+
|
|
105
|
+
async def read(self, size: "int | None" = None) -> "bytes | str":
|
|
106
|
+
"""Read content from the object."""
|
|
107
|
+
...
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
@runtime_checkable
|
|
111
|
+
class SupportsArrayProtocol(Protocol):
|
|
112
|
+
"""Protocol for NumPy-like arrays."""
|
|
113
|
+
|
|
114
|
+
dtype: Any
|
|
115
|
+
shape: tuple[int, ...]
|
|
116
|
+
__array__: Any
|
|
117
|
+
|
|
118
|
+
def __len__(self) -> int:
|
|
119
|
+
"""Return the length of the array."""
|
|
120
|
+
...
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
@runtime_checkable
|
|
124
|
+
class CursorMetadataProtocol(Protocol):
|
|
125
|
+
"""Protocol for cursor metadata access."""
|
|
126
|
+
|
|
127
|
+
@property
|
|
128
|
+
def description(self) -> "Sequence[Any] | None": ...
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
@runtime_checkable
|
|
132
|
+
class NotificationProtocol(Protocol):
|
|
133
|
+
"""Protocol for database event notifications."""
|
|
134
|
+
|
|
135
|
+
channel: str
|
|
136
|
+
payload: str
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
@runtime_checkable
|
|
140
|
+
class QueryResultProtocol(Protocol):
|
|
141
|
+
"""Protocol for query execution results."""
|
|
142
|
+
|
|
143
|
+
tag: "str | None"
|
|
144
|
+
status: "str | None"
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
@runtime_checkable
|
|
148
|
+
class HasStatementConfigProtocol(Protocol):
|
|
149
|
+
"""Protocol for objects holding statement configuration."""
|
|
150
|
+
|
|
151
|
+
statement_config: "StatementConfig"
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
@runtime_checkable
|
|
155
|
+
class PipelineCapableProtocol(Protocol):
|
|
156
|
+
"""Protocol for connections supporting pipeline execution."""
|
|
157
|
+
|
|
158
|
+
def run_pipeline(self, pipeline: Any, *, continue_on_error: bool = False) -> Any: ...
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
@runtime_checkable
|
|
162
|
+
class HasStatementTypeProtocol(Protocol):
|
|
163
|
+
"""Protocol for cursors exposing statement_type metadata."""
|
|
164
|
+
|
|
165
|
+
statement_type: "str | None"
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
@runtime_checkable
|
|
169
|
+
class HasTypecodeProtocol(Protocol):
|
|
170
|
+
"""Protocol for array-like objects exposing typecode."""
|
|
171
|
+
|
|
172
|
+
typecode: Any
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
@runtime_checkable
|
|
176
|
+
class HasTypecodeSizedProtocol(Protocol):
|
|
177
|
+
"""Protocol for array-like objects exposing typecode and length."""
|
|
178
|
+
|
|
179
|
+
typecode: Any
|
|
180
|
+
|
|
181
|
+
def __len__(self) -> int:
|
|
182
|
+
"""Return the length of the array-like object."""
|
|
183
|
+
...
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
@runtime_checkable
|
|
187
|
+
class HasTypeCodeProtocol(Protocol):
|
|
188
|
+
"""Protocol for objects exposing type_code metadata."""
|
|
189
|
+
|
|
190
|
+
type_code: Any
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
@runtime_checkable
|
|
194
|
+
class HasRowcountProtocol(Protocol):
|
|
195
|
+
"""Protocol for cursors exposing rowcount metadata."""
|
|
196
|
+
|
|
197
|
+
rowcount: int
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
@runtime_checkable
|
|
201
|
+
class HasLastRowIdProtocol(Protocol):
|
|
202
|
+
"""Protocol for cursors exposing lastrowid metadata."""
|
|
203
|
+
|
|
204
|
+
lastrowid: int | None
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
@runtime_checkable
|
|
208
|
+
class HasSqlStateProtocol(Protocol):
|
|
209
|
+
"""Protocol for exceptions exposing sqlstate."""
|
|
210
|
+
|
|
211
|
+
sqlstate: "str | None"
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
@runtime_checkable
|
|
215
|
+
class HasSqliteErrorProtocol(Protocol):
|
|
216
|
+
"""Protocol for sqlite errors exposing sqlite error details."""
|
|
217
|
+
|
|
218
|
+
sqlite_errorcode: "int | None"
|
|
219
|
+
sqlite_errorname: "str | None"
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
@runtime_checkable
|
|
223
|
+
class HasValueProtocol(Protocol):
|
|
224
|
+
"""Protocol for wrapper objects exposing a value attribute."""
|
|
225
|
+
|
|
226
|
+
value: Any
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
@runtime_checkable
|
|
230
|
+
class HasErrorsProtocol(Protocol):
|
|
231
|
+
"""Protocol for exceptions exposing structured errors."""
|
|
232
|
+
|
|
233
|
+
errors: "list[dict[str, Any]] | None"
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
@runtime_checkable
|
|
237
|
+
class HasDataProtocol(Protocol):
|
|
238
|
+
"""Protocol for results exposing a data attribute."""
|
|
239
|
+
|
|
240
|
+
data: "Sequence[object] | None"
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
@runtime_checkable
|
|
244
|
+
class HasExecuteProtocol(Protocol):
|
|
245
|
+
"""Protocol for drivers exposing execute method returning data results."""
|
|
246
|
+
|
|
247
|
+
def execute(self, sql: str, *parameters: object, **kwargs: object) -> "HasDataProtocol": ...
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
@runtime_checkable
|
|
251
|
+
class HasNameProtocol(Protocol):
|
|
252
|
+
"""Protocol for objects exposing a __name__ attribute."""
|
|
253
|
+
|
|
254
|
+
__name__: str
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
@runtime_checkable
|
|
258
|
+
class HasNotifiesProtocol(Protocol):
|
|
259
|
+
"""Protocol for asyncpg-like connections exposing notifications."""
|
|
260
|
+
|
|
261
|
+
notifies: Any
|
|
262
|
+
|
|
263
|
+
async def execute(self, query: str, *args: Any, **kwargs: Any) -> Any:
|
|
264
|
+
"""Execute a SQL command on the connection."""
|
|
265
|
+
...
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
@runtime_checkable
|
|
269
|
+
class HasAddListenerProtocol(Protocol):
|
|
270
|
+
"""Protocol for asyncpg-like connections exposing add_listener."""
|
|
271
|
+
|
|
272
|
+
def add_listener(self, channel: str, callback: Any) -> Any: ...
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
@runtime_checkable
|
|
276
|
+
class SupportsJsonTypeProtocol(Protocol):
|
|
277
|
+
"""Protocol for parameter type modules exposing JSON."""
|
|
278
|
+
|
|
279
|
+
JSON: Any
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
@runtime_checkable
|
|
283
|
+
class SpannerParamTypesProtocol(SupportsJsonTypeProtocol, Protocol):
|
|
284
|
+
"""Protocol for Google Spanner param_types module."""
|
|
285
|
+
|
|
286
|
+
BOOL: Any
|
|
287
|
+
INT64: Any
|
|
288
|
+
FLOAT64: Any
|
|
289
|
+
STRING: Any
|
|
290
|
+
BYTES: Any
|
|
291
|
+
TIMESTAMP: Any
|
|
292
|
+
DATE: Any
|
|
293
|
+
Array: "Callable[[Any], Any]"
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
@runtime_checkable
|
|
297
|
+
class SupportsCloseProtocol(Protocol):
|
|
298
|
+
"""Protocol for objects exposing close()."""
|
|
299
|
+
|
|
300
|
+
def close(self) -> None: ...
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
@runtime_checkable
|
|
304
|
+
class SupportsDtypeStrProtocol(Protocol):
|
|
305
|
+
"""Protocol for dtype objects exposing string descriptor."""
|
|
306
|
+
|
|
307
|
+
str: str
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
@runtime_checkable
|
|
311
|
+
class ArrowTableStatsProtocol(Protocol):
|
|
312
|
+
"""Protocol for Arrow objects exposing row and byte counts."""
|
|
313
|
+
|
|
314
|
+
num_rows: int
|
|
315
|
+
nbytes: int
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
@runtime_checkable
|
|
319
|
+
class SpanAttributeProtocol(Protocol):
|
|
320
|
+
"""Protocol for span objects supporting attribute mutation."""
|
|
321
|
+
|
|
322
|
+
def set_attribute(self, key: str, value: Any) -> None: ...
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
@runtime_checkable
|
|
326
|
+
class HasTracerProviderProtocol(Protocol):
|
|
327
|
+
"""Protocol for tracer providers exposing get_tracer."""
|
|
328
|
+
|
|
329
|
+
def get_tracer(self, name: str) -> Any: ...
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
@runtime_checkable
|
|
333
|
+
class AsyncReadBytesProtocol(Protocol):
|
|
334
|
+
"""Protocol for async read_bytes support."""
|
|
335
|
+
|
|
336
|
+
async def read_bytes_async(self, path: "str | Path", **kwargs: Any) -> bytes: ...
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
@runtime_checkable
|
|
340
|
+
class AsyncWriteBytesProtocol(Protocol):
|
|
341
|
+
"""Protocol for async write_bytes support."""
|
|
342
|
+
|
|
343
|
+
async def write_bytes_async(self, path: "str | Path", data: bytes, **kwargs: Any) -> None: ...
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
@runtime_checkable
|
|
347
|
+
class AsyncDeleteProtocol(Protocol):
|
|
348
|
+
"""Protocol for async delete support."""
|
|
349
|
+
|
|
350
|
+
async def delete_async(self, path: "str | Path", **kwargs: Any) -> None: ...
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
@runtime_checkable
|
|
354
|
+
class StatementProtocol(Protocol):
|
|
355
|
+
"""Protocol for statement attribute access."""
|
|
356
|
+
|
|
357
|
+
@property
|
|
358
|
+
def raw_sql(self) -> "str | None": ...
|
|
359
|
+
|
|
360
|
+
@property
|
|
361
|
+
def sql(self) -> str: ...
|
|
362
|
+
|
|
363
|
+
@property
|
|
364
|
+
def operation_type(self) -> str: ...
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
@runtime_checkable
|
|
368
|
+
class WithMethodProtocol(Protocol):
|
|
369
|
+
"""Protocol for objects with a with_ method (SQLGlot expressions)."""
|
|
370
|
+
|
|
371
|
+
def with_(self, *args: Any, **kwargs: Any) -> Any:
|
|
372
|
+
"""Add WITH clause to expression."""
|
|
373
|
+
...
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
@runtime_checkable
|
|
377
|
+
class HasWhereProtocol(Protocol):
|
|
378
|
+
"""Protocol for SQL expressions that support WHERE clauses."""
|
|
379
|
+
|
|
380
|
+
def where(self, *args: Any, **kwargs: Any) -> Any:
|
|
381
|
+
"""Add WHERE clause to expression."""
|
|
382
|
+
...
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
@runtime_checkable
|
|
386
|
+
class DictProtocol(Protocol):
|
|
387
|
+
"""Protocol for objects with a __dict__ attribute."""
|
|
388
|
+
|
|
389
|
+
__dict__: dict[str, Any]
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
@runtime_checkable
|
|
393
|
+
class MappingLikeProtocol(Protocol):
|
|
394
|
+
"""Protocol for objects that can be converted to dict via dict() constructor.
|
|
395
|
+
|
|
396
|
+
This matches database row types like sqlite3.Row, asyncpg.Record, psycopg.Row
|
|
397
|
+
that support dictionary-like access with keys() method.
|
|
398
|
+
"""
|
|
399
|
+
|
|
400
|
+
def keys(self) -> "Iterator[str]":
|
|
401
|
+
"""Return an iterator over the keys."""
|
|
402
|
+
...
|
|
403
|
+
|
|
404
|
+
def __getitem__(self, key: str) -> Any:
|
|
405
|
+
"""Get item by key."""
|
|
406
|
+
...
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
@runtime_checkable
|
|
410
|
+
class HasAsDictProtocol(Protocol):
|
|
411
|
+
"""Protocol for objects with _asdict() method (e.g., NamedTuple).
|
|
412
|
+
|
|
413
|
+
Used for row types that don't support dict() constructor directly
|
|
414
|
+
but can be converted via _asdict() method.
|
|
415
|
+
"""
|
|
416
|
+
|
|
417
|
+
def _asdict(self) -> "dict[str, Any]":
|
|
418
|
+
"""Convert to dictionary."""
|
|
419
|
+
...
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
@runtime_checkable
|
|
423
|
+
class HasConfigProtocol(Protocol):
|
|
424
|
+
"""Protocol for wrapper objects exposing a config attribute."""
|
|
425
|
+
|
|
426
|
+
config: Any
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
@runtime_checkable
|
|
430
|
+
class HasConnectionConfigProtocol(Protocol):
|
|
431
|
+
"""Protocol for configs exposing connection_config mapping."""
|
|
432
|
+
|
|
433
|
+
connection_config: "Mapping[str, object]"
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
@runtime_checkable
|
|
437
|
+
class HasDatabaseUrlAndBindKeyProtocol(Protocol):
|
|
438
|
+
"""Protocol for configs exposing database_url and bind_key."""
|
|
439
|
+
|
|
440
|
+
database_url: str
|
|
441
|
+
bind_key: "str | None"
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
@runtime_checkable
|
|
445
|
+
class HasExtensionConfigProtocol(Protocol):
|
|
446
|
+
"""Protocol for configs exposing extension_config mapping."""
|
|
447
|
+
|
|
448
|
+
@property
|
|
449
|
+
def extension_config(self) -> "ExtensionConfigs":
|
|
450
|
+
"""Return extension configuration mapping."""
|
|
451
|
+
...
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
@runtime_checkable
|
|
455
|
+
class HasFieldNameProtocol(Protocol):
|
|
456
|
+
"""Protocol for objects exposing field_name attribute."""
|
|
457
|
+
|
|
458
|
+
field_name: Any
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
@runtime_checkable
|
|
462
|
+
class HasFilterAttributesProtocol(Protocol):
|
|
463
|
+
"""Protocol for filter-like objects exposing field attributes."""
|
|
464
|
+
|
|
465
|
+
field_name: Any
|
|
466
|
+
operation: Any
|
|
467
|
+
value: Any
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
@runtime_checkable
|
|
471
|
+
class HasGetDataProtocol(Protocol):
|
|
472
|
+
"""Protocol for results exposing get_data()."""
|
|
473
|
+
|
|
474
|
+
def get_data(self) -> Any: ...
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
@runtime_checkable
|
|
478
|
+
class ObjectStoreProtocol(Protocol):
|
|
479
|
+
"""Protocol for object storage operations.
|
|
480
|
+
|
|
481
|
+
All synchronous methods use the `*_sync` suffix for consistency with async methods.
|
|
482
|
+
"""
|
|
483
|
+
|
|
484
|
+
protocol: str
|
|
485
|
+
backend_type: ClassVar[str]
|
|
486
|
+
|
|
487
|
+
def __init__(self, uri: str, **kwargs: Any) -> None:
|
|
488
|
+
return
|
|
489
|
+
|
|
490
|
+
def read_bytes_sync(self, path: "str | Path", **kwargs: Any) -> bytes:
|
|
491
|
+
"""Read bytes from an object synchronously."""
|
|
492
|
+
return b""
|
|
493
|
+
|
|
494
|
+
def write_bytes_sync(self, path: "str | Path", data: bytes, **kwargs: Any) -> None:
|
|
495
|
+
"""Write bytes to an object synchronously."""
|
|
496
|
+
return
|
|
497
|
+
|
|
498
|
+
def read_text_sync(self, path: "str | Path", encoding: str = "utf-8", **kwargs: Any) -> str:
|
|
499
|
+
"""Read text from an object synchronously."""
|
|
500
|
+
return ""
|
|
501
|
+
|
|
502
|
+
def write_text_sync(self, path: "str | Path", data: str, encoding: str = "utf-8", **kwargs: Any) -> None:
|
|
503
|
+
"""Write text to an object synchronously."""
|
|
504
|
+
return
|
|
505
|
+
|
|
506
|
+
def exists_sync(self, path: "str | Path", **kwargs: Any) -> bool:
|
|
507
|
+
"""Check if an object exists synchronously."""
|
|
508
|
+
return False
|
|
509
|
+
|
|
510
|
+
def delete_sync(self, path: "str | Path", **kwargs: Any) -> None:
|
|
511
|
+
"""Delete an object synchronously."""
|
|
512
|
+
return
|
|
513
|
+
|
|
514
|
+
def copy_sync(self, source: "str | Path", destination: "str | Path", **kwargs: Any) -> None:
|
|
515
|
+
"""Copy an object synchronously."""
|
|
516
|
+
return
|
|
517
|
+
|
|
518
|
+
def move_sync(self, source: "str | Path", destination: "str | Path", **kwargs: Any) -> None:
|
|
519
|
+
"""Move an object synchronously."""
|
|
520
|
+
return
|
|
521
|
+
|
|
522
|
+
def list_objects_sync(self, prefix: str = "", recursive: bool = True, **kwargs: Any) -> list[str]:
|
|
523
|
+
"""List objects with optional prefix synchronously."""
|
|
524
|
+
return []
|
|
525
|
+
|
|
526
|
+
def glob_sync(self, pattern: str, **kwargs: Any) -> list[str]:
|
|
527
|
+
"""Find objects matching a glob pattern synchronously."""
|
|
528
|
+
return []
|
|
529
|
+
|
|
530
|
+
def is_object_sync(self, path: "str | Path") -> bool:
|
|
531
|
+
"""Check if path points to an object synchronously."""
|
|
532
|
+
return False
|
|
533
|
+
|
|
534
|
+
def is_path_sync(self, path: "str | Path") -> bool:
|
|
535
|
+
"""Check if path points to a prefix (directory-like) synchronously."""
|
|
536
|
+
return False
|
|
537
|
+
|
|
538
|
+
def get_metadata_sync(self, path: "str | Path", **kwargs: Any) -> dict[str, object]:
|
|
539
|
+
"""Get object metadata synchronously."""
|
|
540
|
+
return {}
|
|
541
|
+
|
|
542
|
+
def read_arrow_sync(self, path: "str | Path", **kwargs: Any) -> "ArrowTable":
|
|
543
|
+
"""Read an Arrow table from storage synchronously."""
|
|
544
|
+
msg = "Arrow reading not implemented"
|
|
545
|
+
raise NotImplementedError(msg)
|
|
546
|
+
|
|
547
|
+
def write_arrow_sync(self, path: "str | Path", table: "ArrowTable", **kwargs: Any) -> None:
|
|
548
|
+
"""Write an Arrow table to storage synchronously."""
|
|
549
|
+
msg = "Arrow writing not implemented"
|
|
550
|
+
raise NotImplementedError(msg)
|
|
551
|
+
|
|
552
|
+
def stream_arrow_sync(self, pattern: str, **kwargs: Any) -> "Iterator[ArrowRecordBatch]":
|
|
553
|
+
"""Stream Arrow record batches from matching objects synchronously."""
|
|
554
|
+
msg = "Arrow streaming not implemented"
|
|
555
|
+
raise NotImplementedError(msg)
|
|
556
|
+
|
|
557
|
+
def stream_read_sync(self, path: "str | Path", chunk_size: "int | None" = None, **kwargs: Any) -> "Iterator[bytes]":
|
|
558
|
+
"""Stream bytes from an object synchronously."""
|
|
559
|
+
msg = "Stream reading not implemented"
|
|
560
|
+
raise NotImplementedError(msg)
|
|
561
|
+
|
|
562
|
+
async def read_bytes_async(self, path: "str | Path", **kwargs: Any) -> bytes:
|
|
563
|
+
"""Async read bytes from an object."""
|
|
564
|
+
msg = "Async operations not implemented"
|
|
565
|
+
raise NotImplementedError(msg)
|
|
566
|
+
|
|
567
|
+
async def write_bytes_async(self, path: "str | Path", data: bytes, **kwargs: Any) -> None:
|
|
568
|
+
"""Async write bytes to an object."""
|
|
569
|
+
msg = "Async operations not implemented"
|
|
570
|
+
raise NotImplementedError(msg)
|
|
571
|
+
|
|
572
|
+
async def read_text_async(self, path: "str | Path", encoding: str = "utf-8", **kwargs: Any) -> str:
|
|
573
|
+
"""Async read text from an object."""
|
|
574
|
+
msg = "Async operations not implemented"
|
|
575
|
+
raise NotImplementedError(msg)
|
|
576
|
+
|
|
577
|
+
async def write_text_async(self, path: "str | Path", data: str, encoding: str = "utf-8", **kwargs: Any) -> None:
|
|
578
|
+
"""Async write text to an object."""
|
|
579
|
+
msg = "Async operations not implemented"
|
|
580
|
+
raise NotImplementedError(msg)
|
|
581
|
+
|
|
582
|
+
async def stream_read_async(
|
|
583
|
+
self, path: "str | Path", chunk_size: "int | None" = None, **kwargs: Any
|
|
584
|
+
) -> "AsyncIterator[bytes]":
|
|
585
|
+
"""Stream bytes from an object asynchronously."""
|
|
586
|
+
msg = "Async stream reading not implemented"
|
|
587
|
+
raise NotImplementedError(msg)
|
|
588
|
+
|
|
589
|
+
async def exists_async(self, path: "str | Path", **kwargs: Any) -> bool:
|
|
590
|
+
"""Async check if an object exists."""
|
|
591
|
+
msg = "Async operations not implemented"
|
|
592
|
+
raise NotImplementedError(msg)
|
|
593
|
+
|
|
594
|
+
async def delete_async(self, path: "str | Path", **kwargs: Any) -> None:
|
|
595
|
+
"""Async delete an object."""
|
|
596
|
+
msg = "Async operations not implemented"
|
|
597
|
+
raise NotImplementedError(msg)
|
|
598
|
+
|
|
599
|
+
async def list_objects_async(self, prefix: str = "", recursive: bool = True, **kwargs: Any) -> list[str]:
|
|
600
|
+
"""Async list objects with optional prefix."""
|
|
601
|
+
msg = "Async operations not implemented"
|
|
602
|
+
raise NotImplementedError(msg)
|
|
603
|
+
|
|
604
|
+
async def copy_async(self, source: "str | Path", destination: "str | Path", **kwargs: Any) -> None:
|
|
605
|
+
"""Async copy an object."""
|
|
606
|
+
msg = "Async operations not implemented"
|
|
607
|
+
raise NotImplementedError(msg)
|
|
608
|
+
|
|
609
|
+
async def move_async(self, source: "str | Path", destination: "str | Path", **kwargs: Any) -> None:
|
|
610
|
+
"""Async move an object."""
|
|
611
|
+
msg = "Async operations not implemented"
|
|
612
|
+
raise NotImplementedError(msg)
|
|
613
|
+
|
|
614
|
+
async def get_metadata_async(self, path: "str | Path", **kwargs: Any) -> dict[str, object]:
|
|
615
|
+
"""Async get object metadata."""
|
|
616
|
+
msg = "Async operations not implemented"
|
|
617
|
+
raise NotImplementedError(msg)
|
|
618
|
+
|
|
619
|
+
async def read_arrow_async(self, path: "str | Path", **kwargs: Any) -> "ArrowTable":
|
|
620
|
+
"""Async read an Arrow table from storage."""
|
|
621
|
+
msg = "Async arrow reading not implemented"
|
|
622
|
+
raise NotImplementedError(msg)
|
|
623
|
+
|
|
624
|
+
async def write_arrow_async(self, path: "str | Path", table: "ArrowTable", **kwargs: Any) -> None:
|
|
625
|
+
"""Async write an Arrow table to storage."""
|
|
626
|
+
msg = "Async arrow writing not implemented"
|
|
627
|
+
raise NotImplementedError(msg)
|
|
628
|
+
|
|
629
|
+
def stream_arrow_async(self, pattern: str, **kwargs: Any) -> "AsyncIterator[ArrowRecordBatch]":
|
|
630
|
+
"""Async stream Arrow record batches from matching objects."""
|
|
631
|
+
msg = "Async arrow streaming not implemented"
|
|
632
|
+
raise NotImplementedError(msg)
|
|
633
|
+
|
|
634
|
+
@property
|
|
635
|
+
def supports_signing(self) -> bool:
|
|
636
|
+
"""Whether this backend supports URL signing.
|
|
637
|
+
|
|
638
|
+
Returns:
|
|
639
|
+
True if the backend supports generating signed URLs, False otherwise.
|
|
640
|
+
Only S3, GCS, and Azure backends via obstore support signing.
|
|
641
|
+
"""
|
|
642
|
+
return False
|
|
643
|
+
|
|
644
|
+
@overload
|
|
645
|
+
def sign_sync(self, paths: str, expires_in: int = 3600, for_upload: bool = False) -> str: ...
|
|
646
|
+
|
|
647
|
+
@overload
|
|
648
|
+
def sign_sync(self, paths: list[str], expires_in: int = 3600, for_upload: bool = False) -> list[str]: ...
|
|
649
|
+
|
|
650
|
+
def sign_sync(
|
|
651
|
+
self, paths: "str | list[str]", expires_in: int = 3600, for_upload: bool = False
|
|
652
|
+
) -> "str | list[str]":
|
|
653
|
+
"""Generate signed URL(s) for object(s).
|
|
654
|
+
|
|
655
|
+
Args:
|
|
656
|
+
paths: Single object path or list of paths to sign.
|
|
657
|
+
expires_in: URL expiration time in seconds (default: 3600, max: 604800 = 7 days).
|
|
658
|
+
for_upload: Whether the URL is for upload (PUT) vs download (GET).
|
|
659
|
+
|
|
660
|
+
Returns:
|
|
661
|
+
Single signed URL string if paths is a string, or list of signed URLs
|
|
662
|
+
if paths is a list. Preserves input type for convenience.
|
|
663
|
+
|
|
664
|
+
Raises:
|
|
665
|
+
NotImplementedError: If the backend does not support URL signing.
|
|
666
|
+
"""
|
|
667
|
+
msg = "URL signing not supported by this backend"
|
|
668
|
+
raise NotImplementedError(msg)
|
|
669
|
+
|
|
670
|
+
@overload
|
|
671
|
+
async def sign_async(self, paths: str, expires_in: int = 3600, for_upload: bool = False) -> str: ...
|
|
672
|
+
|
|
673
|
+
@overload
|
|
674
|
+
async def sign_async(self, paths: list[str], expires_in: int = 3600, for_upload: bool = False) -> list[str]: ...
|
|
675
|
+
|
|
676
|
+
async def sign_async(
|
|
677
|
+
self, paths: "str | list[str]", expires_in: int = 3600, for_upload: bool = False
|
|
678
|
+
) -> "str | list[str]":
|
|
679
|
+
"""Generate signed URL(s) asynchronously.
|
|
680
|
+
|
|
681
|
+
Args:
|
|
682
|
+
paths: Single object path or list of paths to sign.
|
|
683
|
+
expires_in: URL expiration time in seconds (default: 3600, max: 604800 = 7 days).
|
|
684
|
+
for_upload: Whether the URL is for upload (PUT) vs download (GET).
|
|
685
|
+
|
|
686
|
+
Returns:
|
|
687
|
+
Single signed URL string if paths is a string, or list of signed URLs
|
|
688
|
+
if paths is a list. Preserves input type for convenience.
|
|
689
|
+
|
|
690
|
+
Raises:
|
|
691
|
+
NotImplementedError: If the backend does not support URL signing.
|
|
692
|
+
"""
|
|
693
|
+
msg = "URL signing not supported by this backend"
|
|
694
|
+
raise NotImplementedError(msg)
|
|
695
|
+
|
|
696
|
+
|
|
697
|
+
@runtime_checkable
|
|
698
|
+
class HasSQLGlotExpressionProtocol(Protocol):
|
|
699
|
+
"""Protocol for objects with a sqlglot_expression property."""
|
|
700
|
+
|
|
701
|
+
@property
|
|
702
|
+
def sqlglot_expression(self) -> "exp.Expr | None":
|
|
703
|
+
"""Return the SQLGlot expression for this object."""
|
|
704
|
+
...
|
|
705
|
+
|
|
706
|
+
|
|
707
|
+
@runtime_checkable
|
|
708
|
+
class HasParameterBuilderProtocol(Protocol):
|
|
709
|
+
"""Protocol for objects that can add parameters and build queries."""
|
|
710
|
+
|
|
711
|
+
@property
|
|
712
|
+
def parameters(self) -> dict[str, Any]:
|
|
713
|
+
"""Return the current parameters dictionary."""
|
|
714
|
+
...
|
|
715
|
+
|
|
716
|
+
def add_parameter(self, value: Any, name: "str | None" = None) -> tuple[Any, str]:
|
|
717
|
+
"""Add a parameter to the builder."""
|
|
718
|
+
...
|
|
719
|
+
|
|
720
|
+
def generate_unique_parameter_name(self, base_name: str) -> str:
|
|
721
|
+
"""Generate a unique public parameter name."""
|
|
722
|
+
...
|
|
723
|
+
|
|
724
|
+
def get_expression(self) -> "exp.Expr | None":
|
|
725
|
+
"""Return the underlying SQLGlot expression."""
|
|
726
|
+
...
|
|
727
|
+
|
|
728
|
+
def set_expression(self, expression: "exp.Expr") -> None:
|
|
729
|
+
"""Replace the underlying SQLGlot expression."""
|
|
730
|
+
...
|
|
731
|
+
|
|
732
|
+
def build(self, dialect: Any = None) -> Any:
|
|
733
|
+
"""Build the SQL query and return a BuiltQuery-like object."""
|
|
734
|
+
...
|
|
735
|
+
|
|
736
|
+
|
|
737
|
+
@runtime_checkable
|
|
738
|
+
class HasExpressionProtocol(Protocol):
|
|
739
|
+
"""Protocol for objects with an _expression attribute."""
|
|
740
|
+
|
|
741
|
+
_expression: "exp.Expr | None"
|
|
742
|
+
|
|
743
|
+
|
|
744
|
+
@runtime_checkable
|
|
745
|
+
class SQLBuilderProtocol(Protocol):
|
|
746
|
+
"""Protocol for SQL query builders."""
|
|
747
|
+
|
|
748
|
+
_expression: "exp.Expr | None"
|
|
749
|
+
_parameters: dict[str, Any]
|
|
750
|
+
_parameter_counter: int
|
|
751
|
+
_parameter_name_counters: dict[str, int]
|
|
752
|
+
_columns: Any # Optional attribute for some builders
|
|
753
|
+
_with_ctes: Any # Optional attribute for some builders
|
|
754
|
+
dialect: Any
|
|
755
|
+
dialect_name: "str | None"
|
|
756
|
+
|
|
757
|
+
@property
|
|
758
|
+
def parameters(self) -> dict[str, Any]:
|
|
759
|
+
"""Public access to query parameters."""
|
|
760
|
+
...
|
|
761
|
+
|
|
762
|
+
def get_expression(self) -> "exp.Expr | None":
|
|
763
|
+
"""Return the current SQLGlot expression."""
|
|
764
|
+
...
|
|
765
|
+
|
|
766
|
+
def add_parameter(self, value: Any, name: "str | None" = None) -> tuple[Any, str]:
|
|
767
|
+
"""Add a parameter to the builder."""
|
|
768
|
+
...
|
|
769
|
+
|
|
770
|
+
def _generate_unique_parameter_name(self, base_name: str) -> str:
|
|
771
|
+
"""Generate a unique parameter name."""
|
|
772
|
+
...
|
|
773
|
+
|
|
774
|
+
def _create_placeholder(self, value: Any, base_name: str) -> "tuple[exp.Placeholder, str]":
|
|
775
|
+
"""Create placeholder expression with bound parameter."""
|
|
776
|
+
...
|
|
777
|
+
|
|
778
|
+
def create_placeholder(self, value: Any, base_name: str) -> "tuple[exp.Placeholder, str]":
|
|
779
|
+
"""Create placeholder expression with bound parameter (public)."""
|
|
780
|
+
...
|
|
781
|
+
|
|
782
|
+
def _parameterize_expression(self, expression: "exp.Expr") -> "exp.Expr":
|
|
783
|
+
"""Replace literal values in an expression with bound parameters."""
|
|
784
|
+
...
|
|
785
|
+
|
|
786
|
+
def build(self) -> "exp.Expr | Any":
|
|
787
|
+
"""Build and return the final expression."""
|
|
788
|
+
...
|
|
789
|
+
|
|
790
|
+
def _merge_sql_object_parameters(self, sql_obj: Any) -> None:
|
|
791
|
+
"""Merge parameters from SQL objects into the builder."""
|
|
792
|
+
...
|
|
793
|
+
|
|
794
|
+
def _build_final_expression(self, *, copy: bool = False) -> "exp.Expr":
|
|
795
|
+
"""Return the expression with attached CTEs."""
|
|
796
|
+
...
|
|
797
|
+
|
|
798
|
+
def _spawn_like_self(self) -> "Self":
|
|
799
|
+
"""Create a new builder with matching configuration."""
|
|
800
|
+
...
|
|
801
|
+
|
|
802
|
+
def set_expression(self, expression: "exp.Expr") -> None:
|
|
803
|
+
"""Replace the underlying SQLGlot expression."""
|
|
804
|
+
...
|
|
805
|
+
|
|
806
|
+
def generate_unique_parameter_name(self, base_name: str) -> str:
|
|
807
|
+
"""Generate a unique parameter name exposed via public API."""
|
|
808
|
+
...
|
|
809
|
+
|
|
810
|
+
def build_static_expression(
|
|
811
|
+
self,
|
|
812
|
+
expression: "exp.Expr | None" = None,
|
|
813
|
+
parameters: dict[str, Any] | None = None,
|
|
814
|
+
*,
|
|
815
|
+
cache_key: str | None = None,
|
|
816
|
+
expression_factory: "Callable[[], exp.Expr] | None" = None,
|
|
817
|
+
copy: bool = True,
|
|
818
|
+
optimize_expression: bool | None = None,
|
|
819
|
+
dialect: "DialectType | None" = None,
|
|
820
|
+
) -> Any:
|
|
821
|
+
"""Compile a pre-built expression with optional caching and parameters."""
|
|
822
|
+
...
|
|
823
|
+
|
|
824
|
+
|
|
825
|
+
@runtime_checkable
|
|
826
|
+
class SupportsArrowResults(Protocol):
|
|
827
|
+
"""Protocol for adapters that support Arrow result format.
|
|
828
|
+
|
|
829
|
+
Adapters implementing this protocol can return query results in Apache Arrow
|
|
830
|
+
format via the select_to_arrow() method, enabling zero-copy data transfer and
|
|
831
|
+
efficient integration with data science tools.
|
|
832
|
+
"""
|
|
833
|
+
|
|
834
|
+
def select_to_arrow(
|
|
835
|
+
self,
|
|
836
|
+
statement: Any,
|
|
837
|
+
/,
|
|
838
|
+
*parameters: Any,
|
|
839
|
+
statement_config: Any | None = None,
|
|
840
|
+
return_format: str = "table",
|
|
841
|
+
native_only: bool = False,
|
|
842
|
+
batch_size: int | None = None,
|
|
843
|
+
arrow_schema: Any | None = None,
|
|
844
|
+
**kwargs: Any,
|
|
845
|
+
) -> "ArrowTable | ArrowRecordBatch":
|
|
846
|
+
"""Execute query and return results as Apache Arrow Table or RecordBatch.
|
|
847
|
+
|
|
848
|
+
Args:
|
|
849
|
+
statement: SQL statement to execute.
|
|
850
|
+
*parameters: Query parameters and filters.
|
|
851
|
+
statement_config: Optional statement configuration override.
|
|
852
|
+
return_format: Output format - "table", "reader", or "batches".
|
|
853
|
+
native_only: If True, raise error when native Arrow path unavailable.
|
|
854
|
+
batch_size: Chunk size for streaming modes.
|
|
855
|
+
arrow_schema: Optional target Arrow schema for type casting.
|
|
856
|
+
**kwargs: Additional keyword arguments.
|
|
857
|
+
|
|
858
|
+
Returns:
|
|
859
|
+
ArrowResult containing Arrow data.
|
|
860
|
+
"""
|
|
861
|
+
...
|
|
862
|
+
|
|
863
|
+
|
|
864
|
+
@runtime_checkable
|
|
865
|
+
class HasExpressionAndSQLProtocol(Protocol):
|
|
866
|
+
"""Protocol for objects with both expression and sql attributes (like SQL class)."""
|
|
867
|
+
|
|
868
|
+
expression: Any
|
|
869
|
+
sql: str
|
|
870
|
+
|
|
871
|
+
|
|
872
|
+
@runtime_checkable
|
|
873
|
+
class HasExpressionAndParametersProtocol(Protocol):
|
|
874
|
+
"""Protocol for objects with both expression and parameters attributes."""
|
|
875
|
+
|
|
876
|
+
expression: Any
|
|
877
|
+
parameters: Any
|
|
878
|
+
|
|
879
|
+
|
|
880
|
+
@runtime_checkable
|
|
881
|
+
class HasStatementConfigFactoryProtocol(Protocol):
|
|
882
|
+
"""Protocol for objects that can create a StatementConfig.
|
|
883
|
+
|
|
884
|
+
Used for config objects that have a factory method to create statement configs.
|
|
885
|
+
"""
|
|
886
|
+
|
|
887
|
+
def _create_statement_config(self) -> "StatementConfig":
|
|
888
|
+
"""Create a new StatementConfig instance."""
|
|
889
|
+
...
|
|
890
|
+
|
|
891
|
+
|
|
892
|
+
@runtime_checkable
|
|
893
|
+
class HasMigrationConfigProtocol(Protocol):
|
|
894
|
+
"""Protocol for database configurations that support migrations.
|
|
895
|
+
|
|
896
|
+
Used to check if a config object has migration_config attribute.
|
|
897
|
+
"""
|
|
898
|
+
|
|
899
|
+
migration_config: "Mapping[str, Any] | None"
|
|
900
|
+
|
|
901
|
+
|
|
902
|
+
class SyncDataDictionaryProtocol(Protocol):
|
|
903
|
+
"""Protocol for sync data dictionary implementations."""
|
|
904
|
+
|
|
905
|
+
dialect: str
|
|
906
|
+
|
|
907
|
+
def get_version(self, driver: Any) -> "VersionInfo | None": ...
|
|
908
|
+
|
|
909
|
+
def get_feature_flag(self, driver: Any, feature: str) -> bool: ...
|
|
910
|
+
|
|
911
|
+
def get_optimal_type(self, driver: Any, type_category: str) -> str: ...
|
|
912
|
+
|
|
913
|
+
def get_tables(self, driver: Any, schema: "str | None" = None) -> "list[TableMetadata]": ...
|
|
914
|
+
|
|
915
|
+
def get_columns(
|
|
916
|
+
self, driver: Any, table: "str | None" = None, schema: "str | None" = None
|
|
917
|
+
) -> "list[ColumnMetadata]": ...
|
|
918
|
+
|
|
919
|
+
def get_indexes(
|
|
920
|
+
self, driver: Any, table: "str | None" = None, schema: "str | None" = None
|
|
921
|
+
) -> "list[IndexMetadata]": ...
|
|
922
|
+
|
|
923
|
+
def get_foreign_keys(
|
|
924
|
+
self, driver: Any, table: "str | None" = None, schema: "str | None" = None
|
|
925
|
+
) -> "list[ForeignKeyMetadata]": ...
|
|
926
|
+
|
|
927
|
+
def list_available_features(self) -> "list[str]": ...
|
|
928
|
+
|
|
929
|
+
|
|
930
|
+
class AsyncDataDictionaryProtocol(Protocol):
|
|
931
|
+
"""Protocol for async data dictionary implementations."""
|
|
932
|
+
|
|
933
|
+
dialect: str
|
|
934
|
+
|
|
935
|
+
async def get_version(self, driver: Any) -> "VersionInfo | None": ...
|
|
936
|
+
|
|
937
|
+
async def get_feature_flag(self, driver: Any, feature: str) -> bool: ...
|
|
938
|
+
|
|
939
|
+
async def get_optimal_type(self, driver: Any, type_category: str) -> str: ...
|
|
940
|
+
|
|
941
|
+
async def get_tables(self, driver: Any, schema: "str | None" = None) -> "list[TableMetadata]": ...
|
|
942
|
+
|
|
943
|
+
async def get_columns(
|
|
944
|
+
self, driver: Any, table: "str | None" = None, schema: "str | None" = None
|
|
945
|
+
) -> "list[ColumnMetadata]": ...
|
|
946
|
+
|
|
947
|
+
async def get_indexes(
|
|
948
|
+
self, driver: Any, table: "str | None" = None, schema: "str | None" = None
|
|
949
|
+
) -> "list[IndexMetadata]": ...
|
|
950
|
+
|
|
951
|
+
async def get_foreign_keys(
|
|
952
|
+
self, driver: Any, table: "str | None" = None, schema: "str | None" = None
|
|
953
|
+
) -> "list[ForeignKeyMetadata]": ...
|
|
954
|
+
|
|
955
|
+
def list_available_features(self) -> "list[str]": ...
|