sqlspec 0.11.1__tar.gz → 0.12.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.

Files changed (436) hide show
  1. {sqlspec-0.11.1 → sqlspec-0.12.1}/.gitignore +12 -0
  2. {sqlspec-0.11.1 → sqlspec-0.12.1}/.pre-commit-config.yaml +2 -2
  3. {sqlspec-0.11.1 → sqlspec-0.12.1}/PKG-INFO +97 -26
  4. {sqlspec-0.11.1 → sqlspec-0.12.1}/README.md +78 -23
  5. {sqlspec-0.11.1 → sqlspec-0.12.1}/pyproject.toml +71 -15
  6. sqlspec-0.12.1/sqlspec/__init__.py +29 -0
  7. {sqlspec-0.11.1 → sqlspec-0.12.1}/sqlspec/_serialization.py +3 -10
  8. sqlspec-0.12.1/sqlspec/_sql.py +1147 -0
  9. sqlspec-0.12.1/sqlspec/_typing.py +544 -0
  10. sqlspec-0.12.1/sqlspec/adapters/adbc/__init__.py +4 -0
  11. sqlspec-0.12.1/sqlspec/adapters/adbc/config.py +532 -0
  12. sqlspec-0.12.1/sqlspec/adapters/adbc/driver.py +388 -0
  13. sqlspec-0.12.1/sqlspec/adapters/aiosqlite/__init__.py +4 -0
  14. sqlspec-0.12.1/sqlspec/adapters/aiosqlite/config.py +188 -0
  15. sqlspec-0.12.1/sqlspec/adapters/aiosqlite/driver.py +294 -0
  16. sqlspec-0.12.1/sqlspec/adapters/asyncmy/__init__.py +4 -0
  17. sqlspec-0.12.1/sqlspec/adapters/asyncmy/config.py +286 -0
  18. sqlspec-0.12.1/sqlspec/adapters/asyncmy/driver.py +244 -0
  19. sqlspec-0.12.1/sqlspec/adapters/asyncpg/__init__.py +6 -0
  20. sqlspec-0.12.1/sqlspec/adapters/asyncpg/config.py +374 -0
  21. sqlspec-0.12.1/sqlspec/adapters/asyncpg/driver.py +461 -0
  22. sqlspec-0.12.1/sqlspec/adapters/bigquery/__init__.py +4 -0
  23. sqlspec-0.12.1/sqlspec/adapters/bigquery/config.py +407 -0
  24. sqlspec-0.12.1/sqlspec/adapters/bigquery/driver.py +668 -0
  25. sqlspec-0.12.1/sqlspec/adapters/duckdb/__init__.py +11 -0
  26. sqlspec-0.12.1/sqlspec/adapters/duckdb/config.py +490 -0
  27. sqlspec-0.12.1/sqlspec/adapters/duckdb/driver.py +411 -0
  28. {sqlspec-0.11.1 → sqlspec-0.12.1}/sqlspec/adapters/oracledb/__init__.py +3 -8
  29. sqlspec-0.12.1/sqlspec/adapters/oracledb/config.py +625 -0
  30. sqlspec-0.12.1/sqlspec/adapters/oracledb/driver.py +581 -0
  31. sqlspec-0.12.1/sqlspec/adapters/psqlpy/__init__.py +6 -0
  32. sqlspec-0.12.1/sqlspec/adapters/psqlpy/config.py +419 -0
  33. sqlspec-0.12.1/sqlspec/adapters/psqlpy/driver.py +214 -0
  34. {sqlspec-0.11.1 → sqlspec-0.12.1}/sqlspec/adapters/psycopg/__init__.py +3 -8
  35. sqlspec-0.12.1/sqlspec/adapters/psycopg/config.py +725 -0
  36. sqlspec-0.12.1/sqlspec/adapters/psycopg/driver.py +789 -0
  37. sqlspec-0.12.1/sqlspec/adapters/sqlite/__init__.py +4 -0
  38. sqlspec-0.12.1/sqlspec/adapters/sqlite/config.py +174 -0
  39. sqlspec-0.12.1/sqlspec/adapters/sqlite/driver.py +263 -0
  40. sqlspec-0.12.1/sqlspec/base.py +475 -0
  41. sqlspec-0.12.1/sqlspec/config.py +354 -0
  42. sqlspec-0.12.1/sqlspec/driver/__init__.py +22 -0
  43. sqlspec-0.12.1/sqlspec/driver/_async.py +252 -0
  44. sqlspec-0.12.1/sqlspec/driver/_common.py +338 -0
  45. sqlspec-0.12.1/sqlspec/driver/_sync.py +261 -0
  46. sqlspec-0.12.1/sqlspec/driver/mixins/__init__.py +17 -0
  47. sqlspec-0.12.1/sqlspec/driver/mixins/_pipeline.py +523 -0
  48. sqlspec-0.12.1/sqlspec/driver/mixins/_result_utils.py +122 -0
  49. sqlspec-0.12.1/sqlspec/driver/mixins/_sql_translator.py +35 -0
  50. sqlspec-0.12.1/sqlspec/driver/mixins/_storage.py +993 -0
  51. sqlspec-0.12.1/sqlspec/driver/mixins/_type_coercion.py +131 -0
  52. sqlspec-0.12.1/sqlspec/exceptions.py +432 -0
  53. sqlspec-0.12.1/sqlspec/extensions/aiosql/__init__.py +10 -0
  54. sqlspec-0.12.1/sqlspec/extensions/aiosql/adapter.py +474 -0
  55. {sqlspec-0.11.1 → sqlspec-0.12.1}/sqlspec/extensions/litestar/__init__.py +1 -6
  56. {sqlspec-0.11.1 → sqlspec-0.12.1}/sqlspec/extensions/litestar/_utils.py +1 -5
  57. {sqlspec-0.11.1 → sqlspec-0.12.1}/sqlspec/extensions/litestar/config.py +5 -6
  58. {sqlspec-0.11.1 → sqlspec-0.12.1}/sqlspec/extensions/litestar/handlers.py +13 -12
  59. {sqlspec-0.11.1 → sqlspec-0.12.1}/sqlspec/extensions/litestar/plugin.py +22 -24
  60. {sqlspec-0.11.1 → sqlspec-0.12.1}/sqlspec/extensions/litestar/providers.py +37 -55
  61. sqlspec-0.12.1/sqlspec/loader.py +528 -0
  62. sqlspec-0.12.1/sqlspec/service/__init__.py +3 -0
  63. sqlspec-0.12.1/sqlspec/service/base.py +24 -0
  64. sqlspec-0.12.1/sqlspec/service/pagination.py +26 -0
  65. sqlspec-0.12.1/sqlspec/statement/__init__.py +21 -0
  66. sqlspec-0.12.1/sqlspec/statement/builder/__init__.py +54 -0
  67. sqlspec-0.12.1/sqlspec/statement/builder/_ddl_utils.py +119 -0
  68. sqlspec-0.12.1/sqlspec/statement/builder/_parsing_utils.py +135 -0
  69. sqlspec-0.12.1/sqlspec/statement/builder/base.py +328 -0
  70. sqlspec-0.12.1/sqlspec/statement/builder/ddl.py +1379 -0
  71. sqlspec-0.12.1/sqlspec/statement/builder/delete.py +80 -0
  72. sqlspec-0.12.1/sqlspec/statement/builder/insert.py +274 -0
  73. sqlspec-0.12.1/sqlspec/statement/builder/merge.py +95 -0
  74. sqlspec-0.12.1/sqlspec/statement/builder/mixins/__init__.py +65 -0
  75. sqlspec-0.12.1/sqlspec/statement/builder/mixins/_aggregate_functions.py +151 -0
  76. sqlspec-0.12.1/sqlspec/statement/builder/mixins/_case_builder.py +91 -0
  77. sqlspec-0.12.1/sqlspec/statement/builder/mixins/_common_table_expr.py +91 -0
  78. sqlspec-0.12.1/sqlspec/statement/builder/mixins/_delete_from.py +34 -0
  79. sqlspec-0.12.1/sqlspec/statement/builder/mixins/_from.py +61 -0
  80. sqlspec-0.12.1/sqlspec/statement/builder/mixins/_group_by.py +119 -0
  81. sqlspec-0.12.1/sqlspec/statement/builder/mixins/_having.py +35 -0
  82. sqlspec-0.12.1/sqlspec/statement/builder/mixins/_insert_from_select.py +48 -0
  83. sqlspec-0.12.1/sqlspec/statement/builder/mixins/_insert_into.py +36 -0
  84. sqlspec-0.12.1/sqlspec/statement/builder/mixins/_insert_values.py +69 -0
  85. sqlspec-0.12.1/sqlspec/statement/builder/mixins/_join.py +110 -0
  86. sqlspec-0.12.1/sqlspec/statement/builder/mixins/_limit_offset.py +53 -0
  87. sqlspec-0.12.1/sqlspec/statement/builder/mixins/_merge_clauses.py +405 -0
  88. sqlspec-0.12.1/sqlspec/statement/builder/mixins/_order_by.py +46 -0
  89. sqlspec-0.12.1/sqlspec/statement/builder/mixins/_pivot.py +82 -0
  90. sqlspec-0.12.1/sqlspec/statement/builder/mixins/_returning.py +37 -0
  91. sqlspec-0.12.1/sqlspec/statement/builder/mixins/_select_columns.py +60 -0
  92. sqlspec-0.12.1/sqlspec/statement/builder/mixins/_set_ops.py +122 -0
  93. sqlspec-0.12.1/sqlspec/statement/builder/mixins/_unpivot.py +80 -0
  94. sqlspec-0.12.1/sqlspec/statement/builder/mixins/_update_from.py +54 -0
  95. sqlspec-0.12.1/sqlspec/statement/builder/mixins/_update_set.py +91 -0
  96. sqlspec-0.12.1/sqlspec/statement/builder/mixins/_update_table.py +29 -0
  97. sqlspec-0.12.1/sqlspec/statement/builder/mixins/_where.py +374 -0
  98. sqlspec-0.12.1/sqlspec/statement/builder/mixins/_window_functions.py +86 -0
  99. sqlspec-0.12.1/sqlspec/statement/builder/protocols.py +20 -0
  100. sqlspec-0.12.1/sqlspec/statement/builder/select.py +206 -0
  101. sqlspec-0.12.1/sqlspec/statement/builder/update.py +178 -0
  102. sqlspec-0.12.1/sqlspec/statement/filters.py +571 -0
  103. sqlspec-0.12.1/sqlspec/statement/parameters.py +736 -0
  104. sqlspec-0.12.1/sqlspec/statement/pipelines/__init__.py +67 -0
  105. sqlspec-0.12.1/sqlspec/statement/pipelines/analyzers/__init__.py +9 -0
  106. sqlspec-0.12.1/sqlspec/statement/pipelines/analyzers/_analyzer.py +649 -0
  107. sqlspec-0.12.1/sqlspec/statement/pipelines/base.py +315 -0
  108. sqlspec-0.12.1/sqlspec/statement/pipelines/context.py +119 -0
  109. sqlspec-0.12.1/sqlspec/statement/pipelines/result_types.py +41 -0
  110. sqlspec-0.12.1/sqlspec/statement/pipelines/transformers/__init__.py +8 -0
  111. sqlspec-0.12.1/sqlspec/statement/pipelines/transformers/_expression_simplifier.py +256 -0
  112. sqlspec-0.12.1/sqlspec/statement/pipelines/transformers/_literal_parameterizer.py +623 -0
  113. sqlspec-0.12.1/sqlspec/statement/pipelines/transformers/_remove_comments.py +66 -0
  114. sqlspec-0.12.1/sqlspec/statement/pipelines/transformers/_remove_hints.py +81 -0
  115. sqlspec-0.12.1/sqlspec/statement/pipelines/validators/__init__.py +23 -0
  116. sqlspec-0.12.1/sqlspec/statement/pipelines/validators/_dml_safety.py +275 -0
  117. sqlspec-0.12.1/sqlspec/statement/pipelines/validators/_parameter_style.py +297 -0
  118. sqlspec-0.12.1/sqlspec/statement/pipelines/validators/_performance.py +703 -0
  119. sqlspec-0.12.1/sqlspec/statement/pipelines/validators/_security.py +990 -0
  120. sqlspec-0.12.1/sqlspec/statement/pipelines/validators/base.py +67 -0
  121. sqlspec-0.12.1/sqlspec/statement/result.py +527 -0
  122. sqlspec-0.12.1/sqlspec/statement/splitter.py +701 -0
  123. sqlspec-0.12.1/sqlspec/statement/sql.py +1198 -0
  124. sqlspec-0.12.1/sqlspec/storage/__init__.py +15 -0
  125. sqlspec-0.12.1/sqlspec/storage/backends/base.py +166 -0
  126. sqlspec-0.12.1/sqlspec/storage/backends/fsspec.py +315 -0
  127. sqlspec-0.12.1/sqlspec/storage/backends/obstore.py +464 -0
  128. sqlspec-0.12.1/sqlspec/storage/protocol.py +170 -0
  129. sqlspec-0.12.1/sqlspec/storage/registry.py +315 -0
  130. {sqlspec-0.11.1 → sqlspec-0.12.1}/sqlspec/typing.py +157 -36
  131. sqlspec-0.12.1/sqlspec/utils/correlation.py +155 -0
  132. {sqlspec-0.11.1 → sqlspec-0.12.1}/sqlspec/utils/deprecation.py +3 -6
  133. {sqlspec-0.11.1 → sqlspec-0.12.1}/sqlspec/utils/fixtures.py +6 -11
  134. sqlspec-0.12.1/sqlspec/utils/logging.py +135 -0
  135. sqlspec-0.12.1/sqlspec/utils/module_loader.py +94 -0
  136. sqlspec-0.12.1/sqlspec/utils/serializers.py +4 -0
  137. {sqlspec-0.11.1 → sqlspec-0.12.1}/sqlspec/utils/singleton.py +6 -8
  138. {sqlspec-0.11.1 → sqlspec-0.12.1}/sqlspec/utils/sync_tools.py +15 -27
  139. sqlspec-0.12.1/sqlspec/utils/text.py +140 -0
  140. {sqlspec-0.11.1 → sqlspec-0.12.1}/tests/conftest.py +11 -0
  141. sqlspec-0.12.1/tests/fixtures/ddls-mysql-collection.sql +257 -0
  142. sqlspec-0.12.1/tests/fixtures/ddls-postgres-collection.sql +913 -0
  143. sqlspec-0.12.1/tests/fixtures/init.sql +25 -0
  144. sqlspec-0.12.1/tests/fixtures/mysql/collection-config.sql +570 -0
  145. sqlspec-0.12.1/tests/fixtures/mysql/collection-data_types.sql +42 -0
  146. sqlspec-0.12.1/tests/fixtures/mysql/collection-database_details.sql +182 -0
  147. sqlspec-0.12.1/tests/fixtures/mysql/collection-engines.sql +34 -0
  148. sqlspec-0.12.1/tests/fixtures/mysql/collection-hostname.sql +17 -0
  149. sqlspec-0.12.1/tests/fixtures/mysql/collection-plugins.sql +44 -0
  150. sqlspec-0.12.1/tests/fixtures/mysql/collection-process_list.sql +38 -0
  151. sqlspec-0.12.1/tests/fixtures/mysql/collection-resource-groups.sql +50 -0
  152. sqlspec-0.12.1/tests/fixtures/mysql/collection-schema_objects.sql +197 -0
  153. sqlspec-0.12.1/tests/fixtures/mysql/collection-table_details.sql +134 -0
  154. sqlspec-0.12.1/tests/fixtures/mysql/collection-users.sql +52 -0
  155. sqlspec-0.12.1/tests/fixtures/mysql/init.sql +39 -0
  156. sqlspec-0.12.1/tests/fixtures/oracle.ddl.sql +206 -0
  157. sqlspec-0.12.1/tests/fixtures/postgres/collection-applications.sql +26 -0
  158. sqlspec-0.12.1/tests/fixtures/postgres/collection-aws_extension_dependency.sql +406 -0
  159. sqlspec-0.12.1/tests/fixtures/postgres/collection-aws_oracle_exists.sql +25 -0
  160. sqlspec-0.12.1/tests/fixtures/postgres/collection-bg_writer_stats.sql +63 -0
  161. sqlspec-0.12.1/tests/fixtures/postgres/collection-calculated_metrics.sql +245 -0
  162. sqlspec-0.12.1/tests/fixtures/postgres/collection-data_types.sql +72 -0
  163. sqlspec-0.12.1/tests/fixtures/postgres/collection-database_details.sql +386 -0
  164. sqlspec-0.12.1/tests/fixtures/postgres/collection-extensions.sql +41 -0
  165. sqlspec-0.12.1/tests/fixtures/postgres/collection-index_details.sql +75 -0
  166. sqlspec-0.12.1/tests/fixtures/postgres/collection-pglogical-details.sql +28 -0
  167. sqlspec-0.12.1/tests/fixtures/postgres/collection-privileges.sql +152 -0
  168. sqlspec-0.12.1/tests/fixtures/postgres/collection-replication_slots.sql +131 -0
  169. sqlspec-0.12.1/tests/fixtures/postgres/collection-replication_stats.sql +63 -0
  170. sqlspec-0.12.1/tests/fixtures/postgres/collection-schema_details.sql +77 -0
  171. sqlspec-0.12.1/tests/fixtures/postgres/collection-schema_objects.sql +205 -0
  172. sqlspec-0.12.1/tests/fixtures/postgres/collection-settings.sql +56 -0
  173. sqlspec-0.12.1/tests/fixtures/postgres/collection-source_details.sql +63 -0
  174. sqlspec-0.12.1/tests/fixtures/postgres/collection-table_details.sql +496 -0
  175. sqlspec-0.12.1/tests/fixtures/postgres/extended-collection-all-databases.sql +36 -0
  176. sqlspec-0.12.1/tests/fixtures/postgres/init.sql +24 -0
  177. sqlspec-0.12.1/tests/fixtures/readiness-check.sql +35 -0
  178. {sqlspec-0.11.1 → sqlspec-0.12.1}/tests/integration/test_adapters/test_adbc/conftest.py +4 -4
  179. sqlspec-0.12.1/tests/integration/test_adapters/test_adbc/test_arrow_functionality.py +199 -0
  180. sqlspec-0.12.1/tests/integration/test_adapters/test_adbc/test_bigquery_driver.py +289 -0
  181. sqlspec-0.12.1/tests/integration/test_adapters/test_adbc/test_connection.py +85 -0
  182. sqlspec-0.12.1/tests/integration/test_adapters/test_adbc/test_data_types.py +261 -0
  183. sqlspec-0.12.1/tests/integration/test_adapters/test_adbc/test_driver.py +954 -0
  184. sqlspec-0.12.1/tests/integration/test_adapters/test_adbc/test_duckdb_driver.py +371 -0
  185. sqlspec-0.12.1/tests/integration/test_adapters/test_adbc/test_execute_many.py +195 -0
  186. sqlspec-0.12.1/tests/integration/test_adapters/test_adbc/test_execute_script.py +255 -0
  187. sqlspec-0.12.1/tests/integration/test_adapters/test_adbc/test_parameter_styles.py +176 -0
  188. sqlspec-0.12.1/tests/integration/test_adapters/test_adbc/test_postgres_driver.py +1153 -0
  189. sqlspec-0.12.1/tests/integration/test_adapters/test_adbc/test_returning.py +129 -0
  190. sqlspec-0.12.1/tests/integration/test_adapters/test_adbc/test_sqlite_driver.py +491 -0
  191. sqlspec-0.12.1/tests/integration/test_adapters/test_aiosqlite/__init__.py +1 -0
  192. sqlspec-0.12.1/tests/integration/test_adapters/test_aiosqlite/test_driver.py +503 -0
  193. sqlspec-0.12.1/tests/integration/test_adapters/test_asyncmy/test_config.py +154 -0
  194. sqlspec-0.12.1/tests/integration/test_adapters/test_asyncpg/__init__.py +1 -0
  195. sqlspec-0.12.1/tests/integration/test_adapters/test_asyncpg/conftest.py +50 -0
  196. sqlspec-0.12.1/tests/integration/test_adapters/test_asyncpg/test_arrow_functionality.py +200 -0
  197. {sqlspec-0.11.1 → sqlspec-0.12.1}/tests/integration/test_adapters/test_asyncpg/test_connection.py +5 -6
  198. sqlspec-0.12.1/tests/integration/test_adapters/test_asyncpg/test_driver.py +683 -0
  199. sqlspec-0.12.1/tests/integration/test_adapters/test_asyncpg/test_execute_many.py +321 -0
  200. sqlspec-0.12.1/tests/integration/test_adapters/test_asyncpg/test_parameter_styles.py +410 -0
  201. {sqlspec-0.11.1 → sqlspec-0.12.1}/tests/integration/test_adapters/test_bigquery/conftest.py +5 -7
  202. sqlspec-0.12.1/tests/integration/test_adapters/test_bigquery/test_arrow_functionality.py +356 -0
  203. {sqlspec-0.11.1 → sqlspec-0.12.1}/tests/integration/test_adapters/test_bigquery/test_connection.py +5 -2
  204. sqlspec-0.12.1/tests/integration/test_adapters/test_bigquery/test_driver.py +543 -0
  205. sqlspec-0.12.1/tests/integration/test_adapters/test_duckdb/test_arrow_functionality.py +440 -0
  206. sqlspec-0.12.1/tests/integration/test_adapters/test_duckdb/test_connection.py +252 -0
  207. sqlspec-0.12.1/tests/integration/test_adapters/test_duckdb/test_driver.py +735 -0
  208. sqlspec-0.12.1/tests/integration/test_adapters/test_duckdb/test_execute_many.py +315 -0
  209. sqlspec-0.12.1/tests/integration/test_adapters/test_duckdb/test_parameter_styles.py +510 -0
  210. {sqlspec-0.11.1 → sqlspec-0.12.1}/tests/integration/test_adapters/test_oracledb/test_connection.py +19 -21
  211. sqlspec-0.12.1/tests/integration/test_adapters/test_oracledb/test_driver_async.py +385 -0
  212. sqlspec-0.12.1/tests/integration/test_adapters/test_oracledb/test_driver_sync.py +292 -0
  213. sqlspec-0.12.1/tests/integration/test_adapters/test_psqlpy/test_arrow_functionality.py +418 -0
  214. {sqlspec-0.11.1 → sqlspec-0.12.1}/tests/integration/test_adapters/test_psqlpy/test_connection.py +22 -16
  215. sqlspec-0.12.1/tests/integration/test_adapters/test_psqlpy/test_driver.py +499 -0
  216. {sqlspec-0.11.1 → sqlspec-0.12.1}/tests/integration/test_adapters/test_psycopg/test_connection.py +14 -24
  217. sqlspec-0.12.1/tests/integration/test_adapters/test_psycopg/test_driver.py +603 -0
  218. sqlspec-0.12.1/tests/integration/test_adapters/test_psycopg/test_execute_many.py +393 -0
  219. sqlspec-0.12.1/tests/integration/test_adapters/test_psycopg/test_parameter_styles.py +471 -0
  220. sqlspec-0.12.1/tests/integration/test_adapters/test_sqlite/__init__.py +1 -0
  221. sqlspec-0.12.1/tests/integration/test_adapters/test_sqlite/test_driver.py +593 -0
  222. sqlspec-0.12.1/tests/integration/test_dialect_propagation.py +288 -0
  223. sqlspec-0.12.1/tests/integration/test_sql_file_loader.py +620 -0
  224. sqlspec-0.12.1/tests/integration/test_storage/__init__.py +1 -0
  225. sqlspec-0.12.1/tests/integration/test_storage/test_driver_storage_integration.py +387 -0
  226. sqlspec-0.12.1/tests/integration/test_storage/test_end_to_end_workflows.py +557 -0
  227. sqlspec-0.12.1/tests/integration/test_storage/test_storage_mixins.py +387 -0
  228. sqlspec-0.12.1/tests/unit/test_adapters/__init__.py +3 -0
  229. sqlspec-0.12.1/tests/unit/test_adapters/test_adbc/__init__.py +3 -0
  230. sqlspec-0.12.1/tests/unit/test_adapters/test_adbc/test_config.py +127 -0
  231. sqlspec-0.12.1/tests/unit/test_adapters/test_adbc/test_driver.py +529 -0
  232. sqlspec-0.12.1/tests/unit/test_adapters/test_aiosqlite/__init__.py +3 -0
  233. sqlspec-0.12.1/tests/unit/test_adapters/test_aiosqlite/test_config.py +105 -0
  234. sqlspec-0.12.1/tests/unit/test_adapters/test_aiosqlite/test_driver.py +189 -0
  235. sqlspec-0.12.1/tests/unit/test_adapters/test_asyncmy/__init__.py +3 -0
  236. sqlspec-0.12.1/tests/unit/test_adapters/test_asyncmy/test_driver.py +276 -0
  237. sqlspec-0.12.1/tests/unit/test_adapters/test_asyncpg/__init__.py +3 -0
  238. sqlspec-0.12.1/tests/unit/test_adapters/test_asyncpg/test_config.py +586 -0
  239. sqlspec-0.12.1/tests/unit/test_adapters/test_asyncpg/test_driver.py +559 -0
  240. sqlspec-0.12.1/tests/unit/test_adapters/test_bigquery/__init__.py +1 -0
  241. sqlspec-0.12.1/tests/unit/test_adapters/test_bigquery/test_config.py +434 -0
  242. sqlspec-0.12.1/tests/unit/test_adapters/test_bigquery/test_driver.py +687 -0
  243. sqlspec-0.12.1/tests/unit/test_adapters/test_duckdb/__init__.py +3 -0
  244. sqlspec-0.12.1/tests/unit/test_adapters/test_duckdb/test_config.py +518 -0
  245. sqlspec-0.12.1/tests/unit/test_adapters/test_duckdb/test_driver.py +665 -0
  246. sqlspec-0.12.1/tests/unit/test_adapters/test_oracledb/__init__.py +3 -0
  247. sqlspec-0.12.1/tests/unit/test_adapters/test_oracledb/test_config.py +145 -0
  248. sqlspec-0.12.1/tests/unit/test_adapters/test_oracledb/test_driver.py +128 -0
  249. sqlspec-0.12.1/tests/unit/test_adapters/test_psqlpy/__init__.py +3 -0
  250. sqlspec-0.12.1/tests/unit/test_adapters/test_psqlpy/test_config.py +151 -0
  251. sqlspec-0.12.1/tests/unit/test_adapters/test_psqlpy/test_driver.py +146 -0
  252. sqlspec-0.12.1/tests/unit/test_adapters/test_psycopg/__init__.py +3 -0
  253. sqlspec-0.12.1/tests/unit/test_adapters/test_psycopg/test_config.py +740 -0
  254. sqlspec-0.12.1/tests/unit/test_adapters/test_psycopg/test_driver.py +751 -0
  255. sqlspec-0.12.1/tests/unit/test_adapters/test_sqlite/__init__.py +3 -0
  256. sqlspec-0.12.1/tests/unit/test_adapters/test_sqlite/test_config.py +341 -0
  257. sqlspec-0.12.1/tests/unit/test_adapters/test_sqlite/test_driver.py +519 -0
  258. sqlspec-0.12.1/tests/unit/test_base.py +538 -0
  259. sqlspec-0.12.1/tests/unit/test_config.py +523 -0
  260. sqlspec-0.12.1/tests/unit/test_config_dialect.py +407 -0
  261. sqlspec-0.12.1/tests/unit/test_driver.py +711 -0
  262. sqlspec-0.12.1/tests/unit/test_exceptions.py +862 -0
  263. sqlspec-0.12.1/tests/unit/test_extensions/test_aiosql/test_adapter.py +409 -0
  264. sqlspec-0.12.1/tests/unit/test_loader.py +431 -0
  265. sqlspec-0.12.1/tests/unit/test_statement/__init__.py +0 -0
  266. sqlspec-0.12.1/tests/unit/test_statement/test_base.py +510 -0
  267. sqlspec-0.12.1/tests/unit/test_statement/test_builder/__init__.py +0 -0
  268. sqlspec-0.12.1/tests/unit/test_statement/test_builder/test_base.py +767 -0
  269. sqlspec-0.12.1/tests/unit/test_statement/test_builder/test_builder_mixins.py +1011 -0
  270. sqlspec-0.12.1/tests/unit/test_statement/test_builder/test_delete.py +336 -0
  271. sqlspec-0.12.1/tests/unit/test_statement/test_builder/test_insert.py +477 -0
  272. sqlspec-0.12.1/tests/unit/test_statement/test_builder/test_merge.py +579 -0
  273. sqlspec-0.12.1/tests/unit/test_statement/test_builder/test_select.py +682 -0
  274. sqlspec-0.12.1/tests/unit/test_statement/test_builder/test_update.py +537 -0
  275. sqlspec-0.12.1/tests/unit/test_statement/test_config.py +515 -0
  276. sqlspec-0.12.1/tests/unit/test_statement/test_filters.py +510 -0
  277. sqlspec-0.12.1/tests/unit/test_statement/test_mixins.py +364 -0
  278. sqlspec-0.12.1/tests/unit/test_statement/test_oracle_numeric_parameters.py +336 -0
  279. sqlspec-0.12.1/tests/unit/test_statement/test_parameter_normalization.py +127 -0
  280. sqlspec-0.12.1/tests/unit/test_statement/test_parameter_preservation.py +158 -0
  281. sqlspec-0.12.1/tests/unit/test_statement/test_parameters.py +515 -0
  282. sqlspec-0.12.1/tests/unit/test_statement/test_pipelines/__init__.py +0 -0
  283. sqlspec-0.12.1/tests/unit/test_statement/test_pipelines/test_analyzer.py +566 -0
  284. sqlspec-0.12.1/tests/unit/test_statement/test_pipelines/test_analyzer_subquery_detection.py +377 -0
  285. sqlspec-0.12.1/tests/unit/test_statement/test_pipelines/test_base.py +408 -0
  286. sqlspec-0.12.1/tests/unit/test_statement/test_pipelines/test_expression_simplifier.py +479 -0
  287. sqlspec-0.12.1/tests/unit/test_statement/test_pipelines/test_transformers_literal_parameterizer.py +611 -0
  288. sqlspec-0.12.1/tests/unit/test_statement/test_pipelines/test_transformers_remove_comments.py +550 -0
  289. sqlspec-0.12.1/tests/unit/test_statement/test_pipelines/test_validators_dml_safety.py +496 -0
  290. sqlspec-0.12.1/tests/unit/test_statement/test_pipelines/test_validators_parameter_style.py +440 -0
  291. sqlspec-0.12.1/tests/unit/test_statement/test_pipelines/test_validators_performance.py +580 -0
  292. sqlspec-0.12.1/tests/unit/test_statement/test_pipelines/test_validators_security.py +598 -0
  293. sqlspec-0.12.1/tests/unit/test_statement/test_result.py +506 -0
  294. sqlspec-0.12.1/tests/unit/test_statement/test_splitter.py +450 -0
  295. sqlspec-0.12.1/tests/unit/test_statement/test_sql.py +483 -0
  296. sqlspec-0.12.1/tests/unit/test_statement/test_sql_translator_mixin.py +290 -0
  297. sqlspec-0.12.1/tests/unit/test_statement/test_sqlfactory.py +95 -0
  298. sqlspec-0.12.1/tests/unit/test_statement/test_storage.py +235 -0
  299. sqlspec-0.12.1/tests/unit/test_statement/test_transformers/test_expression_simplifier_parameter_tracking.py +129 -0
  300. sqlspec-0.12.1/tests/unit/test_storage/__init__.py +1 -0
  301. sqlspec-0.12.1/tests/unit/test_storage/test_backends/__init__.py +1 -0
  302. sqlspec-0.12.1/tests/unit/test_storage/test_backends/test_fsspec_backend.py +624 -0
  303. sqlspec-0.12.1/tests/unit/test_storage/test_backends/test_obstore_backend.py +671 -0
  304. sqlspec-0.12.1/tests/unit/test_storage/test_base.py +431 -0
  305. sqlspec-0.12.1/tests/unit/test_storage/test_registry.py +413 -0
  306. {sqlspec-0.11.1 → sqlspec-0.12.1}/tests/unit/test_typing.py +2 -11
  307. sqlspec-0.12.1/tests/unit/test_utils/__init__.py +0 -0
  308. sqlspec-0.12.1/tests/unit/test_utils/test_deprecation.py +365 -0
  309. sqlspec-0.12.1/tests/unit/test_utils/test_fixtures.py +305 -0
  310. sqlspec-0.12.1/tests/unit/test_utils/test_module_loader.py +359 -0
  311. sqlspec-0.12.1/tests/unit/test_utils/test_singleton.py +324 -0
  312. sqlspec-0.12.1/tests/unit/test_utils/test_sync_tools.py +474 -0
  313. sqlspec-0.12.1/tests/unit/test_utils/test_text.py +315 -0
  314. sqlspec-0.12.1/tools/__init__.py +0 -0
  315. {sqlspec-0.11.1 → sqlspec-0.12.1}/tools/sphinx_ext/changelog.py +2 -7
  316. {sqlspec-0.11.1 → sqlspec-0.12.1}/tools/sphinx_ext/missing_references.py +1 -4
  317. {sqlspec-0.11.1 → sqlspec-0.12.1}/uv.lock +1696 -986
  318. sqlspec-0.11.1/sqlspec/__init__.py +0 -16
  319. sqlspec-0.11.1/sqlspec/_typing.py +0 -242
  320. sqlspec-0.11.1/sqlspec/adapters/adbc/__init__.py +0 -8
  321. sqlspec-0.11.1/sqlspec/adapters/adbc/config.py +0 -207
  322. sqlspec-0.11.1/sqlspec/adapters/adbc/driver.py +0 -679
  323. sqlspec-0.11.1/sqlspec/adapters/aiosqlite/__init__.py +0 -8
  324. sqlspec-0.11.1/sqlspec/adapters/aiosqlite/config.py +0 -102
  325. sqlspec-0.11.1/sqlspec/adapters/aiosqlite/driver.py +0 -456
  326. sqlspec-0.11.1/sqlspec/adapters/asyncmy/__init__.py +0 -9
  327. sqlspec-0.11.1/sqlspec/adapters/asyncmy/config.py +0 -241
  328. sqlspec-0.11.1/sqlspec/adapters/asyncmy/driver.py +0 -462
  329. sqlspec-0.11.1/sqlspec/adapters/asyncpg/__init__.py +0 -9
  330. sqlspec-0.11.1/sqlspec/adapters/asyncpg/config.py +0 -221
  331. sqlspec-0.11.1/sqlspec/adapters/asyncpg/driver.py +0 -531
  332. sqlspec-0.11.1/sqlspec/adapters/bigquery/__init__.py +0 -4
  333. sqlspec-0.11.1/sqlspec/adapters/bigquery/config/__init__.py +0 -3
  334. sqlspec-0.11.1/sqlspec/adapters/bigquery/config/_common.py +0 -40
  335. sqlspec-0.11.1/sqlspec/adapters/bigquery/config/_sync.py +0 -87
  336. sqlspec-0.11.1/sqlspec/adapters/bigquery/driver.py +0 -621
  337. sqlspec-0.11.1/sqlspec/adapters/duckdb/__init__.py +0 -8
  338. sqlspec-0.11.1/sqlspec/adapters/duckdb/config.py +0 -379
  339. sqlspec-0.11.1/sqlspec/adapters/duckdb/driver.py +0 -425
  340. sqlspec-0.11.1/sqlspec/adapters/oracledb/config/__init__.py +0 -9
  341. sqlspec-0.11.1/sqlspec/adapters/oracledb/config/_asyncio.py +0 -186
  342. sqlspec-0.11.1/sqlspec/adapters/oracledb/config/_common.py +0 -131
  343. sqlspec-0.11.1/sqlspec/adapters/oracledb/config/_sync.py +0 -186
  344. sqlspec-0.11.1/sqlspec/adapters/oracledb/driver.py +0 -954
  345. sqlspec-0.11.1/sqlspec/adapters/psqlpy/__init__.py +0 -9
  346. sqlspec-0.11.1/sqlspec/adapters/psqlpy/config.py +0 -250
  347. sqlspec-0.11.1/sqlspec/adapters/psqlpy/driver.py +0 -550
  348. sqlspec-0.11.1/sqlspec/adapters/psycopg/config/__init__.py +0 -19
  349. sqlspec-0.11.1/sqlspec/adapters/psycopg/config/_async.py +0 -169
  350. sqlspec-0.11.1/sqlspec/adapters/psycopg/config/_common.py +0 -56
  351. sqlspec-0.11.1/sqlspec/adapters/psycopg/config/_sync.py +0 -168
  352. sqlspec-0.11.1/sqlspec/adapters/psycopg/driver.py +0 -749
  353. sqlspec-0.11.1/sqlspec/adapters/sqlite/__init__.py +0 -8
  354. sqlspec-0.11.1/sqlspec/adapters/sqlite/config.py +0 -109
  355. sqlspec-0.11.1/sqlspec/adapters/sqlite/driver.py +0 -426
  356. sqlspec-0.11.1/sqlspec/base.py +0 -1039
  357. sqlspec-0.11.1/sqlspec/exceptions.py +0 -140
  358. sqlspec-0.11.1/sqlspec/filters.py +0 -331
  359. sqlspec-0.11.1/sqlspec/mixins.py +0 -305
  360. sqlspec-0.11.1/sqlspec/statement.py +0 -378
  361. sqlspec-0.11.1/sqlspec/utils/module_loader.py +0 -92
  362. sqlspec-0.11.1/sqlspec/utils/text.py +0 -108
  363. sqlspec-0.11.1/tests/integration/test_adapters/test_adbc/test_connection.py +0 -31
  364. sqlspec-0.11.1/tests/integration/test_adapters/test_adbc/test_driver_bigquery.py +0 -227
  365. sqlspec-0.11.1/tests/integration/test_adapters/test_adbc/test_driver_duckdb.py +0 -444
  366. sqlspec-0.11.1/tests/integration/test_adapters/test_adbc/test_driver_postgres.py +0 -201
  367. sqlspec-0.11.1/tests/integration/test_adapters/test_adbc/test_driver_sqlite.py +0 -302
  368. sqlspec-0.11.1/tests/integration/test_adapters/test_aiosqlite/__init__.py +0 -5
  369. sqlspec-0.11.1/tests/integration/test_adapters/test_aiosqlite/test_connection.py +0 -28
  370. sqlspec-0.11.1/tests/integration/test_adapters/test_aiosqlite/test_driver.py +0 -168
  371. sqlspec-0.11.1/tests/integration/test_adapters/test_asyncmy/test_connection.py +0 -54
  372. sqlspec-0.11.1/tests/integration/test_adapters/test_asyncmy/test_driver.py +0 -218
  373. sqlspec-0.11.1/tests/integration/test_adapters/test_asyncpg/test_driver.py +0 -395
  374. sqlspec-0.11.1/tests/integration/test_adapters/test_bigquery/test_driver.py +0 -288
  375. sqlspec-0.11.1/tests/integration/test_adapters/test_duckdb/test_connection.py +0 -28
  376. sqlspec-0.11.1/tests/integration/test_adapters/test_duckdb/test_driver.py +0 -169
  377. sqlspec-0.11.1/tests/integration/test_adapters/test_oracledb/test_driver_async.py +0 -201
  378. sqlspec-0.11.1/tests/integration/test_adapters/test_oracledb/test_driver_sync.py +0 -197
  379. sqlspec-0.11.1/tests/integration/test_adapters/test_psqlpy/test_driver.py +0 -315
  380. sqlspec-0.11.1/tests/integration/test_adapters/test_psycopg/test_driver.py +0 -408
  381. sqlspec-0.11.1/tests/integration/test_adapters/test_sqlite/__init__.py +0 -5
  382. sqlspec-0.11.1/tests/integration/test_adapters/test_sqlite/test_connection.py +0 -27
  383. sqlspec-0.11.1/tests/integration/test_adapters/test_sqlite/test_driver.py +0 -178
  384. sqlspec-0.11.1/tests/unit/test_adapters/test_adbc/__init__.py +0 -1
  385. sqlspec-0.11.1/tests/unit/test_adapters/test_adbc/test_config.py +0 -91
  386. sqlspec-0.11.1/tests/unit/test_adapters/test_aiosqlite/__init__.py +0 -1
  387. sqlspec-0.11.1/tests/unit/test_adapters/test_aiosqlite/test_config.py +0 -107
  388. sqlspec-0.11.1/tests/unit/test_adapters/test_asyncmy/__init__.py +0 -1
  389. sqlspec-0.11.1/tests/unit/test_adapters/test_asyncmy/test_config.py +0 -152
  390. sqlspec-0.11.1/tests/unit/test_adapters/test_asyncpg/__init__.py +0 -1
  391. sqlspec-0.11.1/tests/unit/test_adapters/test_asyncpg/test_config.py +0 -153
  392. sqlspec-0.11.1/tests/unit/test_adapters/test_duckdb/test_config.py +0 -137
  393. sqlspec-0.11.1/tests/unit/test_adapters/test_oracledb/__init__.py +0 -1
  394. sqlspec-0.11.1/tests/unit/test_adapters/test_oracledb/test_async_config.py +0 -135
  395. sqlspec-0.11.1/tests/unit/test_adapters/test_oracledb/test_sync_config.py +0 -129
  396. sqlspec-0.11.1/tests/unit/test_adapters/test_psycopg/__init__.py +0 -1
  397. sqlspec-0.11.1/tests/unit/test_adapters/test_psycopg/test_async_config.py +0 -179
  398. sqlspec-0.11.1/tests/unit/test_adapters/test_psycopg/test_sync_config.py +0 -160
  399. sqlspec-0.11.1/tests/unit/test_adapters/test_sqlite/__init__.py +0 -1
  400. sqlspec-0.11.1/tests/unit/test_adapters/test_sqlite/test_config.py +0 -89
  401. sqlspec-0.11.1/tests/unit/test_base.py +0 -300
  402. sqlspec-0.11.1/tests/unit/test_statement.py +0 -287
  403. sqlspec-0.11.1/tests/unit/test_utils/test_module_loader.py +0 -46
  404. sqlspec-0.11.1/tests/unit/test_utils/test_sync_tools.py +0 -76
  405. sqlspec-0.11.1/tests/unit/test_utils/test_text.py +0 -57
  406. {sqlspec-0.11.1 → sqlspec-0.12.1}/CONTRIBUTING.rst +0 -0
  407. {sqlspec-0.11.1 → sqlspec-0.12.1}/LICENSE +0 -0
  408. {sqlspec-0.11.1 → sqlspec-0.12.1}/Makefile +0 -0
  409. {sqlspec-0.11.1 → sqlspec-0.12.1}/NOTICE +0 -0
  410. {sqlspec-0.11.1 → sqlspec-0.12.1}/sqlspec/__metadata__.py +0 -0
  411. {sqlspec-0.11.1 → sqlspec-0.12.1}/sqlspec/adapters/__init__.py +0 -0
  412. {sqlspec-0.11.1 → sqlspec-0.12.1}/sqlspec/extensions/__init__.py +0 -0
  413. {sqlspec-0.11.1 → sqlspec-0.12.1}/sqlspec/py.typed +0 -0
  414. {sqlspec-0.11.1/tests → sqlspec-0.12.1/sqlspec/storage/backends}/__init__.py +0 -0
  415. {sqlspec-0.11.1 → sqlspec-0.12.1}/sqlspec/utils/__init__.py +0 -0
  416. {sqlspec-0.11.1/tests/integration/test_adapters/test_asyncpg → sqlspec-0.12.1/tests}/__init__.py +0 -0
  417. {sqlspec-0.11.1 → sqlspec-0.12.1}/tests/fixtures/__init__.py +0 -0
  418. {sqlspec-0.11.1 → sqlspec-0.12.1}/tests/fixtures/example_usage.py +0 -0
  419. {sqlspec-0.11.1 → sqlspec-0.12.1}/tests/fixtures/sql_utils.py +0 -0
  420. {sqlspec-0.11.1 → sqlspec-0.12.1}/tests/integration/__init__.py +0 -0
  421. {sqlspec-0.11.1 → sqlspec-0.12.1}/tests/integration/test_adapters/__init__.py +0 -0
  422. {sqlspec-0.11.1 → sqlspec-0.12.1}/tests/integration/test_adapters/test_adbc/__init__.py +0 -0
  423. {sqlspec-0.11.1 → sqlspec-0.12.1}/tests/integration/test_adapters/test_asyncmy/__init__.py +0 -0
  424. {sqlspec-0.11.1 → sqlspec-0.12.1}/tests/integration/test_adapters/test_bigquery/__init__.py +0 -0
  425. {sqlspec-0.11.1 → sqlspec-0.12.1}/tests/integration/test_adapters/test_duckdb/__init__.py +0 -0
  426. {sqlspec-0.11.1 → sqlspec-0.12.1}/tests/integration/test_adapters/test_oracledb/__init__.py +0 -0
  427. {sqlspec-0.11.1 → sqlspec-0.12.1}/tests/integration/test_adapters/test_psqlpy/__init__.py +0 -0
  428. {sqlspec-0.11.1 → sqlspec-0.12.1}/tests/integration/test_adapters/test_psycopg/__init__.py +0 -0
  429. {sqlspec-0.11.1/tests/unit → sqlspec-0.12.1/tests/integration/test_extensions}/__init__.py +0 -0
  430. {sqlspec-0.11.1/tests/unit/test_adapters → sqlspec-0.12.1/tests/integration/test_extensions/test_aiosql}/__init__.py +0 -0
  431. {sqlspec-0.11.1/tests/unit/test_adapters/test_duckdb → sqlspec-0.12.1/tests/integration/test_extensions/test_litestar}/__init__.py +0 -0
  432. {sqlspec-0.11.1/tests/unit/test_utils → sqlspec-0.12.1/tests/unit}/__init__.py +0 -0
  433. {sqlspec-0.11.1/tools → sqlspec-0.12.1/tests/unit/test_extensions}/__init__.py +0 -0
  434. {sqlspec-0.11.1 → sqlspec-0.12.1}/tools/build_docs.py +0 -0
  435. {sqlspec-0.11.1 → sqlspec-0.12.1}/tools/pypi_readme.py +0 -0
  436. {sqlspec-0.11.1 → sqlspec-0.12.1}/tools/sphinx_ext/__init__.py +0 -0
