sqlspec 0.24.1__tar.gz → 0.25.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of sqlspec might be problematic. Click here for more details.

Files changed (335) hide show
  1. {sqlspec-0.24.1 → sqlspec-0.25.0}/PKG-INFO +1 -1
  2. {sqlspec-0.24.1 → sqlspec-0.25.0}/pyproject.toml +3 -3
  3. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/_sql.py +11 -15
  4. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/_typing.py +2 -0
  5. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/adbc/driver.py +2 -2
  6. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/oracledb/driver.py +5 -0
  7. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/psycopg/config.py +2 -4
  8. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/base.py +3 -4
  9. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/builder/_base.py +55 -13
  10. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/builder/_column.py +9 -0
  11. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/builder/_ddl.py +7 -7
  12. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/builder/_insert.py +10 -6
  13. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/builder/_parsing_utils.py +23 -4
  14. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/builder/_update.py +1 -1
  15. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/builder/mixins/_cte_and_set_ops.py +31 -22
  16. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/builder/mixins/_delete_operations.py +12 -7
  17. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/builder/mixins/_insert_operations.py +50 -36
  18. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/builder/mixins/_join_operations.py +1 -0
  19. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/builder/mixins/_merge_operations.py +54 -28
  20. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/builder/mixins/_order_limit_operations.py +1 -0
  21. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/builder/mixins/_pivot_operations.py +1 -0
  22. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/builder/mixins/_select_operations.py +42 -14
  23. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/builder/mixins/_update_operations.py +30 -18
  24. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/builder/mixins/_where_clause.py +48 -60
  25. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/core/__init__.py +3 -2
  26. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/core/cache.py +297 -351
  27. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/core/compiler.py +5 -3
  28. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/core/filters.py +246 -213
  29. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/core/hashing.py +9 -11
  30. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/core/parameters.py +20 -7
  31. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/core/statement.py +67 -12
  32. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/driver/_async.py +2 -2
  33. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/driver/_common.py +31 -14
  34. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/driver/_sync.py +2 -2
  35. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/driver/mixins/_result_tools.py +60 -7
  36. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/loader.py +8 -9
  37. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/storage/backends/fsspec.py +1 -0
  38. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/typing.py +2 -0
  39. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_adbc/test_parameter_styles.py +1 -0
  40. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_aiosqlite/test_connection.py +1 -0
  41. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_aiosqlite/test_pooling.py +1 -0
  42. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_duckdb/test_connection.py +1 -0
  43. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_sqlite/test_pooling.py +1 -0
  44. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_adapters/test_async_adapters.py +1 -0
  45. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_adapters/test_sync_adapters.py +1 -0
  46. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_base/test_sql_integration.py +1 -0
  47. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_base/test_sqlspec_class.py +28 -27
  48. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_core/test_cache.py +74 -280
  49. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_core/test_compiler.py +1 -0
  50. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_core/test_hashing.py +35 -34
  51. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_core/test_parameters.py +161 -0
  52. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_core/test_statement.py +2 -0
  53. sqlspec-0.25.0/tests/unit/test_driver/test_result_tools.py +355 -0
  54. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_loader/test_cache_integration.py +21 -9
  55. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_loader/test_sql_file_loader.py +1 -0
  56. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_migrations/test_migration.py +2 -0
  57. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_migrations/test_migration_commands.py +2 -0
  58. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_migrations/test_migration_execution.py +2 -0
  59. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_migrations/test_migration_runner.py +1 -0
  60. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_storage/test_local_store.py +2 -0
  61. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_storage/test_storage_registry.py +1 -0
  62. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_utils/test_fixtures.py +1 -0
  63. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_utils/test_singleton.py +2 -0
  64. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_utils/test_sync_tools.py +2 -0
  65. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_utils/test_type_guards.py +25 -12
  66. sqlspec-0.25.0/tools/__init__.py +0 -0
  67. {sqlspec-0.24.1 → sqlspec-0.25.0}/uv.lock +137 -133
  68. {sqlspec-0.24.1 → sqlspec-0.25.0}/.gitignore +0 -0
  69. {sqlspec-0.24.1 → sqlspec-0.25.0}/.pre-commit-config.yaml +0 -0
  70. {sqlspec-0.24.1 → sqlspec-0.25.0}/CONTRIBUTING.rst +0 -0
  71. {sqlspec-0.24.1 → sqlspec-0.25.0}/LICENSE +0 -0
  72. {sqlspec-0.24.1 → sqlspec-0.25.0}/Makefile +0 -0
  73. {sqlspec-0.24.1 → sqlspec-0.25.0}/NOTICE +0 -0
  74. {sqlspec-0.24.1 → sqlspec-0.25.0}/README.md +0 -0
  75. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/__init__.py +0 -0
  76. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/__main__.py +0 -0
  77. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/__metadata__.py +0 -0
  78. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/_serialization.py +0 -0
  79. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/__init__.py +0 -0
  80. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/adbc/__init__.py +0 -0
  81. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/adbc/_types.py +0 -0
  82. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/adbc/config.py +0 -0
  83. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/aiosqlite/__init__.py +0 -0
  84. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/aiosqlite/_types.py +0 -0
  85. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/aiosqlite/config.py +0 -0
  86. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/aiosqlite/driver.py +0 -0
  87. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/aiosqlite/pool.py +0 -0
  88. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/asyncmy/__init__.py +0 -0
  89. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/asyncmy/_types.py +0 -0
  90. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/asyncmy/config.py +0 -0
  91. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/asyncmy/driver.py +0 -0
  92. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/asyncpg/__init__.py +0 -0
  93. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/asyncpg/_types.py +0 -0
  94. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/asyncpg/config.py +0 -0
  95. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/asyncpg/driver.py +0 -0
  96. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/bigquery/__init__.py +0 -0
  97. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/bigquery/_types.py +0 -0
  98. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/bigquery/config.py +0 -0
  99. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/bigquery/driver.py +0 -0
  100. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/duckdb/__init__.py +0 -0
  101. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/duckdb/_types.py +0 -0
  102. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/duckdb/config.py +0 -0
  103. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/duckdb/driver.py +0 -0
  104. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/duckdb/pool.py +0 -0
  105. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/oracledb/__init__.py +0 -0
  106. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/oracledb/_types.py +0 -0
  107. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/oracledb/config.py +0 -0
  108. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/oracledb/migrations.py +0 -0
  109. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/psqlpy/__init__.py +0 -0
  110. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/psqlpy/_types.py +0 -0
  111. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/psqlpy/config.py +0 -0
  112. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/psqlpy/driver.py +0 -0
  113. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/psycopg/__init__.py +0 -0
  114. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/psycopg/_types.py +0 -0
  115. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/psycopg/driver.py +0 -0
  116. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/sqlite/__init__.py +0 -0
  117. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/sqlite/_types.py +0 -0
  118. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/sqlite/config.py +0 -0
  119. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/sqlite/driver.py +0 -0
  120. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/adapters/sqlite/pool.py +0 -0
  121. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/builder/__init__.py +0 -0
  122. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/builder/_delete.py +0 -0
  123. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/builder/_expression_wrappers.py +0 -0
  124. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/builder/_merge.py +0 -0
  125. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/builder/_select.py +0 -0
  126. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/builder/mixins/__init__.py +0 -0
  127. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/cli.py +0 -0
  128. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/config.py +0 -0
  129. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/core/result.py +0 -0
  130. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/core/splitter.py +0 -0
  131. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/driver/__init__.py +0 -0
  132. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/driver/mixins/__init__.py +0 -0
  133. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/driver/mixins/_sql_translator.py +0 -0
  134. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/exceptions.py +0 -0
  135. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/extensions/__init__.py +0 -0
  136. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/extensions/aiosql/__init__.py +0 -0
  137. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/extensions/aiosql/adapter.py +0 -0
  138. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/extensions/litestar/__init__.py +0 -0
  139. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/extensions/litestar/_utils.py +0 -0
  140. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/extensions/litestar/cli.py +0 -0
  141. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/extensions/litestar/config.py +0 -0
  142. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/extensions/litestar/handlers.py +0 -0
  143. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/extensions/litestar/plugin.py +0 -0
  144. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/extensions/litestar/providers.py +0 -0
  145. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/migrations/__init__.py +0 -0
  146. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/migrations/base.py +0 -0
  147. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/migrations/commands.py +0 -0
  148. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/migrations/loaders.py +0 -0
  149. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/migrations/runner.py +0 -0
  150. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/migrations/tracker.py +0 -0
  151. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/migrations/utils.py +0 -0
  152. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/protocols.py +0 -0
  153. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/py.typed +0 -0
  154. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/storage/__init__.py +0 -0
  155. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/storage/backends/__init__.py +0 -0
  156. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/storage/backends/base.py +0 -0
  157. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/storage/backends/local.py +0 -0
  158. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/storage/backends/obstore.py +0 -0
  159. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/storage/registry.py +0 -0
  160. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/utils/__init__.py +0 -0
  161. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/utils/correlation.py +0 -0
  162. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/utils/data_transformation.py +0 -0
  163. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/utils/deprecation.py +0 -0
  164. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/utils/fixtures.py +0 -0
  165. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/utils/logging.py +0 -0
  166. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/utils/module_loader.py +0 -0
  167. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/utils/serializers.py +0 -0
  168. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/utils/singleton.py +0 -0
  169. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/utils/sync_tools.py +0 -0
  170. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/utils/text.py +0 -0
  171. {sqlspec-0.24.1 → sqlspec-0.25.0}/sqlspec/utils/type_guards.py +0 -0
  172. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/__init__.py +0 -0
  173. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/conftest.py +0 -0
  174. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/__init__.py +0 -0
  175. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/asset_maintenance.sql +0 -0
  176. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/ddls-mysql-collection.sql +0 -0
  177. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/ddls-postgres-collection.sql +0 -0
  178. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/example_usage.py +0 -0
  179. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/init.sql +0 -0
  180. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/mysql/collection-config.sql +0 -0
  181. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/mysql/collection-data_types.sql +0 -0
  182. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/mysql/collection-database_details.sql +0 -0
  183. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/mysql/collection-engines.sql +0 -0
  184. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/mysql/collection-hostname.sql +0 -0
  185. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/mysql/collection-plugins.sql +0 -0
  186. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/mysql/collection-process_list.sql +0 -0
  187. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/mysql/collection-resource-groups.sql +0 -0
  188. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/mysql/collection-schema_objects.sql +0 -0
  189. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/mysql/collection-table_details.sql +0 -0
  190. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/mysql/collection-users.sql +0 -0
  191. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/mysql/init.sql +0 -0
  192. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/oracle.ddl.sql +0 -0
  193. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/postgres/collection-applications.sql +0 -0
  194. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/postgres/collection-aws_extension_dependency.sql +0 -0
  195. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/postgres/collection-aws_oracle_exists.sql +0 -0
  196. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/postgres/collection-bg_writer_stats.sql +0 -0
  197. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/postgres/collection-calculated_metrics.sql +0 -0
  198. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/postgres/collection-data_types.sql +0 -0
  199. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/postgres/collection-database_details.sql +0 -0
  200. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/postgres/collection-extensions.sql +0 -0
  201. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/postgres/collection-index_details.sql +0 -0
  202. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/postgres/collection-pglogical-details.sql +0 -0
  203. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/postgres/collection-privileges.sql +0 -0
  204. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/postgres/collection-replication_slots.sql +0 -0
  205. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/postgres/collection-replication_stats.sql +0 -0
  206. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/postgres/collection-schema_details.sql +0 -0
  207. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/postgres/collection-schema_objects.sql +0 -0
  208. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/postgres/collection-settings.sql +0 -0
  209. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/postgres/collection-source_details.sql +0 -0
  210. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/postgres/collection-table_details.sql +0 -0
  211. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/postgres/extended-collection-all-databases.sql +0 -0
  212. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/postgres/init.sql +0 -0
  213. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/readiness-check.sql +0 -0
  214. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/fixtures/sql_utils.py +0 -0
  215. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/__init__.py +0 -0
  216. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/conftest.py +0 -0
  217. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/__init__.py +0 -0
  218. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_adbc/__init__.py +0 -0
  219. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_adbc/conftest.py +0 -0
  220. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_adbc/test_adbc_arrow_features.py +0 -0
  221. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_adbc/test_adbc_backends.py +0 -0
  222. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_adbc/test_adbc_connection.py +0 -0
  223. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_adbc/test_adbc_driver.py +0 -0
  224. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_adbc/test_adbc_edge_cases.py +0 -0
  225. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_adbc/test_adbc_results.py +0 -0
  226. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_adbc/test_migrations.py +0 -0
  227. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_aiosqlite/__init__.py +0 -0
  228. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_aiosqlite/conftest.py +0 -0
  229. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_aiosqlite/test_driver.py +0 -0
  230. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_aiosqlite/test_migrations.py +0 -0
  231. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_aiosqlite/test_parameter_styles.py +0 -0
  232. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_asyncmy/__init__.py +0 -0
  233. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_asyncmy/conftest.py +0 -0
  234. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_asyncmy/test_asyncmy_features.py +0 -0
  235. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_asyncmy/test_config.py +0 -0
  236. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_asyncmy/test_driver.py +0 -0
  237. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_asyncmy/test_migrations.py +0 -0
  238. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_asyncmy/test_parameter_styles.py +0 -0
  239. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_asyncpg/__init__.py +0 -0
  240. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_asyncpg/conftest.py +0 -0
  241. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_asyncpg/test_connection.py +0 -0
  242. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_asyncpg/test_driver.py +0 -0
  243. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_asyncpg/test_execute_many.py +0 -0
  244. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_asyncpg/test_migrations.py +0 -0
  245. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_asyncpg/test_parameter_styles.py +0 -0
  246. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_bigquery/__init__.py +0 -0
  247. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_bigquery/conftest.py +0 -0
  248. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_bigquery/test_bigquery_features.py +0 -0
  249. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_bigquery/test_config.py +0 -0
  250. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_bigquery/test_connection.py +0 -0
  251. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_bigquery/test_driver.py +0 -0
  252. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_duckdb/__init__.py +0 -0
  253. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_duckdb/test_driver.py +0 -0
  254. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_duckdb/test_execute_many.py +0 -0
  255. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_duckdb/test_migrations.py +0 -0
  256. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_duckdb/test_mixed_parameter_styles.py +0 -0
  257. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_duckdb/test_parameter_styles.py +0 -0
  258. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_duckdb/test_pooling.py +0 -0
  259. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_duckdb/utils.py +0 -0
  260. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_oracledb/__init__.py +0 -0
  261. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_oracledb/conftest.py +0 -0
  262. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_oracledb/test_connection.py +0 -0
  263. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_oracledb/test_driver_async.py +0 -0
  264. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_oracledb/test_driver_sync.py +0 -0
  265. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_oracledb/test_execute_many.py +0 -0
  266. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_oracledb/test_migrations.py +0 -0
  267. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_oracledb/test_oracle_features.py +0 -0
  268. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_oracledb/test_parameter_styles.py +0 -0
  269. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_psqlpy/__init__.py +0 -0
  270. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_psqlpy/conftest.py +0 -0
  271. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_psqlpy/test_connection.py +0 -0
  272. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_psqlpy/test_driver.py +0 -0
  273. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_psqlpy/test_migrations.py +0 -0
  274. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_psqlpy/test_parameter_styles.py +0 -0
  275. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_psqlpy/test_psqlpy_features.py +0 -0
  276. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_psycopg/__init__.py +0 -0
  277. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_psycopg/conftest.py +0 -0
  278. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_psycopg/test_async_copy.py +0 -0
  279. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_psycopg/test_connection.py +0 -0
  280. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_psycopg/test_driver.py +0 -0
  281. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_psycopg/test_execute_many.py +0 -0
  282. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_psycopg/test_migrations.py +0 -0
  283. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_psycopg/test_parameter_styles.py +0 -0
  284. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_sqlite/__init__.py +0 -0
  285. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_sqlite/conftest.py +0 -0
  286. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_sqlite/test_driver.py +0 -0
  287. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_sqlite/test_migrations.py +0 -0
  288. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_sqlite/test_parameter_styles.py +0 -0
  289. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_adapters/test_sqlite/test_query_mixin.py +0 -0
  290. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_loader/__init__.py +0 -0
  291. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_loader/test_file_system_loading.py +0 -0
  292. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_migrations/__init__.py +0 -0
  293. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_storage/__init__.py +0 -0
  294. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/integration/test_storage/test_storage_integration.py +0 -0
  295. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/conftest.py +0 -0
  296. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_adapters/__init__.py +0 -0
  297. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_adapters/conftest.py +0 -0
  298. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_adapters/test_adapter_implementations.py +0 -0
  299. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_base/__init__.py +0 -0
  300. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_builder/__init__.py +0 -0
  301. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_builder/test_insert_builder.py +0 -0
  302. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_builder/test_lateral_joins.py +0 -0
  303. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_builder/test_parameter_naming.py +0 -0
  304. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_builder_parameter_naming.py +0 -0
  305. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_core/test_filters.py +0 -0
  306. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_core/test_result.py +0 -0
  307. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_cte_parameter_collisions.py +0 -0
  308. {sqlspec-0.24.1/tools → sqlspec-0.25.0/tests/unit/test_driver}/__init__.py +0 -0
  309. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_extensions/__init__.py +0 -0
  310. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_extensions/test_litestar/__init__.py +0 -0
  311. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_extensions/test_litestar/test_config.py +0 -0
  312. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_loader/__init__.py +0 -0
  313. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_loader/test_fixtures_directory_loading.py +0 -0
  314. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_loader/test_loading_patterns.py +0 -0
  315. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_migrations/__init__.py +0 -0
  316. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_parsing_utils.py +0 -0
  317. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_sql_factory.py +0 -0
  318. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_storage/__init__.py +0 -0
  319. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_storage/test_fsspec_backend.py +0 -0
  320. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_storage/test_obstore_backend.py +0 -0
  321. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_utils/__init__.py +0 -0
  322. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_utils/test_correlation.py +0 -0
  323. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_utils/test_data_transformation.py +0 -0
  324. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_utils/test_deprecation.py +0 -0
  325. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_utils/test_logging.py +0 -0
  326. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_utils/test_module_loader.py +0 -0
  327. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_utils/test_serializers.py +0 -0
  328. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_utils/test_text.py +0 -0
  329. {sqlspec-0.24.1 → sqlspec-0.25.0}/tests/unit/test_where_or_operations.py +0 -0
  330. {sqlspec-0.24.1 → sqlspec-0.25.0}/tools/build_docs.py +0 -0
  331. {sqlspec-0.24.1 → sqlspec-0.25.0}/tools/local-infra.sh +0 -0
  332. {sqlspec-0.24.1 → sqlspec-0.25.0}/tools/pypi_readme.py +0 -0
  333. {sqlspec-0.24.1 → sqlspec-0.25.0}/tools/sphinx_ext/__init__.py +0 -0
  334. {sqlspec-0.24.1 → sqlspec-0.25.0}/tools/sphinx_ext/changelog.py +0 -0
  335. {sqlspec-0.24.1 → sqlspec-0.25.0}/tools/sphinx_ext/missing_references.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlspec
3
- Version: 0.24.1
3
+ Version: 0.25.0
4
4
  Summary: SQL Experiments in Python
5
5
  Project-URL: Discord, https://discord.gg/litestar
6
6
  Project-URL: Issue, https://github.com/litestar-org/sqlspec/issues/
@@ -13,7 +13,7 @@ maintainers = [{ name = "Litestar Developers", email = "hello@litestar.dev" }]
13
13
  name = "sqlspec"
14
14
  readme = "README.md"
15
15
  requires-python = ">=3.9, <4.0"
16
- version = "0.24.1"
16
+ version = "0.25.0"
17
17
 
18
18
  [project.urls]
19
19
  Discord = "https://discord.gg/litestar"
@@ -360,8 +360,8 @@ exclude = ["**/node_modules", "**/__pycache__", ".venv", "tools", "docs", "tmp",
360
360
  include = ["sqlspec", "tests"]
361
361
  pythonVersion = "3.9"
362
362
  reportMissingTypeStubs = false
363
- reportPrivateImportUsage = false
364
- reportPrivateUsage = false
363
+ reportPrivateImportUsage = true
364
+ reportPrivateUsage = true
365
365
  reportTypedDictNotRequiredAccess = false
366
366
  reportUnknownArgumentType = false
367
367
  reportUnnecessaryCast = false
@@ -170,7 +170,7 @@ class SQLFactory:
170
170
  actual_type_str == "WITH" and parsed_expr.this and isinstance(parsed_expr.this, exp.Select)
171
171
  ):
