sqlspec 0.32.0__py3-none-any.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.
- sqlspec/__init__.py +104 -0
- sqlspec/__main__.py +12 -0
- sqlspec/__metadata__.py +14 -0
- sqlspec/_serialization.py +312 -0
- sqlspec/_typing.py +784 -0
- sqlspec/adapters/__init__.py +0 -0
- sqlspec/adapters/adbc/__init__.py +5 -0
- sqlspec/adapters/adbc/_types.py +12 -0
- sqlspec/adapters/adbc/adk/__init__.py +5 -0
- sqlspec/adapters/adbc/adk/store.py +880 -0
- sqlspec/adapters/adbc/config.py +436 -0
- sqlspec/adapters/adbc/data_dictionary.py +537 -0
- sqlspec/adapters/adbc/driver.py +841 -0
- sqlspec/adapters/adbc/litestar/__init__.py +5 -0
- sqlspec/adapters/adbc/litestar/store.py +504 -0
- sqlspec/adapters/adbc/type_converter.py +153 -0
- sqlspec/adapters/aiosqlite/__init__.py +29 -0
- sqlspec/adapters/aiosqlite/_types.py +13 -0
- sqlspec/adapters/aiosqlite/adk/__init__.py +5 -0
- sqlspec/adapters/aiosqlite/adk/store.py +536 -0
- sqlspec/adapters/aiosqlite/config.py +310 -0
- sqlspec/adapters/aiosqlite/data_dictionary.py +260 -0
- sqlspec/adapters/aiosqlite/driver.py +463 -0
- sqlspec/adapters/aiosqlite/litestar/__init__.py +5 -0
- sqlspec/adapters/aiosqlite/litestar/store.py +281 -0
- sqlspec/adapters/aiosqlite/pool.py +500 -0
- sqlspec/adapters/asyncmy/__init__.py +25 -0
- sqlspec/adapters/asyncmy/_types.py +12 -0
- sqlspec/adapters/asyncmy/adk/__init__.py +5 -0
- sqlspec/adapters/asyncmy/adk/store.py +503 -0
- sqlspec/adapters/asyncmy/config.py +246 -0
- sqlspec/adapters/asyncmy/data_dictionary.py +241 -0
- sqlspec/adapters/asyncmy/driver.py +632 -0
- sqlspec/adapters/asyncmy/litestar/__init__.py +5 -0
- sqlspec/adapters/asyncmy/litestar/store.py +296 -0
- sqlspec/adapters/asyncpg/__init__.py +23 -0
- sqlspec/adapters/asyncpg/_type_handlers.py +76 -0
- sqlspec/adapters/asyncpg/_types.py +23 -0
- sqlspec/adapters/asyncpg/adk/__init__.py +5 -0
- sqlspec/adapters/asyncpg/adk/store.py +460 -0
- sqlspec/adapters/asyncpg/config.py +464 -0
- sqlspec/adapters/asyncpg/data_dictionary.py +321 -0
- sqlspec/adapters/asyncpg/driver.py +720 -0
- sqlspec/adapters/asyncpg/litestar/__init__.py +5 -0
- sqlspec/adapters/asyncpg/litestar/store.py +253 -0
- sqlspec/adapters/bigquery/__init__.py +18 -0
- sqlspec/adapters/bigquery/_types.py +12 -0
- sqlspec/adapters/bigquery/adk/__init__.py +5 -0
- sqlspec/adapters/bigquery/adk/store.py +585 -0
- sqlspec/adapters/bigquery/config.py +298 -0
- sqlspec/adapters/bigquery/data_dictionary.py +256 -0
- sqlspec/adapters/bigquery/driver.py +1073 -0
- sqlspec/adapters/bigquery/litestar/__init__.py +5 -0
- sqlspec/adapters/bigquery/litestar/store.py +327 -0
- sqlspec/adapters/bigquery/type_converter.py +125 -0
- sqlspec/adapters/duckdb/__init__.py +24 -0
- sqlspec/adapters/duckdb/_types.py +12 -0
- sqlspec/adapters/duckdb/adk/__init__.py +14 -0
- sqlspec/adapters/duckdb/adk/store.py +563 -0
- sqlspec/adapters/duckdb/config.py +396 -0
- sqlspec/adapters/duckdb/data_dictionary.py +264 -0
- sqlspec/adapters/duckdb/driver.py +604 -0
- sqlspec/adapters/duckdb/litestar/__init__.py +5 -0
- sqlspec/adapters/duckdb/litestar/store.py +332 -0
- sqlspec/adapters/duckdb/pool.py +273 -0
- sqlspec/adapters/duckdb/type_converter.py +133 -0
- sqlspec/adapters/oracledb/__init__.py +32 -0
- sqlspec/adapters/oracledb/_numpy_handlers.py +133 -0
- sqlspec/adapters/oracledb/_types.py +39 -0
- sqlspec/adapters/oracledb/_uuid_handlers.py +130 -0
- sqlspec/adapters/oracledb/adk/__init__.py +5 -0
- sqlspec/adapters/oracledb/adk/store.py +1632 -0
- sqlspec/adapters/oracledb/config.py +469 -0
- sqlspec/adapters/oracledb/data_dictionary.py +717 -0
- sqlspec/adapters/oracledb/driver.py +1493 -0
- sqlspec/adapters/oracledb/litestar/__init__.py +5 -0
- sqlspec/adapters/oracledb/litestar/store.py +765 -0
- sqlspec/adapters/oracledb/migrations.py +532 -0
- sqlspec/adapters/oracledb/type_converter.py +207 -0
- sqlspec/adapters/psqlpy/__init__.py +16 -0
- sqlspec/adapters/psqlpy/_type_handlers.py +44 -0
- sqlspec/adapters/psqlpy/_types.py +12 -0
- sqlspec/adapters/psqlpy/adk/__init__.py +5 -0
- sqlspec/adapters/psqlpy/adk/store.py +483 -0
- sqlspec/adapters/psqlpy/config.py +271 -0
- sqlspec/adapters/psqlpy/data_dictionary.py +179 -0
- sqlspec/adapters/psqlpy/driver.py +892 -0
- sqlspec/adapters/psqlpy/litestar/__init__.py +5 -0
- sqlspec/adapters/psqlpy/litestar/store.py +272 -0
- sqlspec/adapters/psqlpy/type_converter.py +102 -0
- sqlspec/adapters/psycopg/__init__.py +32 -0
- sqlspec/adapters/psycopg/_type_handlers.py +90 -0
- sqlspec/adapters/psycopg/_types.py +18 -0
- sqlspec/adapters/psycopg/adk/__init__.py +5 -0
- sqlspec/adapters/psycopg/adk/store.py +962 -0
- sqlspec/adapters/psycopg/config.py +487 -0
- sqlspec/adapters/psycopg/data_dictionary.py +630 -0
- sqlspec/adapters/psycopg/driver.py +1336 -0
- sqlspec/adapters/psycopg/litestar/__init__.py +5 -0
- sqlspec/adapters/psycopg/litestar/store.py +554 -0
- sqlspec/adapters/spanner/__init__.py +38 -0
- sqlspec/adapters/spanner/_type_handlers.py +186 -0
- sqlspec/adapters/spanner/_types.py +12 -0
- sqlspec/adapters/spanner/adk/__init__.py +5 -0
- sqlspec/adapters/spanner/adk/store.py +435 -0
- sqlspec/adapters/spanner/config.py +241 -0
- sqlspec/adapters/spanner/data_dictionary.py +95 -0
- sqlspec/adapters/spanner/dialect/__init__.py +6 -0
- sqlspec/adapters/spanner/dialect/_spangres.py +52 -0
- sqlspec/adapters/spanner/dialect/_spanner.py +123 -0
- sqlspec/adapters/spanner/driver.py +366 -0
- sqlspec/adapters/spanner/litestar/__init__.py +5 -0
- sqlspec/adapters/spanner/litestar/store.py +266 -0
- sqlspec/adapters/spanner/type_converter.py +46 -0
- sqlspec/adapters/sqlite/__init__.py +18 -0
- sqlspec/adapters/sqlite/_type_handlers.py +86 -0
- sqlspec/adapters/sqlite/_types.py +11 -0
- sqlspec/adapters/sqlite/adk/__init__.py +5 -0
- sqlspec/adapters/sqlite/adk/store.py +582 -0
- sqlspec/adapters/sqlite/config.py +221 -0
- sqlspec/adapters/sqlite/data_dictionary.py +256 -0
- sqlspec/adapters/sqlite/driver.py +527 -0
- sqlspec/adapters/sqlite/litestar/__init__.py +5 -0
- sqlspec/adapters/sqlite/litestar/store.py +318 -0
- sqlspec/adapters/sqlite/pool.py +140 -0
- sqlspec/base.py +811 -0
- sqlspec/builder/__init__.py +146 -0
- sqlspec/builder/_base.py +900 -0
- sqlspec/builder/_column.py +517 -0
- sqlspec/builder/_ddl.py +1642 -0
- sqlspec/builder/_delete.py +84 -0
- sqlspec/builder/_dml.py +381 -0
- sqlspec/builder/_expression_wrappers.py +46 -0
- sqlspec/builder/_factory.py +1537 -0
- sqlspec/builder/_insert.py +315 -0
- sqlspec/builder/_join.py +375 -0
- sqlspec/builder/_merge.py +848 -0
- sqlspec/builder/_parsing_utils.py +297 -0
- sqlspec/builder/_select.py +1615 -0
- sqlspec/builder/_update.py +161 -0
- sqlspec/builder/_vector_expressions.py +259 -0
- sqlspec/cli.py +764 -0
- sqlspec/config.py +1540 -0
- sqlspec/core/__init__.py +305 -0
- sqlspec/core/cache.py +785 -0
- sqlspec/core/compiler.py +603 -0
- sqlspec/core/filters.py +872 -0
- sqlspec/core/hashing.py +274 -0
- sqlspec/core/metrics.py +83 -0
- sqlspec/core/parameters/__init__.py +64 -0
- sqlspec/core/parameters/_alignment.py +266 -0
- sqlspec/core/parameters/_converter.py +413 -0
- sqlspec/core/parameters/_processor.py +341 -0
- sqlspec/core/parameters/_registry.py +201 -0
- sqlspec/core/parameters/_transformers.py +226 -0
- sqlspec/core/parameters/_types.py +430 -0
- sqlspec/core/parameters/_validator.py +123 -0
- sqlspec/core/pipeline.py +187 -0
- sqlspec/core/result.py +1124 -0
- sqlspec/core/splitter.py +940 -0
- sqlspec/core/stack.py +163 -0
- sqlspec/core/statement.py +835 -0
- sqlspec/core/type_conversion.py +235 -0
- sqlspec/driver/__init__.py +36 -0
- sqlspec/driver/_async.py +1027 -0
- sqlspec/driver/_common.py +1236 -0
- sqlspec/driver/_sync.py +1025 -0
- sqlspec/driver/mixins/__init__.py +7 -0
- sqlspec/driver/mixins/_result_tools.py +61 -0
- sqlspec/driver/mixins/_sql_translator.py +122 -0
- sqlspec/driver/mixins/_storage.py +311 -0
- sqlspec/exceptions.py +321 -0
- sqlspec/extensions/__init__.py +0 -0
- sqlspec/extensions/adk/__init__.py +53 -0
- sqlspec/extensions/adk/_types.py +51 -0
- sqlspec/extensions/adk/converters.py +172 -0
- sqlspec/extensions/adk/migrations/0001_create_adk_tables.py +144 -0
- sqlspec/extensions/adk/migrations/__init__.py +0 -0
- sqlspec/extensions/adk/service.py +181 -0
- sqlspec/extensions/adk/store.py +536 -0
- sqlspec/extensions/aiosql/__init__.py +10 -0
- sqlspec/extensions/aiosql/adapter.py +471 -0
- sqlspec/extensions/fastapi/__init__.py +19 -0
- sqlspec/extensions/fastapi/extension.py +341 -0
- sqlspec/extensions/fastapi/providers.py +543 -0
- sqlspec/extensions/flask/__init__.py +36 -0
- sqlspec/extensions/flask/_state.py +72 -0
- sqlspec/extensions/flask/_utils.py +40 -0
- sqlspec/extensions/flask/extension.py +402 -0
- sqlspec/extensions/litestar/__init__.py +23 -0
- sqlspec/extensions/litestar/_utils.py +52 -0
- sqlspec/extensions/litestar/cli.py +92 -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 +638 -0
- sqlspec/extensions/litestar/providers.py +454 -0
- sqlspec/extensions/litestar/store.py +265 -0
- sqlspec/extensions/otel/__init__.py +58 -0
- sqlspec/extensions/prometheus/__init__.py +107 -0
- sqlspec/extensions/starlette/__init__.py +10 -0
- sqlspec/extensions/starlette/_state.py +26 -0
- sqlspec/extensions/starlette/_utils.py +52 -0
- sqlspec/extensions/starlette/extension.py +257 -0
- sqlspec/extensions/starlette/middleware.py +154 -0
- sqlspec/loader.py +716 -0
- sqlspec/migrations/__init__.py +36 -0
- sqlspec/migrations/base.py +728 -0
- sqlspec/migrations/commands.py +1140 -0
- sqlspec/migrations/context.py +142 -0
- sqlspec/migrations/fix.py +203 -0
- sqlspec/migrations/loaders.py +450 -0
- sqlspec/migrations/runner.py +1024 -0
- sqlspec/migrations/templates.py +234 -0
- sqlspec/migrations/tracker.py +403 -0
- sqlspec/migrations/utils.py +256 -0
- sqlspec/migrations/validation.py +203 -0
- sqlspec/observability/__init__.py +22 -0
- sqlspec/observability/_config.py +228 -0
- sqlspec/observability/_diagnostics.py +67 -0
- sqlspec/observability/_dispatcher.py +151 -0
- sqlspec/observability/_observer.py +180 -0
- sqlspec/observability/_runtime.py +381 -0
- sqlspec/observability/_spans.py +158 -0
- sqlspec/protocols.py +530 -0
- sqlspec/py.typed +0 -0
- sqlspec/storage/__init__.py +46 -0
- sqlspec/storage/_utils.py +104 -0
- sqlspec/storage/backends/__init__.py +1 -0
- sqlspec/storage/backends/base.py +163 -0
- sqlspec/storage/backends/fsspec.py +398 -0
- sqlspec/storage/backends/local.py +377 -0
- sqlspec/storage/backends/obstore.py +580 -0
- sqlspec/storage/errors.py +104 -0
- sqlspec/storage/pipeline.py +604 -0
- sqlspec/storage/registry.py +289 -0
- sqlspec/typing.py +219 -0
- sqlspec/utils/__init__.py +31 -0
- sqlspec/utils/arrow_helpers.py +95 -0
- sqlspec/utils/config_resolver.py +153 -0
- sqlspec/utils/correlation.py +132 -0
- sqlspec/utils/data_transformation.py +114 -0
- sqlspec/utils/dependencies.py +79 -0
- sqlspec/utils/deprecation.py +113 -0
- sqlspec/utils/fixtures.py +250 -0
- sqlspec/utils/logging.py +172 -0
- sqlspec/utils/module_loader.py +273 -0
- sqlspec/utils/portal.py +325 -0
- sqlspec/utils/schema.py +288 -0
- sqlspec/utils/serializers.py +396 -0
- sqlspec/utils/singleton.py +41 -0
- sqlspec/utils/sync_tools.py +277 -0
- sqlspec/utils/text.py +108 -0
- sqlspec/utils/type_converters.py +99 -0
- sqlspec/utils/type_guards.py +1324 -0
- sqlspec/utils/version.py +444 -0
- sqlspec-0.32.0.dist-info/METADATA +202 -0
- sqlspec-0.32.0.dist-info/RECORD +262 -0
- sqlspec-0.32.0.dist-info/WHEEL +4 -0
- sqlspec-0.32.0.dist-info/entry_points.txt +2 -0
- sqlspec-0.32.0.dist-info/licenses/LICENSE +21 -0
sqlspec/core/__init__.py
ADDED
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
"""SQLSpec Core Module - SQL Processing System.
|
|
2
|
+
|
|
3
|
+
This module provides the core SQL processing infrastructure for SQLSpec, implementing
|
|
4
|
+
a complete pipeline for SQL statement compilation, parameter processing, caching,
|
|
5
|
+
and result management. All components are optimized for MyPyC compilation to
|
|
6
|
+
reduce overhead.
|
|
7
|
+
|
|
8
|
+
Architecture Overview:
|
|
9
|
+
The core module implements a single-pass processing pipeline where SQL statements
|
|
10
|
+
are parsed once, transformed once, and validated once. The SQL object serves as
|
|
11
|
+
the single source of truth throughout the system.
|
|
12
|
+
|
|
13
|
+
Key Components:
|
|
14
|
+
statement.py: SQL statement representation and configuration management
|
|
15
|
+
- SQL class for statement encapsulation with lazy compilation
|
|
16
|
+
- StatementConfig for processing pipeline configuration
|
|
17
|
+
- ProcessedState for cached compilation results
|
|
18
|
+
- Support for execute_many and script execution modes
|
|
19
|
+
|
|
20
|
+
parameters.py: Type-safe parameter processing and style conversion
|
|
21
|
+
- Automatic parameter style detection and conversion
|
|
22
|
+
- Support for QMARK (?), NAMED (:name), NUMERIC ($1), FORMAT (%s) styles
|
|
23
|
+
- Parameter validation and type coercion
|
|
24
|
+
- Batch parameter handling for execute_many operations
|
|
25
|
+
|
|
26
|
+
compiler.py: SQL compilation with validation and optimization
|
|
27
|
+
- SQLProcessor for statement compilation and validation
|
|
28
|
+
- Operation type detection (SELECT, INSERT, UPDATE, DELETE, etc.)
|
|
29
|
+
- AST-based SQL analysis using SQLGlot
|
|
30
|
+
- Support for multiple SQL dialects
|
|
31
|
+
- Compiled result caching for performance
|
|
32
|
+
|
|
33
|
+
result.py: Comprehensive result handling for all SQL operations
|
|
34
|
+
- SQLResult for standard query results with metadata
|
|
35
|
+
- ArrowResult for Apache Arrow format integration
|
|
36
|
+
- Support for DML operations with RETURNING clauses
|
|
37
|
+
- Script execution result aggregation
|
|
38
|
+
- Iterator protocol support for result rows
|
|
39
|
+
|
|
40
|
+
filters.py: Composable SQL statement filters
|
|
41
|
+
- BeforeAfterFilter for date range filtering
|
|
42
|
+
- InCollectionFilter for IN clause generation
|
|
43
|
+
- LimitOffsetFilter for pagination
|
|
44
|
+
- OrderByFilter for dynamic sorting
|
|
45
|
+
- SearchFilter for text search operations
|
|
46
|
+
- Parameter conflict resolution
|
|
47
|
+
|
|
48
|
+
cache.py: Unified caching system with LRU eviction
|
|
49
|
+
- UnifiedCache with configurable TTL and size limits
|
|
50
|
+
- StatementCache for compiled SQL statements
|
|
51
|
+
- ExpressionCache for parsed SQLGlot expressions
|
|
52
|
+
- ParameterCache for processed parameters
|
|
53
|
+
- Thread-safe operations with fine-grained locking
|
|
54
|
+
- Cache statistics and monitoring
|
|
55
|
+
|
|
56
|
+
splitter.py: Dialect-aware SQL script splitting
|
|
57
|
+
- Support for Oracle PL/SQL, T-SQL, PostgreSQL, MySQL
|
|
58
|
+
- Proper handling of block structures (BEGIN/END)
|
|
59
|
+
- Dollar-quoted string support for PostgreSQL
|
|
60
|
+
- Batch separator recognition (GO for T-SQL)
|
|
61
|
+
- Comment and string literal preservation
|
|
62
|
+
|
|
63
|
+
hashing.py: Efficient cache key generation
|
|
64
|
+
- SQL statement hashing with parameter consideration
|
|
65
|
+
- Expression tree hashing for AST caching
|
|
66
|
+
- Parameter set hashing for batch operations
|
|
67
|
+
- Optimized hash computation with caching
|
|
68
|
+
|
|
69
|
+
Performance Optimizations:
|
|
70
|
+
- MyPyC compilation support with proper annotations
|
|
71
|
+
- __slots__ usage for memory efficiency
|
|
72
|
+
- Final annotations for constant folding
|
|
73
|
+
- Lazy evaluation and compilation
|
|
74
|
+
- Comprehensive result caching
|
|
75
|
+
- Minimal object allocation in hot paths
|
|
76
|
+
|
|
77
|
+
Thread Safety:
|
|
78
|
+
All caching components are thread-safe with RLock protection.
|
|
79
|
+
The processing pipeline is stateless and safe for concurrent use.
|
|
80
|
+
|
|
81
|
+
Example Usage:
|
|
82
|
+
>>> from sqlspec.core import SQL, StatementConfig
|
|
83
|
+
>>> config = StatementConfig(dialect="postgresql")
|
|
84
|
+
>>> stmt = SQL(
|
|
85
|
+
... "SELECT * FROM users WHERE id = ?",
|
|
86
|
+
... 1,
|
|
87
|
+
... statement_config=config,
|
|
88
|
+
... )
|
|
89
|
+
>>> compiled_sql, params = stmt.compile()
|
|
90
|
+
"""
|
|
91
|
+
|
|
92
|
+
from sqlspec.core import filters
|
|
93
|
+
from sqlspec.core.cache import (
|
|
94
|
+
CacheConfig,
|
|
95
|
+
CachedStatement,
|
|
96
|
+
CacheKey,
|
|
97
|
+
CacheStats,
|
|
98
|
+
FiltersView,
|
|
99
|
+
MultiLevelCache,
|
|
100
|
+
ParametersView,
|
|
101
|
+
UnifiedCache,
|
|
102
|
+
canonicalize_filters,
|
|
103
|
+
clear_all_caches,
|
|
104
|
+
create_cache_key,
|
|
105
|
+
get_cache,
|
|
106
|
+
get_cache_config,
|
|
107
|
+
get_cache_statistics,
|
|
108
|
+
get_cache_stats,
|
|
109
|
+
get_default_cache,
|
|
110
|
+
get_pipeline_metrics,
|
|
111
|
+
log_cache_stats,
|
|
112
|
+
reset_cache_stats,
|
|
113
|
+
reset_pipeline_registry,
|
|
114
|
+
update_cache_config,
|
|
115
|
+
)
|
|
116
|
+
from sqlspec.core.compiler import (
|
|
117
|
+
CompiledSQL,
|
|
118
|
+
OperationProfile,
|
|
119
|
+
OperationType,
|
|
120
|
+
SQLProcessor,
|
|
121
|
+
is_copy_from_operation,
|
|
122
|
+
is_copy_operation,
|
|
123
|
+
is_copy_to_operation,
|
|
124
|
+
)
|
|
125
|
+
from sqlspec.core.filters import (
|
|
126
|
+
AnyCollectionFilter,
|
|
127
|
+
BeforeAfterFilter,
|
|
128
|
+
FilterTypes,
|
|
129
|
+
FilterTypeT,
|
|
130
|
+
InCollectionFilter,
|
|
131
|
+
LimitOffsetFilter,
|
|
132
|
+
NotInCollectionFilter,
|
|
133
|
+
OrderByFilter,
|
|
134
|
+
SearchFilter,
|
|
135
|
+
StatementFilter,
|
|
136
|
+
apply_filter,
|
|
137
|
+
)
|
|
138
|
+
from sqlspec.core.hashing import (
|
|
139
|
+
hash_expression,
|
|
140
|
+
hash_expression_node,
|
|
141
|
+
hash_filters,
|
|
142
|
+
hash_optimized_expression,
|
|
143
|
+
hash_parameters,
|
|
144
|
+
hash_sql_statement,
|
|
145
|
+
)
|
|
146
|
+
from sqlspec.core.metrics import StackExecutionMetrics
|
|
147
|
+
from sqlspec.core.parameters import (
|
|
148
|
+
DRIVER_PARAMETER_PROFILES,
|
|
149
|
+
EXECUTE_MANY_MIN_ROWS,
|
|
150
|
+
PARAMETER_REGEX,
|
|
151
|
+
DriverParameterProfile,
|
|
152
|
+
ParameterConverter,
|
|
153
|
+
ParameterInfo,
|
|
154
|
+
ParameterProcessingResult,
|
|
155
|
+
ParameterProcessor,
|
|
156
|
+
ParameterProfile,
|
|
157
|
+
ParameterStyle,
|
|
158
|
+
ParameterStyleConfig,
|
|
159
|
+
ParameterValidator,
|
|
160
|
+
TypedParameter,
|
|
161
|
+
build_literal_inlining_transform,
|
|
162
|
+
build_null_pruning_transform,
|
|
163
|
+
build_statement_config_from_profile,
|
|
164
|
+
collect_null_parameter_ordinals,
|
|
165
|
+
get_driver_profile,
|
|
166
|
+
is_iterable_parameters,
|
|
167
|
+
looks_like_execute_many,
|
|
168
|
+
normalize_parameter_key,
|
|
169
|
+
register_driver_profile,
|
|
170
|
+
replace_null_parameters_with_literals,
|
|
171
|
+
replace_placeholders_with_literals,
|
|
172
|
+
validate_parameter_alignment,
|
|
173
|
+
wrap_with_type,
|
|
174
|
+
)
|
|
175
|
+
from sqlspec.core.result import (
|
|
176
|
+
ArrowResult,
|
|
177
|
+
SQLResult,
|
|
178
|
+
StackResult,
|
|
179
|
+
StatementResult,
|
|
180
|
+
create_arrow_result,
|
|
181
|
+
create_sql_result,
|
|
182
|
+
)
|
|
183
|
+
from sqlspec.core.splitter import split_sql_script
|
|
184
|
+
from sqlspec.core.stack import StackOperation, StatementStack
|
|
185
|
+
from sqlspec.core.statement import (
|
|
186
|
+
SQL,
|
|
187
|
+
ProcessedState,
|
|
188
|
+
Statement,
|
|
189
|
+
StatementConfig,
|
|
190
|
+
get_default_config,
|
|
191
|
+
get_default_parameter_config,
|
|
192
|
+
)
|
|
193
|
+
from sqlspec.core.type_conversion import (
|
|
194
|
+
BaseTypeConverter,
|
|
195
|
+
convert_decimal,
|
|
196
|
+
convert_iso_date,
|
|
197
|
+
convert_iso_datetime,
|
|
198
|
+
convert_iso_time,
|
|
199
|
+
convert_json,
|
|
200
|
+
convert_uuid,
|
|
201
|
+
format_datetime_rfc3339,
|
|
202
|
+
parse_datetime_rfc3339,
|
|
203
|
+
)
|
|
204
|
+
from sqlspec.exceptions import StackExecutionError
|
|
205
|
+
|
|
206
|
+
__all__ = (
|
|
207
|
+
"DRIVER_PARAMETER_PROFILES",
|
|
208
|
+
"EXECUTE_MANY_MIN_ROWS",
|
|
209
|
+
"PARAMETER_REGEX",
|
|
210
|
+
"SQL",
|
|
211
|
+
"AnyCollectionFilter",
|
|
212
|
+
"ArrowResult",
|
|
213
|
+
"BaseTypeConverter",
|
|
214
|
+
"BeforeAfterFilter",
|
|
215
|
+
"CacheConfig",
|
|
216
|
+
"CacheKey",
|
|
217
|
+
"CacheStats",
|
|
218
|
+
"CachedStatement",
|
|
219
|
+
"CompiledSQL",
|
|
220
|
+
"DriverParameterProfile",
|
|
221
|
+
"FilterTypeT",
|
|
222
|
+
"FilterTypes",
|
|
223
|
+
"FiltersView",
|
|
224
|
+
"InCollectionFilter",
|
|
225
|
+
"LimitOffsetFilter",
|
|
226
|
+
"MultiLevelCache",
|
|
227
|
+
"NotInCollectionFilter",
|
|
228
|
+
"OperationProfile",
|
|
229
|
+
"OperationType",
|
|
230
|
+
"OrderByFilter",
|
|
231
|
+
"ParameterConverter",
|
|
232
|
+
"ParameterInfo",
|
|
233
|
+
"ParameterProcessingResult",
|
|
234
|
+
"ParameterProcessor",
|
|
235
|
+
"ParameterProfile",
|
|
236
|
+
"ParameterStyle",
|
|
237
|
+
"ParameterStyleConfig",
|
|
238
|
+
"ParameterValidator",
|
|
239
|
+
"ParametersView",
|
|
240
|
+
"ProcessedState",
|
|
241
|
+
"SQLProcessor",
|
|
242
|
+
"SQLResult",
|
|
243
|
+
"SearchFilter",
|
|
244
|
+
"StackExecutionError",
|
|
245
|
+
"StackExecutionMetrics",
|
|
246
|
+
"StackOperation",
|
|
247
|
+
"StackResult",
|
|
248
|
+
"Statement",
|
|
249
|
+
"StatementConfig",
|
|
250
|
+
"StatementFilter",
|
|
251
|
+
"StatementResult",
|
|
252
|
+
"StatementStack",
|
|
253
|
+
"TypedParameter",
|
|
254
|
+
"UnifiedCache",
|
|
255
|
+
"apply_filter",
|
|
256
|
+
"build_literal_inlining_transform",
|
|
257
|
+
"build_null_pruning_transform",
|
|
258
|
+
"build_statement_config_from_profile",
|
|
259
|
+
"canonicalize_filters",
|
|
260
|
+
"clear_all_caches",
|
|
261
|
+
"collect_null_parameter_ordinals",
|
|
262
|
+
"convert_decimal",
|
|
263
|
+
"convert_iso_date",
|
|
264
|
+
"convert_iso_datetime",
|
|
265
|
+
"convert_iso_time",
|
|
266
|
+
"convert_json",
|
|
267
|
+
"convert_uuid",
|
|
268
|
+
"create_arrow_result",
|
|
269
|
+
"create_cache_key",
|
|
270
|
+
"create_sql_result",
|
|
271
|
+
"filters",
|
|
272
|
+
"format_datetime_rfc3339",
|
|
273
|
+
"get_cache",
|
|
274
|
+
"get_cache_config",
|
|
275
|
+
"get_cache_statistics",
|
|
276
|
+
"get_cache_stats",
|
|
277
|
+
"get_default_cache",
|
|
278
|
+
"get_default_config",
|
|
279
|
+
"get_default_parameter_config",
|
|
280
|
+
"get_driver_profile",
|
|
281
|
+
"get_pipeline_metrics",
|
|
282
|
+
"hash_expression",
|
|
283
|
+
"hash_expression_node",
|
|
284
|
+
"hash_filters",
|
|
285
|
+
"hash_optimized_expression",
|
|
286
|
+
"hash_parameters",
|
|
287
|
+
"hash_sql_statement",
|
|
288
|
+
"is_copy_from_operation",
|
|
289
|
+
"is_copy_operation",
|
|
290
|
+
"is_copy_to_operation",
|
|
291
|
+
"is_iterable_parameters",
|
|
292
|
+
"log_cache_stats",
|
|
293
|
+
"looks_like_execute_many",
|
|
294
|
+
"normalize_parameter_key",
|
|
295
|
+
"parse_datetime_rfc3339",
|
|
296
|
+
"register_driver_profile",
|
|
297
|
+
"replace_null_parameters_with_literals",
|
|
298
|
+
"replace_placeholders_with_literals",
|
|
299
|
+
"reset_cache_stats",
|
|
300
|
+
"reset_pipeline_registry",
|
|
301
|
+
"split_sql_script",
|
|
302
|
+
"update_cache_config",
|
|
303
|
+
"validate_parameter_alignment",
|
|
304
|
+
"wrap_with_type",
|
|
305
|
+
)
|