@@ -17,7 +17,9 @@ site/
17
17
  target/
18
18
  .idea/
19
19
  .vscode/
20
+ .claude/
20
21
  .cursor/
22
+ .zed/
21
23
 
22
24
  # files
23
25
  **/*.so
@@ -31,3 +33,13 @@ target/
31
33
  /docs/_build/
32
34
  coverage.*
33
35
  setup.py
36
+ tmp/
37
+ *.log
38
+ .bugs
39
+ .tmp
40
+ .todos
41
+ todo/
42
+ CLAUDE.md
43
+ CLAUDE.*.md
44
+ TODO*
45
+ .claudedocs
@@ -17,7 +17,7 @@ repos:
17
17
  - id: mixed-line-ending
18
18
  - id: trailing-whitespace
19
19
  - repo: https://github.com/charliermarsh/ruff-pre-commit
20
- rev: "v0.11.9"
20
+ rev: "v0.12.0"
21
21
  hooks:
22
22
  - id: ruff
23
23
  args: ["--fix"]
@@ -29,7 +29,7 @@ repos:
29
29
  additional_dependencies:
30
30
  - tomli
31
31
  - repo: https://github.com/python-formate/flake8-dunder-all
32
- rev: v0.4.1
32
+ rev: v0.5.0
33
33
  hooks:
34
34
  - id: ensure-dunder-all
35
35
  exclude: "test*|tools"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlspec
3
- Version: 0.11.1
3
+ Version: 0.12.1
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/
@@ -11,14 +11,17 @@ License-Expression: MIT
11
11
  License-File: LICENSE
12
12
  License-File: NOTICE
13
13
  Requires-Python: <4.0,>=3.9
14
+ Requires-Dist: click
14
15
  Requires-Dist: eval-type-backport; python_version < '3.10'
15
- Requires-Dist: sqlglot
16
+ Requires-Dist: sqlglot>=19.9.0
16
17
  Requires-Dist: typing-extensions
17
18
  Provides-Extra: adbc
18
19
  Requires-Dist: adbc-driver-manager; extra == 'adbc'
19
20
  Requires-Dist: pyarrow; extra == 'adbc'
20
21
  Provides-Extra: aioodbc
21
22
  Requires-Dist: aioodbc; extra == 'aioodbc'
23
+ Provides-Extra: aiosql
24
+ Requires-Dist: aiosql; extra == 'aiosql'
22
25
  Provides-Extra: aiosqlite
23
26
  Requires-Dist: aiosqlite; extra == 'aiosqlite'
24
27
  Provides-Extra: asyncmy
@@ -27,28 +30,41 @@ Provides-Extra: asyncpg
27
30
  Requires-Dist: asyncpg; extra == 'asyncpg'
28
31
  Provides-Extra: bigquery
29
32
  Requires-Dist: google-cloud-bigquery; extra == 'bigquery'
33
+ Provides-Extra: cli
34
+ Requires-Dist: rich-click; extra == 'cli'
30
35
  Provides-Extra: duckdb
31
36
  Requires-Dist: duckdb; extra == 'duckdb'
32
37
  Provides-Extra: fastapi
33
38
  Requires-Dist: fastapi; extra == 'fastapi'
34
39
  Provides-Extra: flask
35
40
  Requires-Dist: flask; extra == 'flask'
41
+ Provides-Extra: fsspec
42
+ Requires-Dist: fsspec; extra == 'fsspec'
36
43
  Provides-Extra: litestar
37
44
  Requires-Dist: litestar; extra == 'litestar'
38
45
  Provides-Extra: msgspec
39
46
  Requires-Dist: msgspec; extra == 'msgspec'
40
47
  Provides-Extra: nanoid
41
48
  Requires-Dist: fastnanoid>=0.4.1; extra == 'nanoid'
49
+ Provides-Extra: obstore
50
+ Requires-Dist: obstore; extra == 'obstore'
51
+ Provides-Extra: opentelemetry
52
+ Requires-Dist: opentelemetry-instrumentation; extra == 'opentelemetry'
42
53
  Provides-Extra: oracledb
43
54
  Requires-Dist: oracledb; extra == 'oracledb'
44
55
  Provides-Extra: orjson
45
56
  Requires-Dist: orjson; extra == 'orjson'
57
+ Provides-Extra: pandas
58
+ Requires-Dist: pandas; extra == 'pandas'
59
+ Requires-Dist: pyarrow; extra == 'pandas'
46
60
  Provides-Extra: performance
47
61
  Requires-Dist: msgspec; extra == 'performance'
48
62
  Requires-Dist: sqlglot[rs]; extra == 'performance'
49
63
  Provides-Extra: polars
50
64
  Requires-Dist: polars; extra == 'polars'
51
65
  Requires-Dist: pyarrow; extra == 'polars'
66
+ Provides-Extra: prometheus
67
+ Requires-Dist: prometheus-client; extra == 'prometheus'
52
68
  Provides-Extra: psqlpy
53
69
  Requires-Dist: psqlpy; extra == 'psqlpy'
54
70
  Provides-Extra: psycopg
@@ -63,7 +79,7 @@ Requires-Dist: pymysql; extra == 'pymysql'
63
79
  Provides-Extra: spanner
64
80
  Requires-Dist: google-cloud-spanner; extra == 'spanner'
65
81
  Provides-Extra: uuid
66
- Requires-Dist: uuid-utils>=0.6.1; extra == 'uuid'
82
+ Requires-Dist: uuid-utils; extra == 'uuid'
67
83
  Description-Content-Type: text/markdown
68
84
 
69
85
  # SQLSpec
@@ -72,18 +88,26 @@ Description-Content-Type: text/markdown
72
88
 
73
89
  SQLSpec is an experimental Python library designed to streamline and modernize your SQL interactions across a variety of database systems. While still in its early stages, SQLSpec aims to provide a flexible, typed, and extensible interface for working with SQL in Python.
74
90
 
75
- **Note**: SQLSpec is currently under active development and the API is subject to change. It is not yet ready for production use. Contributions are welcome!
91
+ **Note**: SQLSpec is currently under active development and the API is subject to change. It is not yet ready for production use. Contributions are welcome!
76
92
 
77
- ## Core Features (Planned but subject to change, removal or redesign)
93
+ ## Core Features (Current and Planned)
94
+
95
+ ### Currently Implemented
78
96
 
79
97
  - **Consistent Database Session Interface**: Provides a consistent connectivity interface for interacting with one or more database systems, including SQLite, Postgres, DuckDB, MySQL, Oracle, SQL Server, Spanner, BigQuery, and more.
80
- - **Emphasis on RAW SQL and Minimal Abstractions and Performance**: SQLSpec is a library for working with SQL in Python. It's goals are to offer minimal abstractions between the user and the database. It does not aim to be an ORM library.
98
+ - **Emphasis on RAW SQL and Minimal Abstractions**: SQLSpec is a library for working with SQL in Python. Its goals are to offer minimal abstractions between the user and the database. It does not aim to be an ORM library.
81
99
  - **Type-Safe Queries**: Quickly map SQL queries to typed objects using libraries such as Pydantic, Msgspec, Attrs, etc.
82
- - **Extensible Design**: Easily add support for new database dialects or extend existing functionality to meet your specific needs. Easily add support for async and sync database drivers.
83
- - **Minimal Dependencies**: SQLSpec is designed to be lightweight and can run on it's own or with other libraries such as `litestar`, `fastapi`, `flask` and more. (Contributions welcome!)
84
- - **Dynamic Query Manipulation**: Easily apply filters to pre-defined queries with a fluent, Pythonic API. Safely manipulate queries without the risk of SQL injection.
85
- - **Dialect Validation and Conversion**: Use `sqlglot` to validate your SQL against specific dialects and seamlessly convert between them.
100
+ - **Extensible Design**: Easily add support for new database dialects or extend existing functionality to meet your specific needs. Easily add support for async and sync database drivers.
101
+ - **Minimal Dependencies**: SQLSpec is designed to be lightweight and can run on its own or with other libraries such as `litestar`, `fastapi`, `flask` and more. (Contributions welcome!)
86
102
  - **Support for Async and Sync Database Drivers**: SQLSpec supports both async and sync database drivers, allowing you to choose the style that best fits your application.
103
+
104
+ ### Experimental Features (API will change rapidly)
105
+
106
+ - **SQL Builder API**: Type-safe query builder with method chaining (experimental and subject to significant changes)
107
+ - **Dynamic Query Manipulation**: Apply filters to pre-defined queries with a fluent API. Safely manipulate queries without SQL injection risk.
108
+ - **Dialect Validation and Conversion**: Use `sqlglot` to validate your SQL against specific dialects and seamlessly convert between them.
109
+ - **Storage Operations**: Direct export to Parquet, CSV, JSON with Arrow integration
110
+ - **Instrumentation**: OpenTelemetry and Prometheus metrics support
87
111
  - **Basic Migration Management**: A mechanism to generate empty migration files where you can add your own SQL and intelligently track which migrations have been applied.
88
112
 
89
113
  ## What SQLSpec Is Not (Yet)
@@ -94,16 +118,60 @@ SQLSpec is a work in progress. While it offers a solid foundation for modern SQL
94
118
 
95
119
  We've talked about what SQLSpec is not, so let's look at what it can do.
96
120
 
97
- These are just a few of the examples that demonstrate SQLSpec's flexibility and each of the bundled adapters offer the same config and driver interfaces.
121
+ These are just a few examples that demonstrate SQLSpec's flexibility. Each of the bundled adapters offers the same config and driver interfaces.
122
+
123
+ ### Basic Usage
124
+
125
+ ```python
126
+ from sqlspec import SQLSpec
127
+ from sqlspec.adapters.sqlite import SqliteConfig
128
+ from pydantic import BaseModel
129
+ # Create SQLSpec instance and configure database
130
+ sql = SQLSpec()
131
+ config = sql.add_config(SqliteConfig(database=":memory:"))
132
+
133
+ # Execute queries with automatic result mapping
134
+ with sql.provide_session(config) as session:
135
+ # Simple query
136
+ result = session.execute("SELECT 'Hello, SQLSpec!' as message")
137
+ print(result.get_first()) # {'message': 'Hello, SQLSpec!'}
138
+ ```
139
+
140
+ ### SQL Builder Example (Experimental)
141
+
142
+ **Warning**: The SQL Builder API is highly experimental and will change significantly.
143
+
144
+ ```python
145
+ from sqlspec import sql
146
+
147
+ # Build a simple query
148
+ query = sql.select("id", "name", "email").from_("users").where("active = ?", True)
149
+ print(query.build().sql) # SELECT id, name, email FROM users WHERE active = ?
150
+
151
+ # More complex example with joins
152
+ query = (
153
+ sql.select("u.name", "COUNT(o.id) as order_count")
154
+ .from_("users u")
155
+ .left_join("orders o", "u.id = o.user_id")
156
+ .where("u.created_at > ?", "2024-01-01")
157
+ .group_by("u.name")
158
+ .having("COUNT(o.id) > ?", 5)
159
+ .order_by("order_count", desc=True)
160
+ )
161
+
162
+ # Execute the built query
163
+ with sql.provide_session(config) as session:
164
+ results = session.execute(query.build())
165
+ ```
98
166
 
99
167
  ### DuckDB LLM
100
168
 
101
- This is a quick implementation using some of the built in Secret and Extension management features of SQLSpec's DuckDB integration.
169
+ This is a quick implementation using some of the built-in Secret and Extension management features of SQLSpec's DuckDB integration.
102
170
 
103
- It allows you to communicate with any compatible OpenAPI conversations endpoint (such as Ollama). This examples:
171
+ It allows you to communicate with any compatible OpenAPI conversations endpoint (such as Ollama). This example:
104
172
 
105
173
  - auto installs the `open_prompt` DuckDB extensions
106
- - automatically creates the correct `open_prompt` comptaible secret required to use the extension
174
+ - automatically creates the correct `open_prompt` compatible secret required to use the extension
107
175
 
108
176
  ```py
109
177
  # /// script
@@ -148,12 +216,12 @@ with sql.provide_session(etl_config) as session:
148
216
 
149
217
  ### DuckDB Gemini Embeddings
150
218
 
151
- In this example, we are again using DuckDB. However, we are going to use the built in to call the Google Gemini embeddings service directly from the database.
219
+ In this example, we are again using DuckDB. However, we are going to use the built-in to call the Google Gemini embeddings service directly from the database.
152
220
 
153
- This example will
221
+ This example will:
154
222
 
155
223
  - auto installs the `http_client` and `vss` (vector similarity search) DuckDB extensions
156
- - when a connection is created, it ensures that the `generate_embeddings` macro exists in the DuckDB database.
224
+ - when a connection is created, it ensures that the `generate_embeddings` macro exists in the DuckDB database
157
225
  - Execute a simple query to call the Google API
158
226
 
159
227
  ```py
@@ -199,8 +267,8 @@ etl_config = sql.add_config(
199
267
  )
200
268
  )
201
269
  with sql.provide_session(etl_config) as session:
202
- result = session.select_one("SELECT generate_embedding('example text')")
203
- print(result) # result is a dictionary when `schema_type` is omitted.
270
+ result = session.execute("SELECT generate_embedding('example text')")
271
+ print(result.get_first()) # result is a dictionary when `schema_type` is omitted.
204
272
  ```
205
273
 
206
274
  ### Basic Litestar Integration
@@ -215,11 +283,10 @@ In this example we are going to demonstrate how to create a basic configuration
215
283
  # ]
216
284
  # ///
217
285
 
218
- from aiosqlite import Connection
219
286
  from litestar import Litestar, get
220
287
 
221
288
  from sqlspec.adapters.aiosqlite import AiosqliteConfig, AiosqliteDriver
222
- from sqlspec.extensions.litestar import SQLSpec
289
+ from sqlspec.extensions.litestar import DatabaseConfig, SQLSpec
223
290
 
224
291
 
225
292
  @get("/")
@@ -227,15 +294,18 @@ async def simple_sqlite(db_session: AiosqliteDriver) -> dict[str, str]:
227
294
  return await db_session.select_one("SELECT 'Hello, world!' AS greeting")
228
295
 
229
296
 
230
- sqlspec = SQLSpec(config=DatabaseConfig(
231
- config=[AiosqliteConfig(), commit_mode="autocommit")],
297
+ sqlspec = SQLSpec(
298
+ config=DatabaseConfig(
299
+ config=AiosqliteConfig(),
300
+ commit_mode="autocommit"
301
+ )
232
302
  )
233
303
  app = Litestar(route_handlers=[simple_sqlite], plugins=[sqlspec])
234
304
  ```
235
305
 
236
306
  ## Inspiration and Future Direction
237
307
 
238
- SQLSpec originally drew inspiration from features found in the `aiosql` library. This is a great library for working with and executed SQL stored in files. It's unclear how much of an overlap there will be between the two libraries, but it's possible that some features will be contributed back to `aiosql` where appropriate.
308
+ SQLSpec originally drew inspiration from features found in the `aiosql` library. This is a great library for working with and executing SQL stored in files. It's unclear how much of an overlap there will be between the two libraries, but it's possible that some features will be contributed back to `aiosql` where appropriate.
239
309
 
240
310
  ## Current Focus: Universal Connectivity
241
311
 
@@ -275,9 +345,10 @@ This list is not final. If you have a driver you'd like to see added, please ope
275
345
  - `litestar/`: Litestar framework integration ✅
276
346
  - `fastapi/`: Future home of `fastapi` integration.
277
347
  - `flask/`: Future home of `flask` integration.
278
- - `*/`: Future home of your favorite framework integration 🔌 ✨
348
+ - `*/`: Future home of your favorite framework integration
279
349
  - `base.py`: Contains base protocols for database configurations.
280
- - `filters.py`: Contains the `Filter` class which is used to apply filters to pre-defined SQL queries.
350
+ - `statement/`: Contains the SQL statement system with builders, validation, and transformation.
351
+ - `storage/`: Contains unified storage operations for data import/export.
281
352
  - `utils/`: Contains utility functions used throughout the project.
282
353
  - `exceptions.py`: Contains custom exceptions for SQLSpec.
283
354
  - `typing.py`: Contains type hints, type guards and several facades for optional libraries that are not required for the core functionality of SQLSpec.
@@ -4,18 +4,26 @@
4
4
 
5
5
  SQLSpec is an experimental Python library designed to streamline and modernize your SQL interactions across a variety of database systems. While still in its early stages, SQLSpec aims to provide a flexible, typed, and extensible interface for working with SQL in Python.
6
6
 
7
- **Note**: SQLSpec is currently under active development and the API is subject to change. It is not yet ready for production use. Contributions are welcome!
7
+ **Note**: SQLSpec is currently under active development and the API is subject to change. It is not yet ready for production use. Contributions are welcome!
8
8
 
9
- ## Core Features (Planned but subject to change, removal or redesign)
9
+ ## Core Features (Current and Planned)
10
+
11
+ ### Currently Implemented
10
12
 
11
13
  - **Consistent Database Session Interface**: Provides a consistent connectivity interface for interacting with one or more database systems, including SQLite, Postgres, DuckDB, MySQL, Oracle, SQL Server, Spanner, BigQuery, and more.
12
- - **Emphasis on RAW SQL and Minimal Abstractions and Performance**: SQLSpec is a library for working with SQL in Python. It's goals are to offer minimal abstractions between the user and the database. It does not aim to be an ORM library.
14
+ - **Emphasis on RAW SQL and Minimal Abstractions**: SQLSpec is a library for working with SQL in Python. Its goals are to offer minimal abstractions between the user and the database. It does not aim to be an ORM library.
13
15
  - **Type-Safe Queries**: Quickly map SQL queries to typed objects using libraries such as Pydantic, Msgspec, Attrs, etc.
14
- - **Extensible Design**: Easily add support for new database dialects or extend existing functionality to meet your specific needs. Easily add support for async and sync database drivers.
15
- - **Minimal Dependencies**: SQLSpec is designed to be lightweight and can run on it's own or with other libraries such as `litestar`, `fastapi`, `flask` and more. (Contributions welcome!)
16
- - **Dynamic Query Manipulation**: Easily apply filters to pre-defined queries with a fluent, Pythonic API. Safely manipulate queries without the risk of SQL injection.
17
- - **Dialect Validation and Conversion**: Use `sqlglot` to validate your SQL against specific dialects and seamlessly convert between them.
16
+ - **Extensible Design**: Easily add support for new database dialects or extend existing functionality to meet your specific needs. Easily add support for async and sync database drivers.
17
+ - **Minimal Dependencies**: SQLSpec is designed to be lightweight and can run on its own or with other libraries such as `litestar`, `fastapi`, `flask` and more. (Contributions welcome!)
18
18
  - **Support for Async and Sync Database Drivers**: SQLSpec supports both async and sync database drivers, allowing you to choose the style that best fits your application.
19
+
20
+ ### Experimental Features (API will change rapidly)
21
+
22
+ - **SQL Builder API**: Type-safe query builder with method chaining (experimental and subject to significant changes)
23
+ - **Dynamic Query Manipulation**: Apply filters to pre-defined queries with a fluent API. Safely manipulate queries without SQL injection risk.
24
+ - **Dialect Validation and Conversion**: Use `sqlglot` to validate your SQL against specific dialects and seamlessly convert between them.
25
+ - **Storage Operations**: Direct export to Parquet, CSV, JSON with Arrow integration
26
+ - **Instrumentation**: OpenTelemetry and Prometheus metrics support
19
27
  - **Basic Migration Management**: A mechanism to generate empty migration files where you can add your own SQL and intelligently track which migrations have been applied.
20
28
 
21
29
  ## What SQLSpec Is Not (Yet)
@@ -26,16 +34,60 @@ SQLSpec is a work in progress. While it offers a solid foundation for modern SQL
26
34
 
27
35
  We've talked about what SQLSpec is not, so let's look at what it can do.
28
36
 
29
- These are just a few of the examples that demonstrate SQLSpec's flexibility and each of the bundled adapters offer the same config and driver interfaces.
37
+ These are just a few examples that demonstrate SQLSpec's flexibility. Each of the bundled adapters offers the same config and driver interfaces.
38
+
39
+ ### Basic Usage
40
+
41
+ ```python
42
+ from sqlspec import SQLSpec
43
+ from sqlspec.adapters.sqlite import SqliteConfig
44
+ from pydantic import BaseModel
45
+ # Create SQLSpec instance and configure database
46
+ sql = SQLSpec()
47
+ config = sql.add_config(SqliteConfig(database=":memory:"))
48
+
49
+ # Execute queries with automatic result mapping
50
+ with sql.provide_session(config) as session:
51
+ # Simple query
52
+ result = session.execute("SELECT 'Hello, SQLSpec!' as message")
53
+ print(result.get_first()) # {'message': 'Hello, SQLSpec!'}
54
+ ```
55
+
56
+ ### SQL Builder Example (Experimental)
57
+
58
+ **Warning**: The SQL Builder API is highly experimental and will change significantly.
59
+
60
+ ```python
61
+ from sqlspec import sql
62
+
63
+ # Build a simple query
64
+ query = sql.select("id", "name", "email").from_("users").where("active = ?", True)
65
+ print(query.build().sql) # SELECT id, name, email FROM users WHERE active = ?
66
+
67
+ # More complex example with joins
68
+ query = (
69
+ sql.select("u.name", "COUNT(o.id) as order_count")
70
+ .from_("users u")
71
+ .left_join("orders o", "u.id = o.user_id")
72
+ .where("u.created_at > ?", "2024-01-01")
73
+ .group_by("u.name")
74
+ .having("COUNT(o.id) > ?", 5)
75
+ .order_by("order_count", desc=True)
76
+ )
77
+
78
+ # Execute the built query
79
+ with sql.provide_session(config) as session:
80
+ results = session.execute(query.build())
81
+ ```
30
82
 
31
83
  ### DuckDB LLM
32
84
 
33
- This is a quick implementation using some of the built in Secret and Extension management features of SQLSpec's DuckDB integration.
85
+ This is a quick implementation using some of the built-in Secret and Extension management features of SQLSpec's DuckDB integration.
34
86
 
35
- It allows you to communicate with any compatible OpenAPI conversations endpoint (such as Ollama). This examples:
87
+ It allows you to communicate with any compatible OpenAPI conversations endpoint (such as Ollama). This example:
36
88
 
37
89
  - auto installs the `open_prompt` DuckDB extensions
38
- - automatically creates the correct `open_prompt` comptaible secret required to use the extension
90
+ - automatically creates the correct `open_prompt` compatible secret required to use the extension
39
91
 
40
92
  ```py