172
172
  builder = Select(dialect=dialect or self.dialect)
173
- builder._expression = parsed_expr
173
+ builder.set_expression(parsed_expr)
174
174
  return builder
175
175
 
176
176
  if actual_type_str in {"INSERT", "UPDATE", "DELETE"} and parsed_expr.args.get("returning") is not None:
@@ -451,7 +451,7 @@ class SQLFactory:
451
451
  parsed_expr: exp.Expression = exp.maybe_parse(sql_string, dialect=self.dialect)
452
452
 
453
453
  if isinstance(parsed_expr, exp.Insert):
454
- builder._expression = parsed_expr
454
+ builder.set_expression(parsed_expr)
455
455
  return builder
456
456
 
457
457
  if isinstance(parsed_expr, exp.Select):
@@ -470,7 +470,7 @@ class SQLFactory:
470
470
  parsed_expr: exp.Expression = exp.maybe_parse(sql_string, dialect=self.dialect)
471
471
 
472
472
  if isinstance(parsed_expr, exp.Select):
473
- builder._expression = parsed_expr
473
+ builder.set_expression(parsed_expr)
474
474
  return builder
475
475
 
476
476
  logger.warning("Cannot create SELECT from %s statement", type(parsed_expr).__name__)
@@ -485,7 +485,7 @@ class SQLFactory:
485
485
  parsed_expr: exp.Expression = exp.maybe_parse(sql_string, dialect=self.dialect)
