polyglot-sql 0.3.2__tar.gz → 0.3.4__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.
Files changed (167) hide show
  1. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/Cargo.lock +47 -5
  2. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/Cargo.toml +1 -1
  3. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/PKG-INFO +1 -1
  4. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/Cargo.toml +7 -2
  5. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/ast_transforms.rs +4 -0
  6. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/builder.rs +3 -0
  7. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/databricks.rs +106 -0
  8. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/doris.rs +51 -1
  9. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/fabric.rs +11 -22
  10. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/hive.rs +6 -0
  11. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/mod.rs +1594 -120
  12. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/mysql.rs +23 -0
  13. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/snowflake.rs +31 -0
  14. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/spark.rs +6 -0
  15. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/sqlite.rs +8 -0
  16. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/starrocks.rs +52 -1
  17. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/tsql.rs +94 -18
  18. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/expressions.rs +49 -0
  19. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/generator.rs +372 -81
  20. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/parser.rs +2260 -1484
  21. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/transforms.rs +10 -3
  22. polyglot_sql-0.3.4/crates/polyglot-sql/tests/clickhouse_regression.rs +29 -0
  23. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/tests/custom_clickhouse_parser.rs +90 -62
  24. polyglot_sql-0.3.4/crates/polyglot-sql/tests/deep_nesting_regression.rs +265 -0
  25. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/tests/dialect_matrix.rs +106 -29
  26. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/tests/error_handling.rs +15 -39
  27. polyglot_sql-0.3.4/crates/polyglot-sql/tests/fabric_regression.rs +85 -0
  28. polyglot_sql-0.3.4/crates/polyglot-sql/tests/snowflake_regression_test.rs +329 -0
  29. polyglot_sql-0.3.4/crates/polyglot-sql/tests/tpch_transpile_stack.rs +109 -0
  30. polyglot_sql-0.3.4/crates/polyglot-sql/tests/transform_regression.rs +200 -0
  31. polyglot_sql-0.3.4/crates/polyglot-sql/tests/tsql_regression.rs +85 -0
  32. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/README.md +0 -0
  33. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/README.md +0 -0
  34. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/benches/in_list.rs +0 -0
  35. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/benches/parsing.rs +0 -0
  36. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/benches/rust_parsing.rs +0 -0
  37. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/benches/transpile.rs +0 -0
  38. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/examples/basic_usage.rs +0 -0
  39. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/examples/bench_json.rs +0 -0
  40. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/athena.rs +0 -0
  41. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/bigquery.rs +0 -0
  42. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/clickhouse.rs +0 -0
  43. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/cockroachdb.rs +0 -0
  44. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/datafusion.rs +0 -0
  45. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/dremio.rs +0 -0
  46. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/drill.rs +0 -0
  47. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/druid.rs +0 -0
  48. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/duckdb.rs +0 -0
  49. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/dune.rs +0 -0
  50. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/exasol.rs +0 -0
  51. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/generic.rs +0 -0
  52. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/materialize.rs +0 -0
  53. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/oracle.rs +0 -0
  54. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/postgres.rs +0 -0
  55. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/presto.rs +0 -0
  56. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/redshift.rs +0 -0
  57. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/risingwave.rs +0 -0
  58. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/singlestore.rs +0 -0
  59. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/solr.rs +0 -0
  60. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/tableau.rs +0 -0
  61. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/teradata.rs +0 -0
  62. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/tidb.rs +0 -0
  63. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/dialects/trino.rs +0 -0
  64. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/diff.rs +0 -0
  65. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/error.rs +0 -0
  66. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/function_catalog.rs +0 -0
  67. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/function_registry.rs +0 -0
  68. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/helper.rs +0 -0
  69. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/lib.rs +0 -0
  70. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/lineage.rs +0 -0
  71. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/optimizer/annotate_types.rs +0 -0
  72. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/optimizer/canonicalize.rs +0 -0
  73. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/optimizer/eliminate_ctes.rs +0 -0
  74. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/optimizer/eliminate_joins.rs +0 -0
  75. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/optimizer/isolate_table_selects.rs +0 -0
  76. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/optimizer/mod.rs +0 -0
  77. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/optimizer/normalize.rs +0 -0
  78. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/optimizer/normalize_identifiers.rs +0 -0
  79. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/optimizer/optimize_joins.rs +0 -0
  80. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/optimizer/optimizer.rs +0 -0
  81. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/optimizer/pushdown_predicates.rs +0 -0
  82. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/optimizer/pushdown_projections.rs +0 -0
  83. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/optimizer/qualify_columns.rs +0 -0
  84. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/optimizer/qualify_tables.rs +0 -0
  85. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/optimizer/simplify.rs +0 -0
  86. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/optimizer/subquery.rs +0 -0
  87. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/planner.rs +0 -0
  88. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/resolver.rs +0 -0
  89. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/schema.rs +0 -0
  90. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/scope.rs +0 -0
  91. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/time.rs +0 -0
  92. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/tokens.rs +0 -0
  93. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/traversal.rs +0 -0
  94. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/trie.rs +0 -0
  95. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/validation/tests.rs +0 -0
  96. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/src/validation.rs +0 -0
  97. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/tests/analyze_failures.rs +0 -0
  98. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/tests/common/known_failures.rs +0 -0
  99. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/tests/common/mod.rs +0 -0
  100. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/tests/common/test_data.rs +0 -0
  101. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/tests/common/test_runner.rs +0 -0
  102. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/tests/custom_clickhouse_coverage.rs +0 -0
  103. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/tests/custom_dialect.rs +0 -0
  104. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/tests/custom_dialect_tests.rs +0 -0
  105. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/tests/custom_fixtures/datafusion/ddl.json +0 -0
  106. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/tests/custom_fixtures/datafusion/dml.json +0 -0
  107. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/tests/custom_fixtures/datafusion/functions.json +0 -0
  108. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/tests/custom_fixtures/datafusion/identity.json +0 -0
  109. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/tests/custom_fixtures/datafusion/operators.json +0 -0
  110. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/tests/custom_fixtures/datafusion/select.json +0 -0
  111. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/tests/custom_fixtures/datafusion/transpilation.json +0 -0
  112. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/tests/custom_fixtures/datafusion/types.json +0 -0
  113. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/tests/identity_roundtrip.rs +0 -0
  114. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/tests/sqlglot_compat.rs +0 -0
  115. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/tests/sqlglot_dialect_identity.rs +0 -0
  116. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/tests/sqlglot_identity.rs +0 -0
  117. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/tests/sqlglot_identity_detailed.rs +0 -0
  118. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/tests/sqlglot_parser.rs +0 -0
  119. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/tests/sqlglot_pretty.rs +0 -0
  120. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/tests/sqlglot_transpilation.rs +0 -0
  121. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql/tests/sqlglot_transpile.rs +0 -0
  122. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-function-catalogs/Cargo.toml +0 -0
  123. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-function-catalogs/README.md +0 -0
  124. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-function-catalogs/src/clickhouse.rs +0 -0
  125. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-function-catalogs/src/duckdb.rs +0 -0
  126. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-function-catalogs/src/lib.rs +0 -0
  127. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-function-catalogs/tools/clickhouse/extract_functions.py +0 -0
  128. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-function-catalogs/tools/duckdb/extract_functions.py +0 -0
  129. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/Cargo.toml +0 -0
  130. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/README.md +0 -0
  131. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/docs/api.md +0 -0
  132. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/docs/index.md +0 -0
  133. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/mkdocs.yml +0 -0
  134. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/src/annotate_types.rs +0 -0
  135. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/src/dialects.rs +0 -0
  136. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/src/diff.rs +0 -0
  137. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/src/errors.rs +0 -0
  138. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/src/expr.rs +0 -0
  139. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/src/expr_types.rs +0 -0
  140. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/src/format.rs +0 -0
  141. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/src/generate.rs +0 -0
  142. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/src/helpers.rs +0 -0
  143. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/src/lib.rs +0 -0
  144. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/src/lineage.rs +0 -0
  145. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/src/optimize.rs +0 -0
  146. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/src/parse.rs +0 -0
  147. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/src/tokenize.rs +0 -0
  148. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/src/transpile.rs +0 -0
  149. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/src/types.rs +0 -0
  150. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/src/validate.rs +0 -0
  151. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/tests/conftest.py +0 -0
  152. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/tests/test_compat.py +0 -0
  153. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/tests/test_dialects.py +0 -0
  154. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/tests/test_diff.py +0 -0
  155. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/tests/test_expression.py +0 -0
  156. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/tests/test_format.py +0 -0
  157. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/tests/test_generate.py +0 -0
  158. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/tests/test_lineage.py +0 -0
  159. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/tests/test_optimize.py +0 -0
  160. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/tests/test_parse.py +0 -0
  161. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/tests/test_transpile.py +0 -0
  162. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/tests/test_validate.py +0 -0
  163. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/crates/polyglot-sql-python/uv.lock +0 -0
  164. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/pyproject.toml +0 -0
  165. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/python/polyglot_sql/__init__.py +0 -0
  166. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/python/polyglot_sql/__init__.pyi +0 -0
  167. {polyglot_sql-0.3.2 → polyglot_sql-0.3.4}/python/polyglot_sql/py.typed +0 -0