41
93
  # /// script
@@ -80,12 +132,12 @@ with sql.provide_session(etl_config) as session:
80
132
 
81
133
  ### DuckDB Gemini Embeddings
82
134
 
83
- In this example, we are again using DuckDB. However, we are going to use the built in to call the Google Gemini embeddings service directly from the database.
135
+ In this example, we are again using DuckDB. However, we are going to use the built-in to call the Google Gemini embeddings service directly from the database.
84
136
 
85
- This example will
137
+ This example will:
86
138
 
87
139
  - auto installs the `http_client` and `vss` (vector similarity search) DuckDB extensions
88
- - when a connection is created, it ensures that the `generate_embeddings` macro exists in the DuckDB database.
140
+ - when a connection is created, it ensures that the `generate_embeddings` macro exists in the DuckDB database
89
141
  - Execute a simple query to call the Google API
90
142
 
91
143
  ```py
@@ -131,8 +183,8 @@ etl_config = sql.add_config(
131
183
  )
132
184
  )
133
185
  with sql.provide_session(etl_config) as session:
134
- result = session.select_one("SELECT generate_embedding('example text')")
135
- print(result) # result is a dictionary when `schema_type` is omitted.
186
+ result = session.execute("SELECT generate_embedding('example text')")
187
+ print(result.get_first()) # result is a dictionary when `schema_type` is omitted.
136
188
  ```