486
486
 
487
487
  if isinstance(parsed_expr, exp.Update):
488
- builder._expression = parsed_expr
488
+ builder.set_expression(parsed_expr)
489
489
  return builder
490
490
 
491
491
  logger.warning("Cannot create UPDATE from %s statement", type(parsed_expr).__name__)
@@ -500,7 +500,7 @@ class SQLFactory:
500
500
  parsed_expr: exp.Expression = exp.maybe_parse(sql_string, dialect=self.dialect)
501
501
 
502
502
  if isinstance(parsed_expr, exp.Delete):
503
- builder._expression = parsed_expr
503
+ builder.set_expression(parsed_expr)
504
504
  return builder
505
505
 
506
506
  logger.warning("Cannot create DELETE from %s statement", type(parsed_expr).__name__)
@@ -515,7 +515,7 @@ class SQLFactory:
515
515
  parsed_expr: exp.Expression = exp.maybe_parse(sql_string, dialect=self.dialect)
516
516
 
517
517
  if isinstance(parsed_expr, exp.Merge):
518
- builder._expression = parsed_expr
518
+ builder.set_expression(parsed_expr)
519
519
  return builder
520
520
 
521
521
  logger.warning("Cannot create MERGE from %s statement", type(parsed_expr).__name__)
@@ -724,19 +724,15 @@ class SQLFactory:
724
724
  if not parameters:
725
725
  try:
726
726
  parsed: exp.Expression = exp.maybe_parse(sql_fragment)
727
- return parsed
728
- if sql_fragment.strip().replace("_", "").replace(".", "").isalnum():
729
- return exp.to_identifier(sql_fragment)
730
- return exp.Literal.string(sql_fragment)
731
727
  except Exception as e:
732
728
  msg = f"Failed to parse raw SQL fragment '{sql_fragment}': {e}"
733
729
  raise SQLBuilderError(msg) from e
730
+ return parsed
734
731
 
735
732
  return SQL(sql_fragment, parameters)
736
733
 
737
- @staticmethod
738
734
  def count(
739
- column: Union[str, exp.Expression, "ExpressionWrapper", "Case", "Column"] = "*", distinct: bool = False
735
+ self, column: Union[str, exp.Expression, "ExpressionWrapper", "Case", "Column"] = "*", distinct: bool = False
740
736
  ) -> AggregateExpression:
741
737
  """Create a COUNT expression.
742
738
 
@@ -750,7 +746,7 @@ class SQLFactory:
750
746
  if isinstance(column, str) and column == "*":
751
747
  expr = exp.Count(this=exp.Star(), distinct=distinct)
752
748
  else:
753
- col_expr = SQLFactory._extract_expression(column)
749
+ col_expr = self._extract_expression(column)
754
750
  expr = exp.Count(this=col_expr, distinct=distinct)
755
751
  return AggregateExpression(expr)
756
752
 
@@ -1068,11 +1064,11 @@ class SQLFactory:
1068
1064
  if isinstance(value, str):
1069
1065
  return exp.column(value)
1070
1066
  if isinstance(value, Column):
1071
- return value._expression
1067
+ return value.sqlglot_expression
1072
1068
  if isinstance(value, ExpressionWrapper):
1073
1069
  return value.expression
1074
1070
  if isinstance(value, Case):
1075
- return exp.Case(ifs=value._conditions, default=value._default)
1071
+ return exp.Case(ifs=value.conditions, default=value.default)
1076
1072
  if isinstance(value, exp.Expression):
1077
1073
  return value
1078
1074
  return exp.convert(value)
@@ -606,6 +606,7 @@ except ImportError:
606
606
 
607
607
 
608
608
  FSSPEC_INSTALLED = bool(find_spec("fsspec"))
609
+ NUMPY_INSTALLED = bool(find_spec("numpy"))
609
610
  OBSTORE_INSTALLED = bool(find_spec("obstore"))
610
611
  PGVECTOR_INSTALLED = bool(find_spec("pgvector"))
611
612
 
@@ -617,6 +618,7 @@ __all__ = (
617
618
  "FSSPEC_INSTALLED",
618
619
  "LITESTAR_INSTALLED",
619
620
  "MSGSPEC_INSTALLED",
621
+ "NUMPY_INSTALLED",
620
622
  "OBSTORE_INSTALLED",
621
623
  "OPENTELEMETRY_INSTALLED",
622
624
  "PGVECTOR_INSTALLED",
@@ -521,7 +521,7 @@ class AdbcDriver(SyncDriverAdapterBase):
521
521
 
522
522
  try:
523
523
  if not prepared_parameters:
524
- cursor._rowcount = 0
524
+ cursor._rowcount = 0 # pyright: ignore[reportPrivateUsage]
525
525
  row_count = 0
526
526
  elif isinstance(prepared_parameters, list) and prepared_parameters:
527
527
  processed_params = []
@@ -596,7 +596,7 @@ class AdbcDriver(SyncDriverAdapterBase):
596
596
  Execution result with statement counts
597
597
  """
598
598
  if statement.is_script:
599
- sql = statement._raw_sql
599
+ sql = statement.raw_sql
600
600
  prepared_parameters: list[Any] = []
601
601
  else:
602
602
  sql, prepared_parameters = self._get_compiled_sql(statement, self.statement_config)
@@ -286,6 +286,11 @@ class OracleSyncDriver(SyncDriverAdapterBase):
286
286
  msg = "execute_many requires parameters"
287
287
  raise ValueError(msg)
288
288
 
289
+ # Oracle-specific fix: Ensure parameters are in list format for executemany
290
+ # Oracle expects a list of sequences, not a tuple of sequences
291
+ if isinstance(prepared_parameters, tuple):
292
+ prepared_parameters = list(prepared_parameters)
293
+
289
294
  cursor.executemany(sql, prepared_parameters)
290
295
 
291
296
  # Calculate affected rows based on parameter count