@@ -73,6 +73,15 @@ version = "1.0.102"
73
73
  source = "registry+https://github.com/rust-lang/crates.io-index"
74
74
  checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c"
75
75
 
76
+ [[package]]
77
+ name = "ar_archive_writer"
78
+ version = "0.5.1"
79
+ source = "registry+https://github.com/rust-lang/crates.io-index"
80
+ checksum = "7eb93bbb63b9c227414f6eb3a0adfddca591a8ce1e9b60661bb08969b87e340b"
81
+ dependencies = [
82
+ "object",
83
+ ]
84
+
76
85
  [[package]]
77
86
  name = "async-trait"
78
87
  version = "0.1.89"
@@ -527,6 +536,15 @@ dependencies = [
527
536
  "libm",
528
537
  ]
529
538
 
539
+ [[package]]
540
+ name = "object"
541
+ version = "0.37.3"
542
+ source = "registry+https://github.com/rust-lang/crates.io-index"
543
+ checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe"
544
+ dependencies = [
545
+ "memchr",
546
+ ]
547
+
530
548
  [[package]]
531
549
  name = "once_cell"
532
550
  version = "1.21.3"
@@ -587,7 +605,7 @@ dependencies = [
587
605
 
588
606
  [[package]]
589
607
  name = "polyglot-sql"
590
- version = "0.3.2"
608
+ version = "0.3.4"
591
609
  dependencies = [
592
610
  "criterion",
593
611
  "once_cell",
@@ -595,6 +613,7 @@ dependencies = [
595
613
  "pretty_assertions",
596
614
  "serde",
597
615
  "serde_json",
616
+ "stacker",
598
617
  "thiserror 1.0.69",
599
618
  "ts-rs",
600
619
  "unicode-segmentation",
@@ -602,7 +621,7 @@ dependencies = [
602
621
 
603
622
  [[package]]
604
623
  name = "polyglot-sql-ffi"
605
- version = "0.3.2"
624
+ version = "0.3.4"
606
625
  dependencies = [
607
626
  "cbindgen",
608
627
  "polyglot-sql",
@@ -612,11 +631,11 @@ dependencies = [
612
631
 
613
632
  [[package]]
614
633
  name = "polyglot-sql-function-catalogs"
615
- version = "0.3.2"
634
+ version = "0.3.4"
616
635
 
617
636
  [[package]]
618
637
  name = "polyglot-sql-python"
619
- version = "0.3.2"
638
+ version = "0.3.4"
620
639
  dependencies = [
621
640
  "polyglot-sql",
622
641
  "pyo3",
@@ -627,7 +646,7 @@ dependencies = [
627
646
 
628
647
  [[package]]
629
648
  name = "polyglot-sql-wasm"
630
- version = "0.3.2"
649
+ version = "0.3.4"
631
650
  dependencies = [
632
651
  "console_error_panic_hook",
633
652
  "js-sys",
@@ -674,6 +693,16 @@ dependencies = [
674
693
  "unicode-ident",
675
694
  ]
676
695
 
696
+ [[package]]
697
+ name = "psm"
698
+ version = "0.1.31"
699
+ source = "registry+https://github.com/rust-lang/crates.io-index"
700
+ checksum = "645dbe486e346d9b5de3ef16ede18c26e6c70ad97418f4874b8b1889d6e761ea"
701
+ dependencies = [
702
+ "ar_archive_writer",
703
+ "cc",
704
+ ]
705
+
677
706
  [[package]]
678
707
  name = "pyo3"
679
708
  version = "0.28.2"
@@ -915,6 +944,19 @@ version = "0.4.11"
915
944
  source = "registry+https://github.com/rust-lang/crates.io-index"
916
945
  checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589"
917
946
 
947
+ [[package]]
948
+ name = "stacker"
949
+ version = "0.1.24"
950
+ source = "registry+https://github.com/rust-lang/crates.io-index"
951
+ checksum = "640c8cdd92b6b12f5bcb1803ca3bbf5ab96e5e6b6b96b9ab77dabe9e880b3190"
952
+ dependencies = [
953
+ "cc",
954
+ "cfg-if",
955
+ "libc",
956
+ "psm",
957
+ "windows-sys",
958
+ ]
959
+
918
960
  [[package]]
919
961
  name = "strsim"
920
962
  version = "0.11.1"
@@ -6,7 +6,7 @@ exclude = [
6
6
  ]
7
7
 
8
8
  [workspace.package]
9
- version = "0.3.2"
9
+ version = "0.3.4"
10
10
  edition = "2021"
11
11
  license = "MIT"
12
12
  authors = ["polyglot contributors"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: polyglot-sql
3
- Version: 0.3.2
3
+ Version: 0.3.4
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -10,9 +10,13 @@ description = "SQL parsing, validating, formatting, and dialect translation libr
10
10
  readme = "README.md"
11
11
 
12
12
  [features]
13
- default = ["all-dialects", "transpile"]
13
+ default = ["all-dialects", "transpile", "stacker"]
14
14
  bindings = ["dep:ts-rs"]
15
15
  transpile = []
16
+ # Default-on for native builds so direct Rust users and the FFI/Python bindings
17
+ # inherit stack-growth protection automatically. WASM opts out via
18
+ # `default-features = false` in its dependency declaration.
19
+ stacker = ["dep:stacker"]
16
20
  all-dialects = [
17
21
  "dialect-postgresql", "dialect-mysql", "dialect-bigquery",
18
22
  "dialect-snowflake", "dialect-duckdb", "dialect-tsql",
@@ -77,8 +81,9 @@ serde = { workspace = true }
77
81
  serde_json = { workspace = true }
78
82
  thiserror = { workspace = true }
79
83
  unicode-segmentation = { workspace = true }
84
+ stacker = { version = "0.1", optional = true }
80
85
  ts-rs = { version = "12.0", features = ["serde-compat"], optional = true }
81
- polyglot-sql-function-catalogs = { path = "../polyglot-sql-function-catalogs", version = "0.3.2", optional = true, default-features = false }
86
+ polyglot-sql-function-catalogs = { path = "../polyglot-sql-function-catalogs", version = "0.3.4", optional = true, default-features = false }
82
87
 
83
88
  [dev-dependencies]
84
89
  pretty_assertions = "1.4"
@@ -434,6 +434,10 @@ pub fn get_table_names(expr: &Expression) -> Vec<String> {
434
434
  names.push(name);
435
435
  }
436
436
  }
437
+ Expression::CreateSynonym(synonym) => {
438
+ push_table_ref_name(&synonym.name, &cte_aliases, &mut names);
439
+ push_table_ref_name(&synonym.target, &cte_aliases, &mut names);
440
+ }
437
441
  _ => {}
438
442
  }
439
443
  }
@@ -803,6 +803,7 @@ pub fn delete(table_name: &str) -> DeleteBuilder {
803
803
  DeleteBuilder {
804
804
  delete: Delete {
805
805
  table: builder_table_ref(table_name),
806
+ hint: None,
806
807
  on_cluster: None,
807
808
  alias: None,
808
809
  alias_explicit_as: false,
@@ -894,6 +895,7 @@ pub fn update(table_name: &str) -> UpdateBuilder {
894
895
  UpdateBuilder {
895
896
  update: Update {
896
897
  table: builder_table_ref(table_name),
898
+ hint: None,
897
899
  extra_tables: Vec::new(),
898
900
  table_joins: Vec::new(),
899
901
  set: Vec::new(),
@@ -1601,6 +1603,7 @@ impl SelectBuilder {
1601
1603
  clone_at_clause: None,
1602
1604
  is_copy: false,
1603
1605
  shallow_clone: false,
1606
+ deep_clone: false,
1604
1607
  leading_comments: vec![],
1605
1608
  with_properties: vec![],
1606
1609
  teradata_post_name_options: vec![],
@@ -37,6 +37,12 @@ impl DialectImpl for DatabricksDialect {
37
37
  config
38
38
  .keywords
39
39
  .insert("DIV".to_string(), crate::tokens::TokenType::Div);
40
+ config
41
+ .keywords
42
+ .insert("REPAIR".to_string(), crate::tokens::TokenType::Command);
43
+ config
44
+ .keywords
45
+ .insert("MSCK".to_string(), crate::tokens::TokenType::Command);
40
46
  // Databricks numeric literal suffixes (same as Hive/Spark)
41
47
  config
42
48
  .numeric_literals
@@ -1009,4 +1015,104 @@ mod tests {
1009
1015
  "FROM_UTC_TIMESTAMP with existing CAST failed"
1010
1016
  );
1011
1017
  }
1018
+
1019
+ #[test]
1020
+ fn test_deep_clone_version_as_of() {
1021
+ let sql = "CREATE TABLE events_clone DEEP CLONE events VERSION AS OF 5";
1022
+ let d = Dialect::get(DialectType::Databricks);
1023
+ let ast = d.parse(sql).expect("Parse failed");
1024
+ let output = d.generate(&ast[0]).expect("Generate failed");
1025
+
1026
+ assert_eq!(output, sql);
1027
+ }
1028
+
1029
+ #[test]
1030
+ fn test_deep_clone_timestamp_as_of() {
1031
+ let sql = "CREATE TABLE events_clone DEEP CLONE events TIMESTAMP AS OF '2024-01-01'";
1032
+ let d = Dialect::get(DialectType::Databricks);
1033
+ let ast = d.parse(sql).expect("Parse failed");
1034
+ let output = d.generate(&ast[0]).expect("Generate failed");
1035
+
1036
+ assert_eq!(output, sql);
1037
+ }
1038
+
1039
+ #[test]
1040
+ fn test_shallow_clone_still_roundtrips() {
1041
+ let sql = "CREATE TABLE events_clone SHALLOW CLONE events";
1042
+ let d = Dialect::get(DialectType::Databricks);
1043
+ let ast = d.parse(sql).expect("Parse failed");
1044
+ let output = d.generate(&ast[0]).expect("Generate failed");
1045
+
1046
+ assert_eq!(output, sql);
1047
+ }
1048
+
1049
+ #[test]
1050
+ fn test_repair_table_commands_roundtrip() {
1051
+ let d = Dialect::get(DialectType::Databricks);
1052
+ let cases = [
1053
+ "REPAIR TABLE events",
1054
+ "MSCK REPAIR TABLE events",
1055
+ "REPAIR TABLE events ADD PARTITIONS",
1056
+ "REPAIR TABLE events DROP PARTITIONS",
1057
+ "REPAIR TABLE events SYNC PARTITIONS",
1058
+ "REPAIR TABLE events SYNC METADATA",
1059
+ ];
1060
+
1061
+ for sql in cases {
1062
+ let ast = d.parse(sql).expect("Parse failed");
1063
+ let output = d.generate(&ast[0]).expect("Generate failed");
1064
+ assert_eq!(output, sql);
1065
+ }
1066
+ }
1067
+
1068
+ #[test]
1069
+ fn test_apply_changes_commands_roundtrip() {
1070
+ let d = Dialect::get(DialectType::Databricks);
1071
+ let cases = [
1072
+ "APPLY CHANGES INTO silver.orders FROM STREAM(bronze.orders) KEYS (id) SEQUENCE BY ts",
1073
+ "APPLY CHANGES INTO LIVE.silver_orders FROM STREAM(LIVE.bronze_orders) KEYS (id) IGNORE NULL UPDATES SEQUENCE BY ts",
1074
+ "APPLY CHANGES INTO LIVE.silver_orders FROM STREAM(LIVE.bronze_orders) KEYS (id) APPLY AS DELETE WHEN operation = 'DELETE' SEQUENCE BY ts COLUMNS * EXCEPT (operation) STORED AS SCD TYPE 1",
1075
+ "APPLY CHANGES INTO LIVE.silver_orders FROM STREAM(LIVE.bronze_orders) KEYS (id) SEQUENCE BY ts STORED AS SCD TYPE 2 TRACK HISTORY ON * EXCEPT (updated_at)",
1076
+ "AUTO CDC INTO silver.orders FROM STREAM(bronze.orders) KEYS (id) SEQUENCE BY ts",
1077
+ "CREATE FLOW apply_cdc AS AUTO CDC INTO silver.orders FROM STREAM(bronze.orders) KEYS (id) SEQUENCE BY ts",
1078
+ ];
1079
+
1080
+ for sql in cases {
1081
+ let ast = d.parse(sql).expect("Parse failed");
1082
+ let output = d.generate(&ast[0]).expect("Generate failed");
1083
+ assert_eq!(output, sql);
1084
+ }
1085
+ }
1086
+
1087
+ #[test]
1088
+ fn test_generate_symlink_format_manifest_roundtrip() {
1089
+ let d = Dialect::get(DialectType::Databricks);
1090
+ let cases = [
1091
+ "GENERATE symlink_format_manifest FOR TABLE events",
1092
+ "GENERATE symlink_format_manifest FOR TABLE catalog.schema.events",
1093
+ ];
1094
+
1095
+ for sql in cases {
1096
+ let ast = d.parse(sql).expect("Parse failed");
1097
+ let output = d.generate(&ast[0]).expect("Generate failed");
1098
+ assert_eq!(output, sql);
1099
+ }
1100
+ }
1101
+
1102
+ #[test]
1103
+ fn test_convert_to_delta_roundtrip() {
1104
+ let d = Dialect::get(DialectType::Databricks);
1105
+ let cases = [
1106
+ "CONVERT TO DELTA parquet.`/mnt/data/events`",
1107
+ "CONVERT TO DELTA database_name.table_name",
1108
+ "CONVERT TO DELTA parquet.`s3://my-bucket/path/to/table` PARTITIONED BY (date DATE)",
1109
+ "CONVERT TO DELTA database_name.table_name NO STATISTICS",
1110
+ ];
1111
+
1112
+ for sql in cases {
1113
+ let ast = d.parse(sql).expect("Parse failed");
1114
+ let output = d.generate(&ast[0]).expect("Generate failed");
1115
+ assert_eq!(output, sql);
1116
+ }
1117
+ }
1012
1118
  }
@@ -5,7 +5,9 @@
5
5
 
6
6
  use super::{DialectImpl, DialectType};
7
7
  use crate::error::Result;
8
- use crate::expressions::{AggFunc, Case, Cast, Expression, Function, VarArgFunc};
8
+ use crate::expressions::{
9
+ AggFunc, Case, Cast, Expression, Function, Interval, IntervalUnit, IntervalUnitSpec, VarArgFunc,
10
+ };
9
11
  use crate::generator::GeneratorConfig;
10
12
  use crate::tokens::TokenizerConfig;
11
13
 
@@ -106,6 +108,16 @@ impl DialectImpl for DorisDialect {
106
108
  }
107
109
 
108
110
  impl DorisDialect {
111
+ fn wrap_day_interval(expr: Expression) -> Expression {
112
+ Expression::Interval(Box::new(Interval {
113
+ this: Some(expr),
114
+ unit: Some(IntervalUnitSpec::Simple {
115
+ unit: IntervalUnit::Day,
116
+ use_plural: false,
117
+ }),
118
+ }))
119
+ }
120
+
109
121
  fn transform_function(&self, f: Function) -> Result<Expression> {
110
122
  let name_upper = f.name.to_uppercase();
111
123
  match name_upper.as_str() {
@@ -207,6 +219,44 @@ impl DorisDialect {
207
219
  // DATE_TRUNC is native in Doris
208
220
  "DATE_TRUNC" => Ok(Expression::Function(Box::new(f))),
209
221
 
222
+ // Doris normalizes MySQL-style day shorthand to INTERVAL syntax.
223
+ "DATE_ADD" if f.args.len() == 2 && !matches!(f.args[1], Expression::Interval(_)) => {
224
+ let mut args = f.args;
225
+ let date = args.remove(0);
226
+ let days = args.remove(0);
227
+ Ok(Expression::Function(Box::new(Function::new(
228
+ "DATE_ADD".to_string(),
229
+ vec![date, Self::wrap_day_interval(days)],
230
+ ))))
231
+ }
232
+ "DATE_SUB" if f.args.len() == 2 && !matches!(f.args[1], Expression::Interval(_)) => {
233
+ let mut args = f.args;
234
+ let date = args.remove(0);
235
+ let days = args.remove(0);
236
+ Ok(Expression::Function(Box::new(Function::new(
237
+ "DATE_SUB".to_string(),
238
+ vec![date, Self::wrap_day_interval(days)],
239
+ ))))
240
+ }
241
+ "ADDDATE" if f.args.len() == 2 && !matches!(f.args[1], Expression::Interval(_)) => {
242
+ let mut args = f.args;
243
+ let date = args.remove(0);
244
+ let days = args.remove(0);
245
+ Ok(Expression::Function(Box::new(Function::new(
246
+ "DATE_ADD".to_string(),
247
+ vec![date, Self::wrap_day_interval(days)],
248
+ ))))
249
+ }
250
+ "SUBDATE" if f.args.len() == 2 && !matches!(f.args[1], Expression::Interval(_)) => {
251
+ let mut args = f.args;
252
+ let date = args.remove(0);
253
+ let days = args.remove(0);
254
+ Ok(Expression::Function(Box::new(Function::new(
255
+ "DATE_SUB".to_string(),
256
+ vec![date, Self::wrap_day_interval(days)],
257
+ ))))
258
+ }
259
+
210
260
  // COLLECT_LIST is native in Doris
211
261
  "COLLECT_LIST" => Ok(Expression::Function(Box::new(f))),
212
262
 
@@ -42,6 +42,7 @@ impl DialectImpl for FabricDialect {
42
42
  identifier_quote: '[',
43
43
  identifier_quote_style: IdentifierQuoteStyle::BRACKET,
44
44
  dialect: Some(DialectType::Fabric),
45
+ null_ordering_supported: false,
45
46
  ..Default::default()
46
47
  }
47
48
  }
@@ -63,7 +64,14 @@ impl DialectImpl for FabricDialect {
63
64
  }
64
65
  _ => {}
65
66
  }
66
- // Also transform column data types through Fabric's type mappings
67
+ // Also transform column data types through Fabric's type mappings.
68
+ // Apply TSQL normalisation first (e.g. BPCHAR → Char), then Fabric-specific.
69
+ let tsql = TSQLDialect;
70
+ if let Ok(Expression::DataType(tsql_dt)) =
71
+ tsql.transform_data_type(col.data_type.clone())
72
+ {
73
+ col.data_type = tsql_dt;
74
+ }
67
75
  if let Expression::DataType(new_dt) =
68
76
  self.transform_fabric_data_type(col.data_type.clone())?
69
77
  {
@@ -361,7 +369,8 @@ impl FabricDialect {
361
369
  let upper = name.to_uppercase();
362
370
 
363
371
  // Parse out precision and scale if present: "TYPENAME(n)" or "TYPENAME(n, m)"
364
- let (base_name, precision, scale) = Self::parse_type_precision_and_scale(&upper);
372
+ let (base_name, precision, scale) =
373
+ TSQLDialect::parse_type_precision_and_scale(&upper);
365
374
 
366
375
  match base_name.as_str() {
367
376
  // DATETIME -> DATETIME2(6)
@@ -518,24 +527,4 @@ impl FabricDialect {
518
527
  None => max, // Default to max if not specified
519
528
  }
520
529
  }
521
-
522
- /// Parse type name and optional precision/scale from strings like "DATETIME2(7)" or "NUMERIC(10, 2)"
523
- fn parse_type_precision_and_scale(name: &str) -> (String, Option<u32>, Option<u32>) {
524
- if let Some(paren_pos) = name.find('(') {
525
- let base = name[..paren_pos].to_string();
526
- let rest = &name[paren_pos + 1..];
527
- if let Some(close_pos) = rest.find(')') {
528
- let args = &rest[..close_pos];
529
- let parts: Vec<&str> = args.split(',').map(|s| s.trim()).collect();
530
-
531
- let precision = parts.first().and_then(|s| s.parse::<u32>().ok());
532
- let scale = parts.get(1).and_then(|s| s.parse::<u32>().ok());
533
-
534
- return (base, precision, scale);
535
- }
536
- (base, None, None)
537
- } else {
538
- (name.to_string(), None, None)
539
- }
540
- }
541
530
  }
@@ -42,6 +42,12 @@ impl DialectImpl for HiveDialect {
42
42
  config
43
43
  .keywords
44
44
  .insert("DIV".to_string(), crate::tokens::TokenType::Div);
45
+ config
46
+ .keywords
47
+ .insert("REPAIR".to_string(), crate::tokens::TokenType::Command);
48
+ config
49
+ .keywords
50
+ .insert("MSCK".to_string(), crate::tokens::TokenType::Command);
45
51
  // Hive numeric literal suffixes: 1L -> BIGINT, 1S -> SMALLINT, etc.
46
52
  config
47
53
  .numeric_literals