137
189
 
138
190
  ### Basic Litestar Integration
@@ -147,11 +199,10 @@ In this example we are going to demonstrate how to create a basic configuration
147
199
  # ]
148
200
  # ///
149
201
 
150
- from aiosqlite import Connection
151
202
  from litestar import Litestar, get
152
203
 
153
204
  from sqlspec.adapters.aiosqlite import AiosqliteConfig, AiosqliteDriver
154
- from sqlspec.extensions.litestar import SQLSpec
205
+ from sqlspec.extensions.litestar import DatabaseConfig, SQLSpec
155
206
 
156
207
 
157
208
  @get("/")
@@ -159,15 +210,18 @@ async def simple_sqlite(db_session: AiosqliteDriver) -> dict[str, str]:
159
210
  return await db_session.select_one("SELECT 'Hello, world!' AS greeting")
160
211
 
161
212
 
162
- sqlspec = SQLSpec(config=DatabaseConfig(
163
- config=[AiosqliteConfig(), commit_mode="autocommit")],
213
+ sqlspec = SQLSpec(
214
+ config=DatabaseConfig(
215
+ config=AiosqliteConfig(),
216
+ commit_mode="autocommit"
217
+ )
164
218
  )
165
219
  app = Litestar(route_handlers=[simple_sqlite], plugins=[sqlspec])
166
220
  ```
167
221
 
168
222
  ## Inspiration and Future Direction
169
223
 
170
- SQLSpec originally drew inspiration from features found in the `aiosql` library. This is a great library for working with and executed SQL stored in files. It's unclear how much of an overlap there will be between the two libraries, but it's possible that some features will be contributed back to `aiosql` where appropriate.
224
+ SQLSpec originally drew inspiration from features found in the `aiosql` library. This is a great library for working with and executing SQL stored in files. It's unclear how much of an overlap there will be between the two libraries, but it's possible that some features will be contributed back to `aiosql` where appropriate.
171
225
 
172
226
  ## Current Focus: Universal Connectivity
173
227
 
@@ -207,9 +261,10 @@ This list is not final. If you have a driver you'd like to see added, please ope
207
261
  - `litestar/`: Litestar framework integration ✅
208
262
  - `fastapi/`: Future home of `fastapi` integration.
209
263
  - `flask/`: Future home of `flask` integration.
210
- - `*/`: Future home of your favorite framework integration 🔌 ✨
264
+ - `*/`: Future home of your favorite framework integration
211
265
  - `base.py`: Contains base protocols for database configurations.
212
- - `filters.py`: Contains the `Filter` class which is used to apply filters to pre-defined SQL queries.
266
+ - `statement/`: Contains the SQL statement system with builders, validation, and transformation.
267
+ - `storage/`: Contains unified storage operations for data import/export.
213
268
  - `utils/`: Contains utility functions used throughout the project.
214
269
  - `exceptions.py`: Contains custom exceptions for SQLSpec.
215
270
  - `typing.py`: Contains type hints, type guards and several facades for optional libraries that are not required for the core functionality of SQLSpec.