sqlspec 0.13.1__tar.gz → 0.14.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of sqlspec might be problematic. Click here for more details.
- {sqlspec-0.13.1 → sqlspec-0.14.1}/.gitignore +4 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/PKG-INFO +1 -1
- {sqlspec-0.13.1 → sqlspec-0.14.1}/pyproject.toml +7 -2
- sqlspec-0.14.1/sqlspec/__init__.py +67 -0
- sqlspec-0.14.1/sqlspec/__main__.py +12 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/adapters/adbc/config.py +16 -40
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/adapters/adbc/driver.py +43 -16
- sqlspec-0.14.1/sqlspec/adapters/adbc/transformers.py +108 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/adapters/aiosqlite/config.py +2 -20
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/adapters/aiosqlite/driver.py +36 -18
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/adapters/asyncmy/config.py +2 -33
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/adapters/asyncmy/driver.py +23 -16
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/adapters/asyncpg/config.py +5 -39
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/adapters/asyncpg/driver.py +41 -18
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/adapters/bigquery/config.py +2 -43
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/adapters/bigquery/driver.py +26 -14
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/adapters/duckdb/config.py +2 -49
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/adapters/duckdb/driver.py +35 -16
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/adapters/oracledb/config.py +4 -83
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/adapters/oracledb/driver.py +54 -27
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/adapters/psqlpy/config.py +2 -55
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/adapters/psqlpy/driver.py +28 -8
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/adapters/psycopg/config.py +4 -73
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/adapters/psycopg/driver.py +69 -24
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/adapters/sqlite/config.py +3 -21
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/adapters/sqlite/driver.py +50 -26
- sqlspec-0.14.1/sqlspec/cli.py +248 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/config.py +18 -20
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/driver/_async.py +28 -10
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/driver/_common.py +5 -4
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/driver/_sync.py +28 -10
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/driver/mixins/__init__.py +6 -0
- sqlspec-0.14.1/sqlspec/driver/mixins/_cache.py +114 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/driver/mixins/_pipeline.py +0 -4
- sqlspec-0.13.1/sqlspec/service/base.py → sqlspec-0.14.1/sqlspec/driver/mixins/_query_tools.py +86 -421
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/driver/mixins/_result_utils.py +0 -2
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/driver/mixins/_sql_translator.py +0 -2
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/driver/mixins/_storage.py +4 -18
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/driver/mixins/_type_coercion.py +0 -2
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/driver/parameters.py +4 -4
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/extensions/aiosql/adapter.py +4 -4
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/extensions/litestar/__init__.py +2 -1
- sqlspec-0.14.1/sqlspec/extensions/litestar/cli.py +48 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/extensions/litestar/plugin.py +3 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/loader.py +1 -1
- sqlspec-0.14.1/sqlspec/migrations/__init__.py +23 -0
- sqlspec-0.14.1/sqlspec/migrations/base.py +390 -0
- sqlspec-0.14.1/sqlspec/migrations/commands.py +525 -0
- sqlspec-0.14.1/sqlspec/migrations/runner.py +215 -0
- sqlspec-0.14.1/sqlspec/migrations/tracker.py +153 -0
- sqlspec-0.14.1/sqlspec/migrations/utils.py +89 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/protocols.py +37 -3
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/statement/builder/__init__.py +8 -8
- sqlspec-0.13.1/sqlspec/statement/builder/column.py → sqlspec-0.14.1/sqlspec/statement/builder/_column.py +82 -52
- sqlspec-0.13.1/sqlspec/statement/builder/ddl.py → sqlspec-0.14.1/sqlspec/statement/builder/_ddl.py +5 -5
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/statement/builder/_ddl_utils.py +1 -1
- sqlspec-0.13.1/sqlspec/statement/builder/delete.py → sqlspec-0.14.1/sqlspec/statement/builder/_delete.py +1 -1
- sqlspec-0.13.1/sqlspec/statement/builder/insert.py → sqlspec-0.14.1/sqlspec/statement/builder/_insert.py +1 -1
- sqlspec-0.13.1/sqlspec/statement/builder/merge.py → sqlspec-0.14.1/sqlspec/statement/builder/_merge.py +1 -1
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/statement/builder/_parsing_utils.py +5 -3
- sqlspec-0.13.1/sqlspec/statement/builder/select.py → sqlspec-0.14.1/sqlspec/statement/builder/_select.py +59 -61
- sqlspec-0.13.1/sqlspec/statement/builder/update.py → sqlspec-0.14.1/sqlspec/statement/builder/_update.py +2 -2
- sqlspec-0.14.1/sqlspec/statement/builder/mixins/__init__.py +59 -0
- sqlspec-0.13.1/sqlspec/statement/builder/mixins/_set_ops.py → sqlspec-0.14.1/sqlspec/statement/builder/mixins/_cte_and_set_ops.py +86 -2
- sqlspec-0.13.1/sqlspec/statement/builder/mixins/_delete_from.py → sqlspec-0.14.1/sqlspec/statement/builder/mixins/_delete_operations.py +2 -0
- sqlspec-0.13.1/sqlspec/statement/builder/mixins/_insert_values.py → sqlspec-0.14.1/sqlspec/statement/builder/mixins/_insert_operations.py +70 -1
- sqlspec-0.13.1/sqlspec/statement/builder/mixins/_merge_clauses.py → sqlspec-0.14.1/sqlspec/statement/builder/mixins/_merge_operations.py +2 -0
- sqlspec-0.14.1/sqlspec/statement/builder/mixins/_order_limit_operations.py +123 -0
- sqlspec-0.13.1/sqlspec/statement/builder/mixins/_pivot.py → sqlspec-0.14.1/sqlspec/statement/builder/mixins/_pivot_operations.py +71 -2
- sqlspec-0.14.1/sqlspec/statement/builder/mixins/_select_operations.py +612 -0
- sqlspec-0.13.1/sqlspec/statement/builder/mixins/_update_set.py → sqlspec-0.14.1/sqlspec/statement/builder/mixins/_update_operations.py +73 -2
- sqlspec-0.14.1/sqlspec/statement/builder/mixins/_where_clause.py +536 -0
- sqlspec-0.14.1/sqlspec/statement/cache.py +50 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/statement/filters.py +37 -8
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/statement/parameters.py +143 -54
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/statement/pipelines/__init__.py +1 -1
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/statement/pipelines/context.py +4 -10
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/statement/pipelines/transformers/_expression_simplifier.py +3 -3
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/statement/pipelines/validators/_parameter_style.py +22 -22
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/statement/pipelines/validators/_performance.py +1 -5
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/statement/sql.py +246 -176
- sqlspec-0.14.1/sqlspec/utils/__init__.py +4 -0
- sqlspec-0.14.1/sqlspec/utils/statement_hashing.py +203 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/utils/type_guards.py +32 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_adbc/test_arrow_functionality.py +2 -2
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_adbc/test_data_types.py +2 -5
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_adbc/test_driver.py +7 -7
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_adbc/test_duckdb_driver.py +4 -4
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_adbc/test_execute_many.py +3 -3
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_adbc/test_execute_script.py +2 -2
- sqlspec-0.14.1/tests/integration/test_adapters/test_adbc/test_null_params.py +121 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_adbc/test_parameter_styles.py +6 -6
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_adbc/test_postgres_driver.py +11 -18
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_adbc/test_returning.py +3 -3
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_adbc/test_sqlite_driver.py +4 -4
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_aiosqlite/test_driver.py +11 -14
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_asyncmy/test_config.py +1 -1
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_asyncpg/test_arrow_functionality.py +14 -4
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_asyncpg/test_driver.py +13 -13
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_asyncpg/test_execute_many.py +3 -3
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_asyncpg/test_parameter_styles.py +13 -15
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_bigquery/test_arrow_functionality.py +2 -2
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_bigquery/test_driver.py +7 -7
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_duckdb/test_arrow_functionality.py +2 -2
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_duckdb/test_connection.py +6 -6
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_duckdb/test_driver.py +4 -4
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_duckdb/test_execute_many.py +2 -2
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_duckdb/test_mixed_parameter_styles.py +1 -1
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_duckdb/test_parameter_styles.py +17 -18
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_oracledb/test_driver_async.py +9 -9
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_oracledb/test_driver_sync.py +4 -5
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_psqlpy/test_arrow_functionality.py +4 -4
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_psqlpy/test_driver.py +25 -25
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_psycopg/test_driver.py +7 -7
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_psycopg/test_execute_many.py +5 -40
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_psycopg/test_parameter_styles.py +13 -15
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_sqlite/test_driver.py +10 -10
- sqlspec-0.14.1/tests/integration/test_adapters/test_sqlite/test_query_mixin.py +223 -0
- sqlspec-0.14.1/tests/integration/test_driver_mixins/__init__.py +1 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_sql_file_loader.py +8 -1
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_storage/test_driver_storage_integration.py +1 -1
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_storage/test_end_to_end_workflows.py +1 -1
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_storage/test_storage_mixins.py +1 -1
- sqlspec-0.14.1/tests/unit/statement/test_cache.py +231 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_adapters/test_adbc/test_config.py +1 -1
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_adapters/test_adbc/test_driver.py +5 -5
- sqlspec-0.14.1/tests/unit/test_adapters/test_adbc/test_transformers.py +147 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_adapters/test_aiosqlite/test_config.py +1 -1
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_adapters/test_aiosqlite/test_driver.py +5 -5
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_adapters/test_asyncmy/test_driver.py +4 -4
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_adapters/test_asyncpg/test_config.py +4 -44
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_adapters/test_asyncpg/test_driver.py +11 -11
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_adapters/test_bigquery/test_config.py +4 -49
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_adapters/test_bigquery/test_driver.py +1 -3
- sqlspec-0.14.1/tests/unit/test_adapters/test_cache_mixin.py +203 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_adapters/test_duckdb/test_config.py +4 -54
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_adapters/test_duckdb/test_driver.py +4 -3
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_adapters/test_oracledb/test_config.py +1 -1
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_adapters/test_oracledb/test_driver.py +2 -2
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_adapters/test_psqlpy/test_config.py +1 -1
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_adapters/test_psqlpy/test_driver.py +1 -1
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_adapters/test_psycopg/test_config.py +7 -7
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_adapters/test_psycopg/test_driver.py +6 -4
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_adapters/test_sqlite/test_config.py +6 -28
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_adapters/test_sqlite/test_driver.py +16 -5
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_config.py +6 -6
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_driver.py +8 -8
- sqlspec-0.14.1/tests/unit/test_driver_mixins/__init__.py +1 -0
- sqlspec-0.14.1/tests/unit/test_driver_mixins/test_query_mixin.py +336 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_loader.py +1 -2
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_base.py +2 -2
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_builder/test_base.py +5 -5
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_builder/test_builder_mixins.py +22 -25
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_builder/test_column.py +6 -6
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_builder/test_delete.py +1 -1
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_builder/test_dynamic_columns.py +16 -16
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_builder/test_insert.py +1 -1
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_builder/test_merge.py +1 -1
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_builder/test_select.py +2 -2
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_builder/test_update.py +1 -1
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_config.py +2 -2
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_oracle_numeric_parameters.py +10 -16
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_parameter_normalization.py +23 -23
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_parameter_preservation.py +3 -3
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_pipelines/test_expression_simplifier.py +4 -4
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_pipelines/test_literal_parameterizer_duplication.py +4 -4
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_pipelines/test_validators_parameter_style.py +11 -11
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_sql.py +6 -9
- sqlspec-0.14.1/tests/unit/test_statement/test_typed_parameter.py +226 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_utils/test_singleton.py +1 -1
- sqlspec-0.14.1/tests/unit/utils/test_ast_hashing.py +145 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/uv.lock +215 -57
- sqlspec-0.13.1/sqlspec/__init__.py +0 -29
- sqlspec-0.13.1/sqlspec/service/__init__.py +0 -4
- sqlspec-0.13.1/sqlspec/service/_util.py +0 -147
- sqlspec-0.13.1/sqlspec/service/pagination.py +0 -26
- sqlspec-0.13.1/sqlspec/statement/builder/mixins/__init__.py +0 -65
- sqlspec-0.13.1/sqlspec/statement/builder/mixins/_aggregate_functions.py +0 -250
- sqlspec-0.13.1/sqlspec/statement/builder/mixins/_case_builder.py +0 -91
- sqlspec-0.13.1/sqlspec/statement/builder/mixins/_common_table_expr.py +0 -90
- sqlspec-0.13.1/sqlspec/statement/builder/mixins/_from.py +0 -63
- sqlspec-0.13.1/sqlspec/statement/builder/mixins/_group_by.py +0 -118
- sqlspec-0.13.1/sqlspec/statement/builder/mixins/_having.py +0 -35
- sqlspec-0.13.1/sqlspec/statement/builder/mixins/_insert_from_select.py +0 -47
- sqlspec-0.13.1/sqlspec/statement/builder/mixins/_insert_into.py +0 -36
- sqlspec-0.13.1/sqlspec/statement/builder/mixins/_limit_offset.py +0 -53
- sqlspec-0.13.1/sqlspec/statement/builder/mixins/_order_by.py +0 -46
- sqlspec-0.13.1/sqlspec/statement/builder/mixins/_returning.py +0 -37
- sqlspec-0.13.1/sqlspec/statement/builder/mixins/_select_columns.py +0 -61
- sqlspec-0.13.1/sqlspec/statement/builder/mixins/_unpivot.py +0 -77
- sqlspec-0.13.1/sqlspec/statement/builder/mixins/_update_from.py +0 -55
- sqlspec-0.13.1/sqlspec/statement/builder/mixins/_update_table.py +0 -29
- sqlspec-0.13.1/sqlspec/statement/builder/mixins/_where.py +0 -401
- sqlspec-0.13.1/sqlspec/statement/builder/mixins/_window_functions.py +0 -86
- sqlspec-0.13.1/sqlspec/statement/parameter_manager.py +0 -220
- sqlspec-0.13.1/sqlspec/statement/sql_compiler.py +0 -140
- sqlspec-0.13.1/sqlspec/utils/__init__.py +0 -3
- {sqlspec-0.13.1 → sqlspec-0.14.1}/.pre-commit-config.yaml +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/CONTRIBUTING.rst +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/LICENSE +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/Makefile +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/NOTICE +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/README.md +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/__metadata__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/_serialization.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/_sql.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/_typing.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/adapters/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/adapters/adbc/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/adapters/aiosqlite/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/adapters/asyncmy/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/adapters/asyncpg/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/adapters/bigquery/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/adapters/duckdb/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/adapters/oracledb/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/adapters/psqlpy/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/adapters/psycopg/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/adapters/sqlite/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/base.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/driver/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/driver/connection.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/driver/mixins/_csv_writer.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/exceptions.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/extensions/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/extensions/aiosql/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/extensions/litestar/_utils.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/extensions/litestar/config.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/extensions/litestar/handlers.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/extensions/litestar/providers.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/py.typed +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/statement/__init__.py +0 -0
- /sqlspec-0.13.1/sqlspec/statement/builder/base.py → /sqlspec-0.14.1/sqlspec/statement/builder/_base.py +0 -0
- /sqlspec-0.13.1/sqlspec/statement/builder/mixins/_join.py → /sqlspec-0.14.1/sqlspec/statement/builder/mixins/_join_operations.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/statement/pipelines/analyzers/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/statement/pipelines/analyzers/_analyzer.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/statement/pipelines/transformers/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/statement/pipelines/transformers/_literal_parameterizer.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/statement/pipelines/transformers/_remove_comments_and_hints.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/statement/pipelines/validators/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/statement/pipelines/validators/_dml_safety.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/statement/pipelines/validators/_security.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/statement/result.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/statement/splitter.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/storage/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/storage/backends/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/storage/backends/base.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/storage/backends/fsspec.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/storage/backends/obstore.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/storage/capabilities.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/storage/registry.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/typing.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/utils/cached_property.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/utils/correlation.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/utils/deprecation.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/utils/fixtures.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/utils/logging.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/utils/module_loader.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/utils/serializers.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/utils/singleton.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/utils/sync_tools.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/sqlspec/utils/text.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/conftest.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/ddls-mysql-collection.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/ddls-postgres-collection.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/example_usage.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/init.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/mysql/collection-config.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/mysql/collection-data_types.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/mysql/collection-database_details.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/mysql/collection-engines.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/mysql/collection-hostname.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/mysql/collection-plugins.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/mysql/collection-process_list.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/mysql/collection-resource-groups.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/mysql/collection-schema_objects.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/mysql/collection-table_details.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/mysql/collection-users.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/mysql/init.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/oracle.ddl.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/postgres/collection-applications.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/postgres/collection-aws_extension_dependency.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/postgres/collection-aws_oracle_exists.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/postgres/collection-bg_writer_stats.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/postgres/collection-calculated_metrics.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/postgres/collection-data_types.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/postgres/collection-database_details.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/postgres/collection-extensions.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/postgres/collection-index_details.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/postgres/collection-pglogical-details.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/postgres/collection-privileges.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/postgres/collection-replication_slots.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/postgres/collection-replication_stats.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/postgres/collection-schema_details.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/postgres/collection-schema_objects.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/postgres/collection-settings.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/postgres/collection-source_details.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/postgres/collection-table_details.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/postgres/extended-collection-all-databases.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/postgres/init.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/readiness-check.sql +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/fixtures/sql_utils.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_adbc/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_adbc/conftest.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_adbc/test_bigquery_driver.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_adbc/test_connection.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_aiosqlite/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_asyncmy/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_asyncpg/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_asyncpg/conftest.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_asyncpg/test_connection.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_bigquery/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_bigquery/conftest.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_bigquery/test_connection.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_duckdb/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_oracledb/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_oracledb/test_connection.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_psqlpy/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_psqlpy/test_connection.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_psycopg/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_psycopg/conftest.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_psycopg/test_async_copy.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_psycopg/test_connection.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_adapters/test_sqlite/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_dialect_propagation.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_extensions/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_extensions/test_aiosql/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_extensions/test_litestar/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/integration/test_storage/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_adapters/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_adapters/test_adbc/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_adapters/test_aiosqlite/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_adapters/test_asyncmy/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_adapters/test_asyncpg/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_adapters/test_bigquery/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_adapters/test_duckdb/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_adapters/test_oracledb/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_adapters/test_psqlpy/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_adapters/test_psycopg/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_adapters/test_sqlite/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_base.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_config_dialect.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_exceptions.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_extensions/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_extensions/test_aiosql/test_adapter.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_builder/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_filters.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_mixins.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_parameters.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_pipelines/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_pipelines/test_analyzer.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_pipelines/test_analyzer_subquery_detection.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_pipelines/test_transformers_literal_parameterizer.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_pipelines/test_transformers_literal_parameterizer_cte.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_pipelines/test_transformers_remove_comments.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_pipelines/test_validators_dml_safety.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_pipelines/test_validators_performance.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_pipelines/test_validators_security.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_result.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_splitter.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_sql_as_many.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_sql_translator_mixin.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_sqlfactory.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_storage.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_statement/test_transformers/test_expression_simplifier_parameter_tracking.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_storage/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_storage/test_backends/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_storage/test_backends/test_fsspec_backend.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_storage/test_backends/test_obstore_backend.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_storage/test_base.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_storage/test_registry.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_typing.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_utils/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_utils/test_deprecation.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_utils/test_fixtures.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_utils/test_module_loader.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_utils/test_sync_tools.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tests/unit/test_utils/test_text.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tools/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tools/build_docs.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tools/pypi_readme.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tools/sphinx_ext/__init__.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tools/sphinx_ext/changelog.py +0 -0
- {sqlspec-0.13.1 → sqlspec-0.14.1}/tools/sphinx_ext/missing_references.py +0 -0
|
@@ -7,7 +7,7 @@ maintainers = [{ name = "Litestar Developers", email = "hello@litestar.dev" }]
|
|
|
7
7
|
name = "sqlspec"
|
|
8
8
|
readme = "README.md"
|
|
9
9
|
requires-python = ">=3.9, <4.0"
|
|
10
|
-
version = "0.
|
|
10
|
+
version = "0.14.1"
|
|
11
11
|
|
|
12
12
|
[project.urls]
|
|
13
13
|
Discord = "https://discord.gg/litestar"
|
|
@@ -48,6 +48,7 @@ uuid = ["uuid-utils"]
|
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
[dependency-groups]
|
|
51
|
+
benchmarks = ["sqlalchemy", "psutil", "types-psutil"]
|
|
51
52
|
build = ["bump-my-version"]
|
|
52
53
|
dev = [
|
|
53
54
|
{ include-group = "extras" },
|
|
@@ -55,6 +56,7 @@ dev = [
|
|
|
55
56
|
{ include-group = "doc" },
|
|
56
57
|
{ include-group = "test" },
|
|
57
58
|
{ include-group = "build" },
|
|
59
|
+
{ include-group = "benchmarks" },
|
|
58
60
|
]
|
|
59
61
|
doc = [
|
|
60
62
|
"auto-pytabs[sphinx]>=0.5.0",
|
|
@@ -106,6 +108,9 @@ test = [
|
|
|
106
108
|
"pytest-xdist>=3.6.1",
|
|
107
109
|
]
|
|
108
110
|
|
|
111
|
+
[project.scripts]
|
|
112
|
+
sqlspec = "sqlspec.__main__:run_cli"
|
|
113
|
+
|
|
109
114
|
[build-system]
|
|
110
115
|
build-backend = "hatchling.build"
|
|
111
116
|
requires = ["hatchling"]
|
|
@@ -126,7 +131,7 @@ packages = ["sqlspec"]
|
|
|
126
131
|
allow_dirty = true
|
|
127
132
|
commit = false
|
|
128
133
|
commit_args = "--no-verify"
|
|
129
|
-
current_version = "0.
|
|
134
|
+
current_version = "0.14.1"
|
|
130
135
|
ignore_missing_files = false
|
|
131
136
|
ignore_missing_version = false
|
|
132
137
|
message = "chore(release): bump to v{new_version}"
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"""SQLSpec: Safe and elegant SQL query building for Python."""
|
|
2
|
+
|
|
3
|
+
from sqlspec import adapters, base, driver, exceptions, extensions, loader, statement, typing, utils
|
|
4
|
+
from sqlspec.__metadata__ import __version__
|
|
5
|
+
from sqlspec._sql import SQLFactory
|
|
6
|
+
from sqlspec.base import SQLSpec
|
|
7
|
+
from sqlspec.config import AsyncDatabaseConfig, SyncDatabaseConfig
|
|
8
|
+
from sqlspec.exceptions import (
|
|
9
|
+
NotFoundError,
|
|
10
|
+
ParameterError,
|
|
11
|
+
SQLBuilderError,
|
|
12
|
+
SQLFileNotFoundError,
|
|
13
|
+
SQLFileParseError,
|
|
14
|
+
SQLParsingError,
|
|
15
|
+
SQLValidationError,
|
|
16
|
+
)
|
|
17
|
+
from sqlspec.loader import SQLFile, SQLFileLoader
|
|
18
|
+
from sqlspec.statement.builder import Column, ColumnExpression, Delete, FunctionColumn, Insert, Merge, Select, Update
|
|
19
|
+
from sqlspec.statement.result import ArrowResult, SQLResult
|
|
20
|
+
from sqlspec.statement.sql import SQL, SQLConfig
|
|
21
|
+
from sqlspec.typing import ConnectionT, DictRow, ModelDTOT, ModelT, RowT, StatementParameters
|
|
22
|
+
|
|
23
|
+
sql = SQLFactory()
|
|
24
|
+
|
|
25
|
+
__all__ = (
|
|
26
|
+
"SQL",
|
|
27
|
+
"ArrowResult",
|
|
28
|
+
"AsyncDatabaseConfig",
|
|
29
|
+
"Column",
|
|
30
|
+
"ColumnExpression",
|
|
31
|
+
"ConnectionT",
|
|
32
|
+
"Delete",
|
|
33
|
+
"DictRow",
|
|
34
|
+
"FunctionColumn",
|
|
35
|
+
"Insert",
|
|
36
|
+
"Merge",
|
|
37
|
+
"ModelDTOT",
|
|
38
|
+
"ModelT",
|
|
39
|
+
"NotFoundError",
|
|
40
|
+
"ParameterError",
|
|
41
|
+
"RowT",
|
|
42
|
+
"SQLBuilderError",
|
|
43
|
+
"SQLConfig",
|
|
44
|
+
"SQLFile",
|
|
45
|
+
"SQLFileLoader",
|
|
46
|
+
"SQLFileNotFoundError",
|
|
47
|
+
"SQLFileParseError",
|
|
48
|
+
"SQLParsingError",
|
|
49
|
+
"SQLResult",
|
|
50
|
+
"SQLSpec",
|
|
51
|
+
"SQLValidationError",
|
|
52
|
+
"Select",
|
|
53
|
+
"StatementParameters",
|
|
54
|
+
"SyncDatabaseConfig",
|
|
55
|
+
"Update",
|
|
56
|
+
"__version__",
|
|
57
|
+
"adapters",
|
|
58
|
+
"base",
|
|
59
|
+
"driver",
|
|
60
|
+
"exceptions",
|
|
61
|
+
"extensions",
|
|
62
|
+
"loader",
|
|
63
|
+
"sql",
|
|
64
|
+
"statement",
|
|
65
|
+
"typing",
|
|
66
|
+
"utils",
|
|
67
|
+
)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from sqlspec.cli import add_migration_commands as build_cli_interface
|
|
2
|
+
|
|
3
|
+
__all__ = ("run_cli",)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def run_cli() -> None: # pragma: no cover
|
|
7
|
+
"""SQLSpec CLI"""
|
|
8
|
+
build_cli_interface()()
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
if __name__ == "__main__": # pragma: no cover
|
|
12
|
+
run_cli()
|
|
@@ -6,6 +6,7 @@ from dataclasses import replace
|
|
|
6
6
|
from typing import TYPE_CHECKING, Any, Callable, ClassVar, Optional
|
|
7
7
|
|
|
8
8
|
from sqlspec.adapters.adbc.driver import AdbcConnection, AdbcDriver
|
|
9
|
+
from sqlspec.adapters.adbc.transformers import AdbcPostgresTransformer
|
|
9
10
|
from sqlspec.config import NoPoolSyncConfig
|
|
10
11
|
from sqlspec.exceptions import ImproperConfigurationError
|
|
11
12
|
from sqlspec.statement.sql import SQLConfig
|
|
@@ -69,41 +70,6 @@ class AdbcConfig(NoPoolSyncConfig[AdbcConnection, AdbcDriver]):
|
|
|
69
70
|
- Cloud database integrations
|
|
70
71
|
"""
|
|
71
72
|
|
|
72
|
-
__slots__ = (
|
|
73
|
-
"_dialect",
|
|
74
|
-
"account",
|
|
75
|
-
"adbc_driver_manager_entrypoint",
|
|
76
|
-
"authorization_header",
|
|
77
|
-
"autocommit",
|
|
78
|
-
"batch_size",
|
|
79
|
-
"conn_kwargs",
|
|
80
|
-
"connection_timeout",
|
|
81
|
-
"database",
|
|
82
|
-
"dataset_id",
|
|
83
|
-
"db_kwargs",
|
|
84
|
-
"default_row_type",
|
|
85
|
-
"driver_name",
|
|
86
|
-
"extras",
|
|
87
|
-
"grpc_options",
|
|
88
|
-
"isolation_level",
|
|
89
|
-
"on_connection_create",
|
|
90
|
-
"password",
|
|
91
|
-
"pool_instance",
|
|
92
|
-
"project_id",
|
|
93
|
-
"query_timeout",
|
|
94
|
-
"role",
|
|
95
|
-
"schema",
|
|
96
|
-
"ssl_ca",
|
|
97
|
-
"ssl_cert",
|
|
98
|
-
"ssl_key",
|
|
99
|
-
"ssl_mode",
|
|
100
|
-
"statement_config",
|
|
101
|
-
"token",
|
|
102
|
-
"uri",
|
|
103
|
-
"username",
|
|
104
|
-
"warehouse",
|
|
105
|
-
)
|
|
106
|
-
|
|
107
73
|
is_async: ClassVar[bool] = False
|
|
108
74
|
supports_connection_pooling: ClassVar[bool] = False
|
|
109
75
|
driver_type: type[AdbcDriver] = AdbcDriver
|
|
@@ -114,7 +80,7 @@ class AdbcConfig(NoPoolSyncConfig[AdbcConnection, AdbcDriver]):
|
|
|
114
80
|
supported_parameter_styles: ClassVar[tuple[str, ...]] = ("qmark",)
|
|
115
81
|
"""ADBC parameter styles depend on the underlying driver."""
|
|
116
82
|
|
|
117
|
-
|
|
83
|
+
default_parameter_style: ClassVar[str] = "qmark"
|
|
118
84
|
"""ADBC default parameter style is ? (qmark)."""
|
|
119
85
|
|
|
120
86
|
def __init__(
|
|
@@ -251,7 +217,6 @@ class AdbcConfig(NoPoolSyncConfig[AdbcConnection, AdbcDriver]):
|
|
|
251
217
|
self.statement_config = statement_config or SQLConfig()
|
|
252
218
|
self.default_row_type = default_row_type
|
|
253
219
|
self.on_connection_create = on_connection_create
|
|
254
|
-
self._dialect: DialectType = None
|
|
255
220
|
super().__init__()
|
|
256
221
|
|
|
257
222
|
def _resolve_driver_name(self) -> str:
|
|
@@ -381,7 +346,7 @@ class AdbcConfig(NoPoolSyncConfig[AdbcConnection, AdbcDriver]):
|
|
|
381
346
|
"""Get parameter styles based on the underlying driver.
|
|
382
347
|
|
|
383
348
|
Returns:
|
|
384
|
-
Tuple of (supported_parameter_styles,
|
|
349
|
+
Tuple of (supported_parameter_styles, default_parameter_style)
|
|
385
350
|
"""
|
|
386
351
|
try:
|
|
387
352
|
driver_path = self._resolve_driver_name()
|
|
@@ -400,7 +365,7 @@ class AdbcConfig(NoPoolSyncConfig[AdbcConnection, AdbcDriver]):
|
|
|
400
365
|
|
|
401
366
|
except Exception:
|
|
402
367
|
# If we can't determine driver, use defaults
|
|
403
|
-
return (self.supported_parameter_styles, self.
|
|
368
|
+
return (self.supported_parameter_styles, self.default_parameter_style)
|
|
404
369
|
return (("qmark",), "qmark")
|
|
405
370
|
|
|
406
371
|
def create_connection(self) -> AdbcConnection:
|
|
@@ -467,9 +432,20 @@ class AdbcConfig(NoPoolSyncConfig[AdbcConnection, AdbcDriver]):
|
|
|
467
432
|
statement_config = replace(
|
|
468
433
|
statement_config,
|
|
469
434
|
allowed_parameter_styles=supported_styles,
|
|
470
|
-
|
|
435
|
+
default_parameter_style=preferred_style,
|
|
471
436
|
)
|
|
472
437
|
|
|
438
|
+
# Add ADBC PostgreSQL transformer if needed
|
|
439
|
+
if self._get_dialect() == "postgres":
|
|
440
|
+
# Get the default transformers from the pipeline
|
|
441
|
+
pipeline = statement_config.get_statement_pipeline()
|
|
442
|
+
existing_transformers = list(pipeline.transformers)
|
|
443
|
+
|
|
444
|
+
# Append our transformer to the existing ones
|
|
445
|
+
existing_transformers.append(AdbcPostgresTransformer())
|
|
446
|
+
|
|
447
|
+
statement_config = replace(statement_config, transformers=existing_transformers)
|
|
448
|
+
|
|
473
449
|
driver = self.driver_type(connection=connection, config=statement_config)
|
|
474
450
|
yield driver
|
|
475
451
|
|
|
@@ -12,12 +12,13 @@ from sqlspec.driver import SyncDriverAdapterProtocol
|
|
|
12
12
|
from sqlspec.driver.connection import managed_transaction_sync
|
|
13
13
|
from sqlspec.driver.mixins import (
|
|
14
14
|
SQLTranslatorMixin,
|
|
15
|
+
SyncAdapterCacheMixin,
|
|
15
16
|
SyncPipelinedExecutionMixin,
|
|
16
17
|
SyncStorageMixin,
|
|
17
18
|
ToSchemaMixin,
|
|
18
19
|
TypeCoercionMixin,
|
|
19
20
|
)
|
|
20
|
-
from sqlspec.driver.parameters import
|
|
21
|
+
from sqlspec.driver.parameters import convert_parameter_sequence
|
|
21
22
|
from sqlspec.exceptions import wrap_exceptions
|
|
22
23
|
from sqlspec.statement.parameters import ParameterStyle
|
|
23
24
|
from sqlspec.statement.result import ArrowResult, SQLResult
|
|
@@ -37,6 +38,7 @@ AdbcConnection = Connection
|
|
|
37
38
|
|
|
38
39
|
class AdbcDriver(
|
|
39
40
|
SyncDriverAdapterProtocol["AdbcConnection", RowT],
|
|
41
|
+
SyncAdapterCacheMixin,
|
|
40
42
|
SQLTranslatorMixin,
|
|
41
43
|
TypeCoercionMixin,
|
|
42
44
|
SyncStorageMixin,
|
|
@@ -60,7 +62,6 @@ class AdbcDriver(
|
|
|
60
62
|
supports_native_arrow_export: ClassVar[bool] = True
|
|
61
63
|
supports_native_parquet_export: ClassVar[bool] = False # Not implemented yet
|
|
62
64
|
supports_native_parquet_import: ClassVar[bool] = True
|
|
63
|
-
__slots__ = ("default_parameter_style", "dialect", "supported_parameter_styles")
|
|
64
65
|
|
|
65
66
|
def __init__(
|
|
66
67
|
self,
|
|
@@ -181,7 +182,7 @@ class AdbcDriver(
|
|
|
181
182
|
self, statement: SQL, connection: Optional["AdbcConnection"] = None, **kwargs: Any
|
|
182
183
|
) -> SQLResult[RowT]:
|
|
183
184
|
if statement.is_script:
|
|
184
|
-
sql, _ =
|
|
185
|
+
sql, _ = self._get_compiled_sql(statement, ParameterStyle.STATIC)
|
|
185
186
|
return self._execute_script(sql, connection=connection, **kwargs)
|
|
186
187
|
|
|
187
188
|
detected_styles = {p.style for p in statement.parameter_info}
|
|
@@ -197,7 +198,7 @@ class AdbcDriver(
|
|
|
197
198
|
target_style = style
|
|
198
199
|
break
|
|
199
200
|
|
|
200
|
-
sql, params =
|
|
201
|
+
sql, params = self._get_compiled_sql(statement, target_style)
|
|
201
202
|
params = self._process_parameters(params)
|
|
202
203
|
if statement.is_many:
|
|
203
204
|
return self._execute_many(sql, params, connection=connection, **kwargs)
|
|
@@ -211,17 +212,21 @@ class AdbcDriver(
|
|
|
211
212
|
conn = connection if connection is not None else self._connection(None)
|
|
212
213
|
|
|
213
214
|
with managed_transaction_sync(conn, auto_commit=True) as txn_conn:
|
|
214
|
-
|
|
215
|
-
if
|
|
216
|
-
cursor_params = [
|
|
215
|
+
converted_params = convert_parameter_sequence(parameters)
|
|
216
|
+
if converted_params is not None and not isinstance(converted_params, (list, tuple)):
|
|
217
|
+
cursor_params = [converted_params]
|
|
217
218
|
else:
|
|
218
|
-
cursor_params =
|
|
219
|
+
cursor_params = converted_params
|
|
219
220
|
|
|
220
221
|
with self._get_cursor(txn_conn) as cursor:
|
|
221
222
|
try:
|
|
223
|
+
# ADBC PostgreSQL has issues with NULL parameters in some cases
|
|
224
|
+
# The transformer handles all-NULL cases, but mixed NULL/non-NULL
|
|
225
|
+
# can still cause "Can't map Arrow type 'na' to Postgres type" errors
|
|
222
226
|
cursor.execute(sql, cursor_params or [])
|
|
223
227
|
except Exception as e:
|
|
224
|
-
# Rollback transaction on error for PostgreSQL to avoid
|
|
228
|
+
# Rollback transaction on error for PostgreSQL to avoid
|
|
229
|
+
# "current transaction is aborted" errors
|
|
225
230
|
if self.dialect == "postgres":
|
|
226
231
|
with contextlib.suppress(Exception):
|
|
227
232
|
cursor.execute("ROLLBACK")
|
|
@@ -261,11 +266,22 @@ class AdbcDriver(
|
|
|
261
266
|
|
|
262
267
|
with managed_transaction_sync(conn, auto_commit=True) as txn_conn:
|
|
263
268
|
# Normalize parameter list using consolidated utility
|
|
264
|
-
|
|
269
|
+
converted_param_list = convert_parameter_sequence(param_list)
|
|
270
|
+
|
|
271
|
+
# Handle empty parameter list case for PostgreSQL
|
|
272
|
+
if not converted_param_list and self.dialect == "postgres":
|
|
273
|
+
# Return empty result without executing
|
|
274
|
+
return SQLResult(
|
|
275
|
+
statement=SQL(sql, _dialect=self.dialect),
|
|
276
|
+
data=[],
|
|
277
|
+
rows_affected=0,
|
|
278
|
+
operation_type="EXECUTE",
|
|
279
|
+
metadata={"status_message": "OK"},
|
|
280
|
+
)
|
|
265
281
|
|
|
266
282
|
with self._get_cursor(txn_conn) as cursor:
|
|
267
283
|
try:
|
|
268
|
-
cursor.executemany(sql,
|
|
284
|
+
cursor.executemany(sql, converted_param_list or [])
|
|
269
285
|
except Exception as e:
|
|
270
286
|
if self.dialect == "postgres":
|
|
271
287
|
with contextlib.suppress(Exception):
|
|
@@ -290,18 +306,28 @@ class AdbcDriver(
|
|
|
290
306
|
with managed_transaction_sync(conn, auto_commit=True) as txn_conn:
|
|
291
307
|
# ADBC drivers don't support multiple statements in a single execute
|
|
292
308
|
statements = self._split_script_statements(script)
|
|
309
|
+
suppress_warnings = kwargs.get("_suppress_warnings", False)
|
|
293
310
|
|
|
294
311
|
executed_count = 0
|
|
312
|
+
total_rows = 0
|
|
295
313
|
with self._get_cursor(txn_conn) as cursor:
|
|
296
314
|
for statement in statements:
|
|
297
315
|
if statement.strip():
|
|
298
|
-
|
|
316
|
+
# Validate each statement unless warnings suppressed
|
|
317
|
+
if not suppress_warnings:
|
|
318
|
+
# Run validation through pipeline
|
|
319
|
+
temp_sql = SQL(statement, config=self.config)
|
|
320
|
+
temp_sql._ensure_processed()
|
|
321
|
+
# Validation errors are logged as warnings by default
|
|
322
|
+
|
|
323
|
+
rows = self._execute_single_script_statement(cursor, statement)
|
|
299
324
|
executed_count += 1
|
|
325
|
+
total_rows += rows
|
|
300
326
|
|
|
301
327
|
return SQLResult(
|
|
302
328
|
statement=SQL(script, _dialect=self.dialect).as_script(),
|
|
303
329
|
data=[],
|
|
304
|
-
rows_affected=
|
|
330
|
+
rows_affected=total_rows,
|
|
305
331
|
operation_type="SCRIPT",
|
|
306
332
|
metadata={"status_message": "SCRIPT EXECUTED"},
|
|
307
333
|
total_statements=executed_count,
|
|
@@ -316,18 +342,19 @@ class AdbcDriver(
|
|
|
316
342
|
statement: The SQL statement to execute
|
|
317
343
|
|
|
318
344
|
Returns:
|
|
319
|
-
|
|
345
|
+
Number of rows affected
|
|
320
346
|
"""
|
|
321
347
|
try:
|
|
322
348
|
cursor.execute(statement)
|
|
323
349
|
except Exception as e:
|
|
324
|
-
# Rollback transaction on error for PostgreSQL to avoid
|
|
350
|
+
# Rollback transaction on error for PostgreSQL to avoid
|
|
351
|
+
# "current transaction is aborted" errors
|
|
325
352
|
if self.dialect == "postgres":
|
|
326
353
|
with contextlib.suppress(Exception):
|
|
327
354
|
cursor.execute("ROLLBACK")
|
|
328
355
|
raise e from e
|
|
329
356
|
else:
|
|
330
|
-
return
|
|
357
|
+
return cursor.rowcount or 0
|
|
331
358
|
|
|
332
359
|
def _fetch_arrow_table(self, sql: SQL, connection: "Optional[Any]" = None, **kwargs: Any) -> "ArrowResult":
|
|
333
360
|
"""ADBC native Arrow table fetching.
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"""ADBC-specific AST transformers for handling driver limitations."""
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
from sqlglot import exp
|
|
6
|
+
|
|
7
|
+
from sqlspec.protocols import ProcessorProtocol
|
|
8
|
+
from sqlspec.statement.pipelines.context import SQLProcessingContext
|
|
9
|
+
|
|
10
|
+
__all__ = ("AdbcPostgresTransformer",)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class AdbcPostgresTransformer(ProcessorProtocol):
|
|
14
|
+
"""Transformer to handle ADBC PostgreSQL driver limitations.
|
|
15
|
+
|
|
16
|
+
This transformer addresses specific issues with the ADBC PostgreSQL driver:
|
|
17
|
+
1. Empty parameter lists in executemany() causing "no parameter $1" errors
|
|
18
|
+
2. NULL parameters causing "Can't map Arrow type 'na' to Postgres type" errors
|
|
19
|
+
|
|
20
|
+
The transformer works at the AST level to properly handle these edge cases.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
def __init__(self) -> None:
|
|
24
|
+
self.has_placeholders = False
|
|
25
|
+
self.all_params_null = False
|
|
26
|
+
self.is_empty_params = False
|
|
27
|
+
self.has_null_params = False
|
|
28
|
+
self.null_param_indices: list[int] = []
|
|
29
|
+
|
|
30
|
+
def process(self, expression: Optional[exp.Expression], context: SQLProcessingContext) -> Optional[exp.Expression]:
|
|
31
|
+
"""Process the SQL expression to handle ADBC limitations."""
|
|
32
|
+
if not expression:
|
|
33
|
+
return expression
|
|
34
|
+
|
|
35
|
+
# Check if we have an empty parameter list for executemany
|
|
36
|
+
# Look at the merged_parameters in the context
|
|
37
|
+
params = context.merged_parameters
|
|
38
|
+
|
|
39
|
+
# For execute_many, check if we have an empty list
|
|
40
|
+
if isinstance(params, list) and len(params) == 0:
|
|
41
|
+
self.is_empty_params = True
|
|
42
|
+
|
|
43
|
+
# Check for NULL parameters
|
|
44
|
+
if params:
|
|
45
|
+
if isinstance(params, (list, tuple)):
|
|
46
|
+
# Track which parameters are NULL
|
|
47
|
+
self.null_param_indices = [i for i, p in enumerate(params) if p is None]
|
|
48
|
+
self.has_null_params = len(self.null_param_indices) > 0
|
|
49
|
+
self.all_params_null = len(self.null_param_indices) == len(params)
|
|
50
|
+
|
|
51
|
+
# For ADBC PostgreSQL, we need to replace NULL parameters with literals
|
|
52
|
+
# and remove them from the parameter list
|
|
53
|
+
if self.has_null_params:
|
|
54
|
+
# Create new parameter list without NULLs
|
|
55
|
+
new_params = [p for p in params if p is not None]
|
|
56
|
+
context.merged_parameters = new_params
|
|
57
|
+
|
|
58
|
+
elif isinstance(params, dict):
|
|
59
|
+
# For dict parameters, track which ones are NULL
|
|
60
|
+
null_keys = [k for k, v in params.items() if v is None]
|
|
61
|
+
self.has_null_params = len(null_keys) > 0
|
|
62
|
+
self.all_params_null = len(null_keys) == len(params)
|
|
63
|
+
|
|
64
|
+
if self.has_null_params:
|
|
65
|
+
# Remove NULL parameters from dict
|
|
66
|
+
context.merged_parameters = {k: v for k, v in params.items() if v is not None}
|
|
67
|
+
|
|
68
|
+
# Transform the AST if needed
|
|
69
|
+
if self.is_empty_params:
|
|
70
|
+
# For empty parameters, we should skip transformation and let the driver handle it
|
|
71
|
+
# The driver already has logic to return empty result for empty params
|
|
72
|
+
return expression
|
|
73
|
+
|
|
74
|
+
if self.has_null_params:
|
|
75
|
+
# Transform placeholders to NULL literals where needed
|
|
76
|
+
self._parameter_index = 0 # Track current parameter position
|
|
77
|
+
return expression.transform(self._transform_node)
|
|
78
|
+
|
|
79
|
+
return expression
|
|
80
|
+
|
|
81
|
+
def _transform_node(self, node: exp.Expression) -> exp.Expression:
|
|
82
|
+
"""Transform individual AST nodes."""
|
|
83
|
+
# Handle parameter nodes (e.g., $1, $2, etc. in PostgreSQL)
|
|
84
|
+
if isinstance(node, exp.Parameter):
|
|
85
|
+
# Access the parameter value directly from the AST node
|
|
86
|
+
# The 'this' attribute contains a Literal node, whose 'this' contains the actual value
|
|
87
|
+
if node.this and isinstance(node.this, exp.Literal):
|
|
88
|
+
try:
|
|
89
|
+
param_index = int(node.this.this) - 1 # Convert to 0-based index
|
|
90
|
+
# Check if this parameter should be NULL
|
|
91
|
+
if param_index in self.null_param_indices:
|
|
92
|
+
return exp.Null()
|
|
93
|
+
# Renumber the parameter based on how many NULLs came before it
|
|
94
|
+
nulls_before = sum(1 for idx in self.null_param_indices if idx < param_index)
|
|
95
|
+
new_index = param_index - nulls_before + 1 # Convert back to 1-based
|
|
96
|
+
return exp.Parameter(this=exp.Literal.number(new_index))
|
|
97
|
+
except (ValueError, IndexError):
|
|
98
|
+
pass
|
|
99
|
+
|
|
100
|
+
# Handle placeholder nodes for other dialects
|
|
101
|
+
elif isinstance(node, exp.Placeholder):
|
|
102
|
+
# For placeholders, we need to track position
|
|
103
|
+
if self._parameter_index in self.null_param_indices:
|
|
104
|
+
self._parameter_index += 1
|
|
105
|
+
return exp.Null()
|
|
106
|
+
self._parameter_index += 1
|
|
107
|
+
|
|
108
|
+
return node
|
|
@@ -16,8 +16,6 @@ from sqlspec.typing import DictRow, Empty
|
|
|
16
16
|
if TYPE_CHECKING:
|
|
17
17
|
from typing import Literal
|
|
18
18
|
|
|
19
|
-
from sqlglot.dialects.dialect import DialectType
|
|
20
|
-
|
|
21
19
|
|
|
22
20
|
__all__ = ("CONNECTION_FIELDS", "AiosqliteConfig")
|
|
23
21
|
|
|
@@ -34,21 +32,6 @@ class AiosqliteConfig(AsyncDatabaseConfig[AiosqliteConnection, None, AiosqliteDr
|
|
|
34
32
|
Note: Aiosqlite doesn't support connection pooling, so pool_instance is always None.
|
|
35
33
|
"""
|
|
36
34
|
|
|
37
|
-
__slots__ = (
|
|
38
|
-
"_dialect",
|
|
39
|
-
"cached_statements",
|
|
40
|
-
"check_same_thread",
|
|
41
|
-
"database",
|
|
42
|
-
"default_row_type",
|
|
43
|
-
"detect_types",
|
|
44
|
-
"extras",
|
|
45
|
-
"isolation_level",
|
|
46
|
-
"pool_instance",
|
|
47
|
-
"statement_config",
|
|
48
|
-
"timeout",
|
|
49
|
-
"uri",
|
|
50
|
-
)
|
|
51
|
-
|
|
52
35
|
is_async: ClassVar[bool] = True
|
|
53
36
|
supports_connection_pooling: ClassVar[bool] = False
|
|
54
37
|
|
|
@@ -59,7 +42,7 @@ class AiosqliteConfig(AsyncDatabaseConfig[AiosqliteConnection, None, AiosqliteDr
|
|
|
59
42
|
supported_parameter_styles: ClassVar[tuple[str, ...]] = ("qmark", "named_colon")
|
|
60
43
|
"""AIOSQLite supports ? (qmark) and :name (named_colon) parameter styles."""
|
|
61
44
|
|
|
62
|
-
|
|
45
|
+
default_parameter_style: ClassVar[str] = "qmark"
|
|
63
46
|
"""AIOSQLite's native parameter style is ? (qmark)."""
|
|
64
47
|
|
|
65
48
|
def __init__(
|
|
@@ -102,7 +85,6 @@ class AiosqliteConfig(AsyncDatabaseConfig[AiosqliteConnection, None, AiosqliteDr
|
|
|
102
85
|
# Store other config
|
|
103
86
|
self.statement_config = statement_config or SQLConfig()
|
|
104
87
|
self.default_row_type = default_row_type
|
|
105
|
-
self._dialect: DialectType = None
|
|
106
88
|
|
|
107
89
|
super().__init__()
|
|
108
90
|
|
|
@@ -179,7 +161,7 @@ class AiosqliteConfig(AsyncDatabaseConfig[AiosqliteConnection, None, AiosqliteDr
|
|
|
179
161
|
statement_config = replace(
|
|
180
162
|
statement_config,
|
|
181
163
|
allowed_parameter_styles=self.supported_parameter_styles,
|
|
182
|
-
|
|
164
|
+
default_parameter_style=self.default_parameter_style,
|
|
183
165
|
)
|
|
184
166
|
yield self.driver_type(connection=connection, config=statement_config)
|
|
185
167
|
|