@@ -173,8 +173,7 @@ class PsycopgSyncConfig(SyncDatabaseConfig[PsycopgSyncConnection, ConnectionPool
173
173
  logger.info("Closing Psycopg connection pool", extra={"adapter": "psycopg"})
174
174
 
175
175
  try:
176
- if hasattr(self.pool_instance, "_closed"):
177
- self.pool_instance._closed = True
176
+ self.pool_instance._closed = True # pyright: ignore[reportPrivateUsage]
178
177
 
179
178
  self.pool_instance.close()
180
179
  logger.info("Psycopg connection pool closed successfully", extra={"adapter": "psycopg"})
@@ -350,8 +349,7 @@ class PsycopgAsyncConfig(AsyncDatabaseConfig[PsycopgAsyncConnection, AsyncConnec
350
349
  return
351
350
 
352
351
  try:
353
- if hasattr(self.pool_instance, "_closed"):
354
- self.pool_instance._closed = True
352
+ self.pool_instance._closed = True # pyright: ignore[reportPrivateUsage]
355
353
 
356
354
  await self.pool_instance.close()
357
355
  finally:
@@ -15,9 +15,8 @@ from sqlspec.config import (
15
15
  )
16
16
  from sqlspec.core.cache import (
17
17
  CacheConfig,
18
- CacheStatsAggregate,
19
18
  get_cache_config,
20
- get_cache_stats,
19
+ get_cache_statistics,
21
20
  log_cache_stats,
22
21
  reset_cache_stats,
23
22
  update_cache_config,
@@ -532,13 +531,13 @@ class SQLSpec:
532
531
  update_cache_config(config)
533
532
 
534
533
  @staticmethod
535
- def get_cache_stats() -> CacheStatsAggregate:
534
+ def get_cache_stats() -> "dict[str, Any]":
536
535
  """Get current cache statistics.
537
536
 
538
537
  Returns:
539
538
  Cache statistics object with detailed metrics.
540
539
  """
541
- return get_cache_stats()
540
+ return get_cache_statistics()
542
541
 
543
542
  @staticmethod
544
543
  def reset_cache_stats() -> None:
@@ -13,7 +13,7 @@ from sqlglot.errors import ParseError as SQLGlotParseError
13
13
  from sqlglot.optimizer import optimize
14
14
  from typing_extensions import Self
15
15
 
16
- from sqlspec.core.cache import CacheKey, get_cache_config, get_default_cache
16
+ from sqlspec.core.cache import get_cache, get_cache_config
17
17
  from sqlspec.core.hashing import hash_optimized_expression
18
18
  from sqlspec.core.parameters import ParameterStyle, ParameterStyleConfig
19
19
  from sqlspec.core.statement import SQL, StatementConfig
@@ -91,6 +91,36 @@ class QueryBuilder(ABC):
91
91
  "QueryBuilder._create_base_expression must return a valid sqlglot expression."
92
92
  )
93
93
 
94
+ def get_expression(self) -> Optional[exp.Expression]:
95
+ """Get expression reference (no copy).
96
+
97
+ Returns:
98
+ The current SQLGlot expression or None if not set
99
+ """
100
+ return self._expression
101
+
102
+ def set_expression(self, expression: exp.Expression) -> None:
103
+ """Set expression with validation.
104
+
105
+ Args:
106
+ expression: SQLGlot expression to set
107
+
108
+ Raises:
109
+ TypeError: If expression is not a SQLGlot Expression
110
+ """
111
+ if not isinstance(expression, exp.Expression):
112
+ msg = f"Expected Expression, got {type(expression)}"
113
+ raise TypeError(msg)
114
+ self._expression = expression
115
+
116
+ def has_expression(self) -> bool:
117
+ """Check if expression exists.
118
+
119
+ Returns:
120
+ True if expression is set, False otherwise
121
+ """
122
+ return self._expression is not None
123
+
94
124
  @abstractmethod
95
125
  def _create_base_expression(self) -> exp.Expression:
96
126
  """Create the base sqlglot expression for the specific query type.
@@ -307,12 +337,13 @@ class QueryBuilder(ABC):
307
337
  cte_select_expression: exp.Select
308
338
 
309
339
  if isinstance(query, QueryBuilder):
310
- if query._expression is None:
340
+ query_expr = query.get_expression()
341
+ if query_expr is None:
311
342
  self._raise_sql_builder_error("CTE query builder has no expression.")
312
- if not isinstance(query._expression, exp.Select):
313
- msg = f"CTE query builder expression must be a Select, got {type(query._expression).__name__}."
343
+ if not isinstance(query_expr, exp.Select):
344
+ msg = f"CTE query builder expression must be a Select, got {type(query_expr).__name__}."
314
345
  self._raise_sql_builder_error(msg)
315
- cte_select_expression = query._expression
346
+ cte_select_expression = query_expr
316
347
  param_mapping = self._merge_cte_parameters(alias, query.parameters)
317
348
  updated_expression = self._update_placeholders_in_expression(cte_select_expression, param_mapping)
318
349
  if not isinstance(updated_expression, exp.Select):
@@ -398,9 +429,8 @@ class QueryBuilder(ABC):
398
429
  expression, dialect=dialect_name, schema=self.schema, optimizer_settings=optimizer_settings
399
430
  )
400
431
 
401
- cache_key_obj = CacheKey((cache_key,))
402
- unified_cache = get_default_cache()
403
- cached_optimized = unified_cache.get(cache_key_obj)
432
+ cache = get_cache()
433
+ cached_optimized = cache.get("optimized", cache_key)
404
434
  if cached_optimized:
405
435
  return cast("exp.Expression", cached_optimized)
406
436
 
@@ -409,7 +439,7 @@ class QueryBuilder(ABC):
409
439
  expression, schema=self.schema, dialect=self.dialect_name, optimizer_settings=optimizer_settings
410
440
  )
411
441
 
412
- unified_cache.put(cache_key_obj, optimized)
442
+ cache.put("optimized", cache_key, optimized)
413
443
 
414
444
  except Exception:
415
445
  return expression
@@ -430,15 +460,14 @@ class QueryBuilder(ABC):
430
460
  return self._to_statement(config)
431
461
 
432
462
  cache_key_str = self._generate_builder_cache_key(config)
433
- cache_key = CacheKey((cache_key_str,))
434
463
 
435
- unified_cache = get_default_cache()
436
- cached_sql = unified_cache.get(cache_key)
464
+ cache = get_cache()
465
+ cached_sql = cache.get("builder", cache_key_str)
437
466
  if cached_sql is not None:
438
467
  return cast("SQL", cached_sql)
439
468
 
440
469
  sql_statement = self._to_statement(config)
441
- unified_cache.put(cache_key, sql_statement)
470
+ cache.put("builder", cache_key_str, sql_statement)
442
471
 
443
472
  return sql_statement
444
473
 
@@ -531,3 +560,16 @@ class QueryBuilder(ABC):
531
560
  def parameters(self) -> dict[str, Any]:
532
561
  """Public access to query parameters."""
533
562
  return self._parameters
563
+
564
+ def set_parameters(self, parameters: dict[str, Any]) -> None:
565
+ """Set query parameters (public API)."""
566
+ self._parameters = parameters.copy()
567
+
568
+ @property
569
+ def with_ctes(self) -> "dict[str, exp.CTE]":
570
+ """Get WITH clause CTEs (public API)."""
571
+ return dict(self._with_ctes)
572
+
573
+ def generate_unique_parameter_name(self, base_name: str) -> str:
574
+ """Generate unique parameter name (public API)."""
575
+ return self._generate_unique_parameter_name(base_name)
@@ -254,6 +254,15 @@ class Column:
254
254
  """Hash based on table and column name."""
255
255
  return hash((self.table, self.name))
256
256
 
257
+ @property
258
+ def sqlglot_expression(self) -> exp.Expression:
259
+ """Get the underlying SQLGlot expression (public API).
260
+
261
+ Returns:
262
+ The SQLGlot expression for this column
263
+ """
264
+ return self._expression
265
+
257
266
 
258
267
  class FunctionColumn:
259
268
  """Represents the result of a SQL function call on a column."""
@@ -973,10 +973,10 @@ class CreateTableAsSelect(DDLBuilder):
973
973
  select_expr = self._select_query.expression
974
974
  select_parameters = self._select_query.parameters
975
975
  elif isinstance(self._select_query, Select):
976
- select_expr = self._select_query._expression
977
- select_parameters = self._select_query._parameters
976
+ select_expr = self._select_query.get_expression()
977
+ select_parameters = self._select_query.parameters
978
978
 
979
- with_ctes = self._select_query._with_ctes
979
+ with_ctes = self._select_query.with_ctes
980
980
  if with_ctes and select_expr and isinstance(select_expr, exp.Select):
981
981
  for alias, cte in with_ctes.items():
982
982
  if has_with_method(select_expr):
@@ -1100,8 +1100,8 @@ class CreateMaterializedView(DDLBuilder):
1100
1100
  select_expr = self._select_query.expression
1101
1101
  select_parameters = self._select_query.parameters
1102
1102
  elif isinstance(self._select_query, Select):
1103
- select_expr = self._select_query._expression
1104
- select_parameters = self._select_query._parameters
1103
+ select_expr = self._select_query.get_expression()
1104
+ select_parameters = self._select_query.parameters
1105
1105
  elif isinstance(self._select_query, str):
1106
1106
  select_expr = exp.maybe_parse(self._select_query)
1107
1107
  select_parameters = None
@@ -1198,8 +1198,8 @@ class CreateView(DDLBuilder):
1198
1198
  select_expr = self._select_query.expression
1199
1199
  select_parameters = self._select_query.parameters
1200
1200
  elif isinstance(self._select_query, Select):
1201
- select_expr = self._select_query._expression
1202
- select_parameters = self._select_query._parameters
1201
+ select_expr = self._select_query.get_expression()
1202
+ select_parameters = self._select_query.parameters
1203
1203
  elif isinstance(self._select_query, str):
1204
1204
  select_expr = exp.maybe_parse(self._select_query)
1205
1205
  select_parameters = None
@@ -90,6 +90,10 @@ class Insert(QueryBuilder, ReturningClauseMixin, InsertValuesMixin, InsertFromSe
90
90
  raise SQLBuilderError(ERR_MSG_INTERNAL_EXPRESSION_TYPE)
91
91
  return self._expression
92
92
 
93
+ def get_insert_expression(self) -> exp.Insert:
94
+ """Get the insert expression (public API)."""
95
+ return self._get_insert_expression()
96
+
93
97
  def values(self, *values: Any, **kwargs: Any) -> "Self":
94
98
  """Adds a row of values to the INSERT statement.
95
99
 
@@ -129,7 +133,7 @@ class Insert(QueryBuilder, ReturningClauseMixin, InsertValuesMixin, InsertFromSe
129
133
  if hasattr(values_0, "items") and hasattr(values_0, "keys"):
130
134
  return self.values_from_dict(values_0)
131
135
 
132
- insert_expr = self._get_insert_expression()
136
+ insert_expr = self.get_insert_expression()
133
137
 
134
138
  if self._columns and len(values) != len(self._columns):
135
139
  msg = ERR_MSG_VALUES_COLUMNS_MISMATCH.format(values_len=len(values), columns_len=len(self._columns))
@@ -160,9 +164,9 @@ class Insert(QueryBuilder, ReturningClauseMixin, InsertValuesMixin, InsertFromSe
160
164
  if self._columns and i < len(self._columns):
161
165
  column_str = str(self._columns[i])
162
166
  column_name = column_str.rsplit(".", maxsplit=1)[-1] if "." in column_str else column_str
163
- param_name = self._generate_unique_parameter_name(column_name)
167
+ param_name = self.generate_unique_parameter_name(column_name)
164
168
  else:
165
- param_name = self._generate_unique_parameter_name(f"value_{i + 1}")
169
+ param_name = self.generate_unique_parameter_name(f"value_{i + 1}")
166
170
  _, param_name = self.add_parameter(value, name=param_name)
167
171
  value_placeholders.append(exp.Placeholder(this=param_name))
168
172
 
@@ -336,7 +340,7 @@ class ConflictBuilder:
336
340
  ).do_nothing()
337
341
  ```
338
342
  """
339
- insert_expr = self._insert_builder._get_insert_expression()
343
+ insert_expr = self._insert_builder.get_insert_expression()
340
344
 
341
345
  # Create ON CONFLICT with proper structure
342
346
  conflict_keys = [exp.to_identifier(col) for col in self._columns] if self._columns else None
@@ -363,7 +367,7 @@ class ConflictBuilder:
363
367
  )
364
368
  ```
365
369
  """
366
- insert_expr = self._insert_builder._get_insert_expression()
370
+ insert_expr = self._insert_builder.get_insert_expression()
367
371
 
368
372
  # Create SET expressions for the UPDATE
369
373
  set_expressions = []
@@ -394,7 +398,7 @@ class ConflictBuilder:
394
398
  value_expr = val
395
399
  else:
396
400
  # Create parameter for regular values
397
- param_name = self._insert_builder._generate_unique_parameter_name(col)
401
+ param_name = self._insert_builder.generate_unique_parameter_name(col)
398
402
  _, param_name = self._insert_builder.add_parameter(val, name=param_name)
399
403
  value_expr = exp.Placeholder(this=param_name)
400
404
 
@@ -18,6 +18,27 @@ from sqlspec.utils.type_guards import (
18
18
  )
19
19
 
20
20
 
21
+ def extract_column_name(column: Union[str, exp.Column]) -> str:
22
+ """Extract column name from column expression for parameter naming.
23
+
24
+ Args:
25
+ column: Column expression (string or SQLGlot Column)
26
+
27
+ Returns:
28
+ Column name as string for use as parameter name
29
+ """
30
+ if isinstance(column, str):
31
+ if "." in column:
32
+ return column.split(".")[-1]
33
+ return column
34
+ if isinstance(column, exp.Column):
35
+ try:
36
+ return str(column.this.this)
37
+ except AttributeError:
38
+ return str(column.this) if column.this else "column"
39
+ return "column"
40
+
41
+
21
42
  def parse_column_expression(
22
43
  column_input: Union[str, exp.Expression, Any], builder: Optional[Any] = None
23
44
  ) -> exp.Expression:
@@ -139,10 +160,8 @@ def parse_condition_expression(
139
160
  if value is None:
140
161
  return exp.Is(this=column_expr, expression=exp.null())
141
162
  if builder and has_parameter_builder(builder):
142
- from sqlspec.builder.mixins._where_clause import _extract_column_name
143
-
144
- column_name = _extract_column_name(column)
145
- param_name = builder._generate_unique_parameter_name(column_name)
163
+ column_name = extract_column_name(column)
164
+ param_name = builder.generate_unique_parameter_name(column_name)
146
165
  _, param_name = builder.add_parameter(value, name=param_name)
147
166
  return exp.EQ(this=column_expr, expression=exp.Placeholder(this=param_name))
148
167
  if isinstance(value, str):
@@ -131,7 +131,7 @@ class Update(
131
131
  subquery_exp = exp.paren(exp.maybe_parse(subquery.sql, dialect=self.dialect))
132
132
  table_expr = exp.alias_(subquery_exp, alias) if alias else subquery_exp
133
133
 
134
- subquery_parameters = table._parameters
134
+ subquery_parameters = table.parameters
135
135
  if subquery_parameters:
136
136
  for p_name, p_value in subquery_parameters.items():
137
137
  self.add_parameter(p_value, name=p_name)
@@ -1,10 +1,11 @@
1
+ # pyright: reportPrivateUsage=false
1
2
  """CTE and set operation mixins.
2
3
 
3
4
  Provides mixins for Common Table Expressions (WITH clause) and
4
5
  set operations (UNION, INTERSECT, EXCEPT).
5
6
  """
6
7
 
7
- from typing import Any, Optional, Union
8
+ from typing import TYPE_CHECKING, Any, Optional, Union, cast
8
9
 
9
10
  from mypy_extensions import trait
10
11
  from sqlglot import exp
@@ -12,6 +13,9 @@ from typing_extensions import Self
12
13
 
13
14
  from sqlspec.exceptions import SQLBuilderError
14
15
 
16
+ if TYPE_CHECKING:
17
+ from sqlspec.builder._base import QueryBuilder
18
+
15
19
  __all__ = ("CommonTableExpressionMixin", "SetOperationMixin")
16
20
 
17
21
 
@@ -20,8 +24,10 @@ class CommonTableExpressionMixin:
20
24
  """Mixin providing WITH clause (Common Table Expressions) support for SQL builders."""
21
25
 
22
26
  __slots__ = ()
23
- # Type annotation for PyRight - this will be provided by the base class
24
- _expression: Optional[exp.Expression]
27
+
28
+ # Type annotations for PyRight - these will be provided by the base class
29
+ def get_expression(self) -> Optional[exp.Expression]: ...
30
+ def set_expression(self, expression: exp.Expression) -> None: ...
25
31
 
26
32
  _with_ctes: Any # Provided by QueryBuilder
27
33
  dialect: Any # Provided by QueryBuilder
@@ -60,12 +66,14 @@ class CommonTableExpressionMixin:
60
66
  Returns:
61
67
  The current builder instance for method chaining.
62
68
  """
63
- if self._expression is None:
69
+ builder = cast("QueryBuilder", self)
70
+ expression = builder.get_expression()
71
+ if expression is None:
64
72
  msg = "Cannot add WITH clause: expression not initialized."
65
73
  raise SQLBuilderError(msg)
66
74
 
67
- if not isinstance(self._expression, (exp.Select, exp.Insert, exp.Update, exp.Delete)):
68
- msg = f"Cannot add WITH clause to {type(self._expression).__name__} expression."
75
+ if not isinstance(expression, (exp.Select, exp.Insert, exp.Update, exp.Delete)):
76
+ msg = f"Cannot add WITH clause to {type(expression).__name__} expression."
69
77
  raise SQLBuilderError(msg)
70
78
 
71
79
  cte_expr: Optional[exp.Expression] = None
@@ -103,19 +111,18 @@ class CommonTableExpressionMixin:
103
111
  else:
104
112
  cte_alias_expr = exp.alias_(cte_expr, name)
105
113
 
106
- existing_with = self._expression.args.get("with")
114
+ existing_with = expression.args.get("with")
107
115
  if existing_with:
108
116
  existing_with.expressions.append(cte_alias_expr)
109
117
  if recursive:
110
118
  existing_with.set("recursive", recursive)
111
119
  else:
112
120
  # Only SELECT, INSERT, UPDATE support WITH clauses
113
- if hasattr(self._expression, "with_") and isinstance(
114
- self._expression, (exp.Select, exp.Insert, exp.Update)
115
- ):
116
- self._expression = self._expression.with_(cte_alias_expr, as_=name, copy=False)
121
+ if hasattr(expression, "with_") and isinstance(expression, (exp.Select, exp.Insert, exp.Update)):
122
+ updated_expression = expression.with_(cte_alias_expr, as_=name, copy=False)
123
+ builder.set_expression(updated_expression)
117
124
  if recursive:
118
- with_clause = self._expression.find(exp.With)
125
+ with_clause = updated_expression.find(exp.With)
119
126
  if with_clause:
120
127
  with_clause.set("recursive", recursive)
121
128
  self._with_ctes[name] = exp.CTE(this=cte_expr, alias=exp.to_table(name))
@@ -128,10 +135,12 @@ class SetOperationMixin:
128
135
  """Mixin providing set operations (UNION, INTERSECT, EXCEPT) for SELECT builders."""
129
136
 
130
137
  __slots__ = ()
131
- # Type annotation for PyRight - this will be provided by the base class
132
- _expression: Optional[exp.Expression]
133
138
 
134
- _parameters: dict[str, Any]
139
+ # Type annotations for PyRight - these will be provided by the base class
140
+ def get_expression(self) -> Optional[exp.Expression]: ...
141
+ def set_expression(self, expression: exp.Expression) -> None: ...
142
+ def set_parameters(self, parameters: "dict[str, Any]") -> None: ...
143
+
135
144
  dialect: Any = None
136
145
 
137
146
  def build(self) -> Any:
@@ -162,7 +171,7 @@ class SetOperationMixin:
162
171
  union_expr = exp.union(left_expr, right_expr, distinct=not all_)
163
172
  new_builder = type(self)()
164
173
  new_builder.dialect = self.dialect
165
- new_builder._expression = union_expr
174
+ cast("QueryBuilder", new_builder).set_expression(union_expr)
166
175
  merged_parameters = dict(left_query.parameters)
167
176
  for param_name, param_value in right_query.parameters.items():
168
177
  if param_name in merged_parameters:
@@ -181,11 +190,11 @@ class SetOperationMixin:
181
190
 
182
191
  right_expr = right_expr.transform(rename_parameter)
183
192
  union_expr = exp.union(left_expr, right_expr, distinct=not all_)
184
- new_builder._expression = union_expr
193
+ cast("QueryBuilder", new_builder).set_expression(union_expr)
185
194
  merged_parameters[new_param_name] = param_value
186
195
  else:
187
196
  merged_parameters[param_name] = param_value
188
- new_builder._parameters = merged_parameters
197
+ new_builder.set_parameters(merged_parameters)
189
198
  return new_builder
190
199
 
191
200
  def intersect(self, other: Any) -> Self:
@@ -210,10 +219,10 @@ class SetOperationMixin:
210
219
  intersect_expr = exp.intersect(left_expr, right_expr, distinct=True)
211
220
  new_builder = type(self)()
212
221
  new_builder.dialect = self.dialect
213
- new_builder._expression = intersect_expr
222
+ cast("QueryBuilder", new_builder).set_expression(intersect_expr)
214
223
  merged_parameters = dict(left_query.parameters)
215
224
  merged_parameters.update(right_query.parameters)
216
- new_builder._parameters = merged_parameters
225
+ new_builder.set_parameters(merged_parameters)
217
226
  return new_builder
218
227
 
219
228
  def except_(self, other: Any) -> Self:
@@ -238,8 +247,8 @@ class SetOperationMixin:
238
247
  except_expr = exp.except_(left_expr, right_expr)
239
248
  new_builder = type(self)()
240
249
  new_builder.dialect = self.dialect
241
- new_builder._expression = except_expr
250
+ cast("QueryBuilder", new_builder).set_expression(except_expr)
242
251
  merged_parameters = dict(left_query.parameters)
243
252
  merged_parameters.update(right_query.parameters)
244
- new_builder._parameters = merged_parameters
253
+ new_builder.set_parameters(merged_parameters)
245
254
  return new_builder