polyglot-sql 0.2.2__tar.gz → 0.2.3__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 (160) hide show
  1. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/Cargo.lock +5 -5
  2. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/Cargo.toml +1 -1
  3. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/PKG-INFO +1 -1
  4. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/Cargo.toml +1 -1
  5. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/bigquery.rs +4 -0
  6. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/databricks.rs +8 -0
  7. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/hive.rs +1 -0
  8. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/mod.rs +112 -2
  9. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/postgres.rs +1 -0
  10. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/presto.rs +1 -0
  11. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/snowflake.rs +1 -0
  12. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/spark.rs +1 -0
  13. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/sqlite.rs +4 -0
  14. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/tsql.rs +8 -0
  15. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/expressions.rs +4 -0
  16. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/generator.rs +13 -0
  17. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/parser.rs +380 -36
  18. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/README.md +0 -0
  19. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/README.md +0 -0
  20. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/benches/in_list.rs +0 -0
  21. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/benches/parsing.rs +0 -0
  22. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/benches/rust_parsing.rs +0 -0
  23. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/benches/transpile.rs +0 -0
  24. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/examples/basic_usage.rs +0 -0
  25. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/examples/bench_json.rs +0 -0
  26. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/ast_transforms.rs +0 -0
  27. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/builder.rs +0 -0
  28. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/athena.rs +0 -0
  29. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/clickhouse.rs +0 -0
  30. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/cockroachdb.rs +0 -0
  31. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/datafusion.rs +0 -0
  32. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/doris.rs +0 -0
  33. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/dremio.rs +0 -0
  34. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/drill.rs +0 -0
  35. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/druid.rs +0 -0
  36. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/duckdb.rs +0 -0
  37. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/dune.rs +0 -0
  38. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/exasol.rs +0 -0
  39. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/fabric.rs +0 -0
  40. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/generic.rs +0 -0
  41. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/materialize.rs +0 -0
  42. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/mysql.rs +0 -0
  43. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/oracle.rs +0 -0
  44. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/redshift.rs +0 -0
  45. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/risingwave.rs +0 -0
  46. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/singlestore.rs +0 -0
  47. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/solr.rs +0 -0
  48. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/starrocks.rs +0 -0
  49. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/tableau.rs +0 -0
  50. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/teradata.rs +0 -0
  51. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/tidb.rs +0 -0
  52. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/dialects/trino.rs +0 -0
  53. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/diff.rs +0 -0
  54. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/error.rs +0 -0
  55. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/function_catalog.rs +0 -0
  56. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/function_registry.rs +0 -0
  57. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/helper.rs +0 -0
  58. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/lib.rs +0 -0
  59. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/lineage.rs +0 -0
  60. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/optimizer/annotate_types.rs +0 -0
  61. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/optimizer/canonicalize.rs +0 -0
  62. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/optimizer/eliminate_ctes.rs +0 -0
  63. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/optimizer/eliminate_joins.rs +0 -0
  64. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/optimizer/isolate_table_selects.rs +0 -0
  65. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/optimizer/mod.rs +0 -0
  66. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/optimizer/normalize.rs +0 -0
  67. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/optimizer/normalize_identifiers.rs +0 -0
  68. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/optimizer/optimize_joins.rs +0 -0
  69. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/optimizer/optimizer.rs +0 -0
  70. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/optimizer/pushdown_predicates.rs +0 -0
  71. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/optimizer/pushdown_projections.rs +0 -0
  72. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/optimizer/qualify_columns.rs +0 -0
  73. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/optimizer/qualify_tables.rs +0 -0
  74. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/optimizer/simplify.rs +0 -0
  75. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/optimizer/subquery.rs +0 -0
  76. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/planner.rs +0 -0
  77. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/resolver.rs +0 -0
  78. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/schema.rs +0 -0
  79. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/scope.rs +0 -0
  80. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/time.rs +0 -0
  81. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/tokens.rs +0 -0
  82. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/transforms.rs +0 -0
  83. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/traversal.rs +0 -0
  84. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/trie.rs +0 -0
  85. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/validation/tests.rs +0 -0
  86. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/src/validation.rs +0 -0
  87. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/tests/analyze_failures.rs +0 -0
  88. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/tests/common/known_failures.rs +0 -0
  89. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/tests/common/mod.rs +0 -0
  90. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/tests/common/test_data.rs +0 -0
  91. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/tests/common/test_runner.rs +0 -0
  92. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/tests/custom_clickhouse_coverage.rs +0 -0
  93. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/tests/custom_clickhouse_parser.rs +0 -0
  94. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/tests/custom_dialect.rs +0 -0
  95. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/tests/custom_dialect_tests.rs +0 -0
  96. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/tests/custom_fixtures/datafusion/ddl.json +0 -0
  97. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/tests/custom_fixtures/datafusion/dml.json +0 -0
  98. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/tests/custom_fixtures/datafusion/functions.json +0 -0
  99. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/tests/custom_fixtures/datafusion/identity.json +0 -0
  100. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/tests/custom_fixtures/datafusion/operators.json +0 -0
  101. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/tests/custom_fixtures/datafusion/select.json +0 -0
  102. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/tests/custom_fixtures/datafusion/transpilation.json +0 -0
  103. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/tests/custom_fixtures/datafusion/types.json +0 -0
  104. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/tests/dialect_matrix.rs +0 -0
  105. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/tests/error_handling.rs +0 -0
  106. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/tests/identity_roundtrip.rs +0 -0
  107. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/tests/sqlglot_compat.rs +0 -0
  108. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/tests/sqlglot_dialect_identity.rs +0 -0
  109. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/tests/sqlglot_identity.rs +0 -0
  110. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/tests/sqlglot_identity_detailed.rs +0 -0
  111. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/tests/sqlglot_parser.rs +0 -0
  112. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/tests/sqlglot_pretty.rs +0 -0
  113. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/tests/sqlglot_transpilation.rs +0 -0
  114. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql/tests/sqlglot_transpile.rs +0 -0
  115. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-function-catalogs/Cargo.toml +0 -0
  116. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-function-catalogs/README.md +0 -0
  117. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-function-catalogs/src/clickhouse.rs +0 -0
  118. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-function-catalogs/src/duckdb.rs +0 -0
  119. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-function-catalogs/src/lib.rs +0 -0
  120. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-function-catalogs/tools/clickhouse/extract_functions.py +0 -0
  121. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-function-catalogs/tools/duckdb/extract_functions.py +0 -0
  122. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/Cargo.toml +0 -0
  123. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/README.md +0 -0
  124. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/docs/api.md +0 -0
  125. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/docs/index.md +0 -0
  126. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/mkdocs.yml +0 -0
  127. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/src/annotate_types.rs +0 -0
  128. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/src/dialects.rs +0 -0
  129. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/src/diff.rs +0 -0
  130. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/src/errors.rs +0 -0
  131. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/src/expr.rs +0 -0
  132. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/src/expr_types.rs +0 -0
  133. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/src/format.rs +0 -0
  134. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/src/generate.rs +0 -0
  135. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/src/helpers.rs +0 -0
  136. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/src/lib.rs +0 -0
  137. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/src/lineage.rs +0 -0
  138. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/src/optimize.rs +0 -0
  139. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/src/parse.rs +0 -0
  140. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/src/tokenize.rs +0 -0
  141. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/src/transpile.rs +0 -0
  142. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/src/types.rs +0 -0
  143. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/src/validate.rs +0 -0
  144. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/tests/conftest.py +0 -0
  145. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/tests/test_compat.py +0 -0
  146. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/tests/test_dialects.py +0 -0
  147. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/tests/test_diff.py +0 -0
  148. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/tests/test_expression.py +0 -0
  149. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/tests/test_format.py +0 -0
  150. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/tests/test_generate.py +0 -0
  151. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/tests/test_lineage.py +0 -0
  152. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/tests/test_optimize.py +0 -0
  153. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/tests/test_parse.py +0 -0
  154. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/tests/test_transpile.py +0 -0
  155. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/tests/test_validate.py +0 -0
  156. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/crates/polyglot-sql-python/uv.lock +0 -0
  157. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/pyproject.toml +0 -0
  158. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/python/polyglot_sql/__init__.py +0 -0
  159. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/python/polyglot_sql/__init__.pyi +0 -0
  160. {polyglot_sql-0.2.2 → polyglot_sql-0.2.3}/python/polyglot_sql/py.typed +0 -0
@@ -587,7 +587,7 @@ dependencies = [
587
587
 
588
588
  [[package]]
589
589
  name = "polyglot-sql"
590
- version = "0.2.2"
590
+ version = "0.2.3"
591
591
  dependencies = [
592
592
  "criterion",
593
593
  "once_cell",
@@ -602,7 +602,7 @@ dependencies = [
602
602
 
603
603
  [[package]]
604
604
  name = "polyglot-sql-ffi"
605
- version = "0.2.2"
605
+ version = "0.2.3"
606
606
  dependencies = [
607
607
  "cbindgen",
608
608
  "polyglot-sql",
@@ -612,11 +612,11 @@ dependencies = [
612
612
 
613
613
  [[package]]
614
614
  name = "polyglot-sql-function-catalogs"
615
- version = "0.2.2"
615
+ version = "0.2.3"
616
616
 
617
617
  [[package]]
618
618
  name = "polyglot-sql-python"
619
- version = "0.2.2"
619
+ version = "0.2.3"
620
620
  dependencies = [
621
621
  "polyglot-sql",
622
622
  "pyo3",
@@ -627,7 +627,7 @@ dependencies = [
627
627
 
628
628
  [[package]]
629
629
  name = "polyglot-sql-wasm"
630
- version = "0.2.2"
630
+ version = "0.2.3"
631
631
  dependencies = [
632
632
  "console_error_panic_hook",
633
633
  "js-sys",
@@ -6,7 +6,7 @@ exclude = [
6
6
  ]
7
7
 
8
8
  [workspace.package]
9
- version = "0.2.2"
9
+ version = "0.2.3"
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.2.2
3
+ Version: 0.2.3
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -78,7 +78,7 @@ serde_json = { workspace = true }
78
78
  thiserror = { workspace = true }
79
79
  unicode-segmentation = { workspace = true }
80
80
  ts-rs = { version = "12.0", features = ["serde-compat"], optional = true }
81
- polyglot-sql-function-catalogs = { path = "../polyglot-sql-function-catalogs", version = "0.2.2", optional = true, default-features = false }
81
+ polyglot-sql-function-catalogs = { path = "../polyglot-sql-function-catalogs", version = "0.2.3", optional = true, default-features = false }
82
82
 
83
83
  [dev-dependencies]
84
84
  pretty_assertions = "1.4"
@@ -1141,6 +1141,10 @@ impl BigQueryDialect {
1141
1141
  // Convert unit identifier to IntervalUnit
1142
1142
  let unit_name = match &unit_expr {
1143
1143
  Expression::Identifier(id) => id.name.to_uppercase(),
1144
+ Expression::Var(v) => v.this.to_uppercase(),
1145
+ Expression::Column(col) if col.table.is_none() => {
1146
+ col.name.name.to_uppercase()
1147
+ }
1144
1148
  _ => "DAY".to_string(),
1145
1149
  };
1146
1150
  let unit = match unit_name.as_str() {
@@ -931,6 +931,14 @@ impl DatabricksDialect {
931
931
  span: None,
932
932
  });
933
933
  }
934
+ Expression::Var(v) => {
935
+ args[0] = Expression::Identifier(Identifier {
936
+ name: v.this.to_uppercase(),
937
+ quoted: false,
938
+ trailing_comments: Vec::new(),
939
+ span: None,
940
+ });
941
+ }
934
942
  Expression::Column(col) if col.table.is_none() => {
935
943
  // Unqualified column name like "day" should be treated as a unit
936
944
  args[0] = Expression::Identifier(Identifier {
@@ -609,6 +609,7 @@ fn hive_expr_to_datetime_field(expr: &Expression) -> Option<DateTimeField> {
609
609
  s.to_uppercase()
610
610
  }
611
611
  Expression::Identifier(id) => id.name.to_uppercase(),
612
+ Expression::Var(v) => v.this.to_uppercase(),
612
613
  Expression::Column(col) if col.table.is_none() => col.name.name.to_uppercase(),
613
614
  _ => return None,
614
615
  };
@@ -1419,6 +1419,12 @@ where
1419
1419
  Expression::CreateTable(ct)
1420
1420
  }
1421
1421
 
1422
+ // CreateView: recurse into the view body query
1423
+ Expression::CreateView(mut cv) => {
1424
+ cv.query = transform_recursive(cv.query, transform_fn)?;
1425
+ Expression::CreateView(cv)
1426
+ }
1427
+
1422
1428
  // CreateTask: recurse into the task body
1423
1429
  Expression::CreateTask(mut ct) => {
1424
1430
  ct.body = transform_recursive(ct.body, transform_fn)?;
@@ -3989,7 +3995,10 @@ impl Dialect {
3989
3995
  JsonExtractToGetJsonObject, // JSON_EXTRACT/JSON_EXTRACT_SCALAR -> GET_JSON_OBJECT for Hive/Spark
3990
3996
  JsonExtractScalarToGetJsonObject, // JSON_EXTRACT_SCALAR -> GET_JSON_OBJECT for Hive/Spark
3991
3997
  JsonQueryValueConvert, // JsonQuery/JsonValue -> target-specific (ISNULL wrapper for TSQL, GET_JSON_OBJECT for Spark, etc.)
3992
- JsonLiteralToJsonParse, // JSON 'x' -> JSON_PARSE('x') for Presto, PARSE_JSON for Snowflake
3998
+ JsonLiteralToJsonParse, // JSON 'x' -> JSON_PARSE('x') for Presto, PARSE_JSON for Snowflake; also DuckDB CAST(x AS JSON)
3999
+ DuckDBTryCastJsonToTryJsonParse, // DuckDB TRY_CAST(x AS JSON) -> TRY(JSON_PARSE(x)) for Trino/Presto/Athena
4000
+ DuckDBJsonFuncToJsonParse, // DuckDB json(x) -> JSON_PARSE(x) for Trino/Presto/Athena
4001
+ DuckDBJsonValidToIsJson, // DuckDB json_valid(x) -> x IS JSON for Trino/Presto/Athena
3993
4002
  ArraySyntaxConvert, // ARRAY[x] -> ARRAY(x) for Spark, [x] for BigQuery/DuckDB
3994
4003
  AtTimeZoneConvert, // AT TIME ZONE -> AT_TIMEZONE (Presto) / FROM_UTC_TIMESTAMP (Spark)
3995
4004
  DayOfWeekConvert, // DAY_OF_WEEK -> dialect-specific
@@ -5806,8 +5815,30 @@ impl Dialect {
5806
5815
  match &e {
5807
5816
  Expression::Function(f) => {
5808
5817
  let name = f.name.to_ascii_uppercase();
5818
+ // DuckDB json(x) is a synonym for CAST(x AS JSON) — parses a string.
5819
+ // Map to JSON_PARSE(x) for Trino/Presto/Athena to preserve semantics.
5820
+ if name == "JSON"
5821
+ && f.args.len() == 1
5822
+ && matches!(source, DialectType::DuckDB)
5823
+ && matches!(
5824
+ target,
5825
+ DialectType::Presto | DialectType::Trino | DialectType::Athena
5826
+ )
5827
+ {
5828
+ Action::DuckDBJsonFuncToJsonParse
5829
+ // DuckDB json_valid(x) has no direct Trino equivalent; emit the
5830
+ // SQL:2016 `x IS JSON` predicate which has matching semantics.
5831
+ } else if name == "JSON_VALID"
5832
+ && f.args.len() == 1
5833
+ && matches!(source, DialectType::DuckDB)
5834
+ && matches!(
5835
+ target,
5836
+ DialectType::Presto | DialectType::Trino | DialectType::Athena
5837
+ )
5838
+ {
5839
+ Action::DuckDBJsonValidToIsJson
5809
5840
  // DATE_PART: strip quotes from first arg when target is Snowflake (source != Snowflake)
5810
- if (name == "DATE_PART" || name == "DATEPART")
5841
+ } else if (name == "DATE_PART" || name == "DATEPART")
5811
5842
  && f.args.len() == 2
5812
5843
  && matches!(target, DialectType::Snowflake)
5813
5844
  && !matches!(source, DialectType::Snowflake)
@@ -6559,6 +6590,18 @@ impl Dialect {
6559
6590
  // CAST('x' AS JSON) -> JSON_PARSE('x') for Presto, PARSE_JSON for Snowflake
6560
6591
  // Only when the input is a string literal (JSON 'value' syntax)
6561
6592
  Action::JsonLiteralToJsonParse
6593
+ } else if matches!(&c.to, DataType::Json)
6594
+ && matches!(source, DialectType::DuckDB)
6595
+ && matches!(
6596
+ target,
6597
+ DialectType::Presto | DialectType::Trino | DialectType::Athena
6598
+ )
6599
+ {
6600
+ // DuckDB's CAST(x AS JSON) parses the string value into a JSON value.
6601
+ // Trino/Presto/Athena's CAST(x AS JSON) instead wraps the value as a
6602
+ // JSON string (no parsing) — different semantics. Use JSON_PARSE(x)
6603
+ // in the target to preserve DuckDB's parse semantics.
6604
+ Action::JsonLiteralToJsonParse
6562
6605
  } else if matches!(&c.to, DataType::Json | DataType::JsonB)
6563
6606
  && matches!(target, DialectType::Spark | DialectType::Databricks)
6564
6607
  {
@@ -6633,6 +6676,23 @@ impl Dialect {
6633
6676
  Action::None
6634
6677
  }
6635
6678
  }
6679
+ Expression::TryCast(ref c) => {
6680
+ if matches!(&c.to, DataType::Json)
6681
+ && matches!(source, DialectType::DuckDB)
6682
+ && matches!(
6683
+ target,
6684
+ DialectType::Presto | DialectType::Trino | DialectType::Athena
6685
+ )
6686
+ {
6687
+ // DuckDB's TRY_CAST(x AS JSON) tries to parse x as JSON, returning
6688
+ // NULL on parse failure. Trino/Presto/Athena's TRY_CAST(x AS JSON)
6689
+ // wraps the value as a JSON string (no parse). Emit TRY(JSON_PARSE(x))
6690
+ // to preserve DuckDB's parse-or-null semantics.
6691
+ Action::DuckDBTryCastJsonToTryJsonParse
6692
+ } else {
6693
+ Action::None
6694
+ }
6695
+ }
6636
6696
  // For DuckDB: DATE_TRUNC should preserve the input type
6637
6697
  Expression::DateTrunc(_) | Expression::TimestampTrunc(_) => {
6638
6698
  if matches!(source, DialectType::Snowflake)
@@ -17678,6 +17738,7 @@ impl Dialect {
17678
17738
  // Get the raw unit text preserving original case
17679
17739
  let raw_unit = match &f.args[0] {
17680
17740
  Expression::Identifier(id) => id.name.clone(),
17741
+ Expression::Var(v) => v.this.clone(),
17681
17742
  Expression::Literal(lit)
17682
17743
  if matches!(
17683
17744
  lit.as_ref(),
@@ -22003,6 +22064,7 @@ impl Dialect {
22003
22064
 
22004
22065
  Action::JsonLiteralToJsonParse => {
22005
22066
  // CAST('x' AS JSON) -> JSON_PARSE('x') for Presto, PARSE_JSON for Snowflake
22067
+ // Also DuckDB CAST(x AS JSON) -> JSON_PARSE(x) for Trino/Presto/Athena
22006
22068
  if let Expression::Cast(c) = e {
22007
22069
  let func_name = if matches!(target, DialectType::Snowflake) {
22008
22070
  "PARSE_JSON"
@@ -22018,6 +22080,52 @@ impl Dialect {
22018
22080
  }
22019
22081
  }
22020
22082
 
22083
+ Action::DuckDBTryCastJsonToTryJsonParse => {
22084
+ // DuckDB TRY_CAST(x AS JSON) -> TRY(JSON_PARSE(x)) for Trino/Presto/Athena
22085
+ if let Expression::TryCast(c) = e {
22086
+ let json_parse = Expression::Function(Box::new(Function::new(
22087
+ "JSON_PARSE".to_string(),
22088
+ vec![c.this],
22089
+ )));
22090
+ Ok(Expression::Function(Box::new(Function::new(
22091
+ "TRY".to_string(),
22092
+ vec![json_parse],
22093
+ ))))
22094
+ } else {
22095
+ Ok(e)
22096
+ }
22097
+ }
22098
+
22099
+ Action::DuckDBJsonFuncToJsonParse => {
22100
+ // DuckDB json(x) -> JSON_PARSE(x) for Trino/Presto/Athena
22101
+ if let Expression::Function(f) = e {
22102
+ let args = f.args;
22103
+ Ok(Expression::Function(Box::new(Function::new(
22104
+ "JSON_PARSE".to_string(),
22105
+ args,
22106
+ ))))
22107
+ } else {
22108
+ Ok(e)
22109
+ }
22110
+ }
22111
+
22112
+ Action::DuckDBJsonValidToIsJson => {
22113
+ // DuckDB json_valid(x) -> x IS JSON (SQL:2016 predicate) for Trino/Presto/Athena
22114
+ if let Expression::Function(mut f) = e {
22115
+ let arg = f.args.remove(0);
22116
+ Ok(Expression::IsJson(Box::new(
22117
+ crate::expressions::IsJson {
22118
+ this: arg,
22119
+ json_type: None,
22120
+ unique_keys: None,
22121
+ negated: false,
22122
+ },
22123
+ )))
22124
+ } else {
22125
+ Ok(e)
22126
+ }
22127
+ }
22128
+
22021
22129
  Action::AtTimeZoneConvert => {
22022
22130
  // AT TIME ZONE -> target-specific conversion
22023
22131
  if let Expression::AtTimeZone(atz) = e {
@@ -30301,6 +30409,7 @@ impl Dialect {
30301
30409
  fn get_unit_str(expr: &Expression) -> String {
30302
30410
  match expr {
30303
30411
  Expression::Identifier(id) => id.name.to_ascii_uppercase(),
30412
+ Expression::Var(v) => v.this.to_ascii_uppercase(),
30304
30413
  Expression::Literal(lit) if matches!(lit.as_ref(), Literal::String(_)) => {
30305
30414
  let Literal::String(s) = lit.as_ref() else {
30306
30415
  unreachable!()
@@ -34724,6 +34833,7 @@ impl Dialect {
34724
34833
  use crate::expressions::Literal;
34725
34834
  match expr {
34726
34835
  Expression::Identifier(id) => id.name.to_ascii_uppercase(),
34836
+ Expression::Var(v) => v.this.to_ascii_uppercase(),
34727
34837
  Expression::Literal(lit) if matches!(lit.as_ref(), Literal::String(_)) => {
34728
34838
  let Literal::String(s) = lit.as_ref() else {
34729
34839
  unreachable!()
@@ -1256,6 +1256,7 @@ impl PostgresDialect {
1256
1256
  // Extract unit name from identifier or column
1257
1257
  let unit_name = match &unit_expr {
1258
1258
  Expression::Identifier(id) => id.name.to_uppercase(),
1259
+ Expression::Var(v) => v.this.to_uppercase(),
1259
1260
  Expression::Column(col) if col.table.is_none() => {
1260
1261
  col.name.name.to_uppercase()
1261
1262
  }
@@ -844,6 +844,7 @@ impl PrestoDialect {
844
844
  "DATE_PART" if f.args.len() == 2 => {
845
845
  let part_name = match &f.args[0] {
846
846
  Expression::Identifier(id) => Some(id.name.to_uppercase()),
847
+ Expression::Var(v) => Some(v.this.to_uppercase()),
847
848
  Expression::Column(c) => Some(c.name.name.to_uppercase()),
848
849
  _ => None,
849
850
  };
@@ -2816,6 +2816,7 @@ impl SnowflakeDialect {
2816
2816
  // Transform the unit to canonical form and convert to string literal
2817
2817
  let unit_name = match &args[0] {
2818
2818
  Expression::Identifier(id) => Some(id.name.as_str()),
2819
+ Expression::Var(v) => Some(v.this.as_str()),
2819
2820
  Expression::Column(col) if col.table.is_none() => Some(col.name.name.as_str()),
2820
2821
  _ => None,
2821
2822
  };
@@ -997,6 +997,7 @@ fn expr_to_datetime_field(expr: &Expression) -> Option<DateTimeField> {
997
997
  s.to_uppercase()
998
998
  }
999
999
  Expression::Identifier(id) => id.name.to_uppercase(),
1000
+ Expression::Var(v) => v.this.to_uppercase(),
1000
1001
  Expression::Column(col) if col.table.is_none() => col.name.name.to_uppercase(),
1001
1002
  _ => return None,
1002
1003
  };
@@ -354,6 +354,10 @@ impl SQLiteDialect {
354
354
  s.to_lowercase()
355
355
  }
356
356
  Expression::Identifier(id) => id.name.to_lowercase(),
357
+ Expression::Var(v) => v.this.to_lowercase(),
358
+ Expression::Column(col) if col.table.is_none() => {
359
+ col.name.name.to_lowercase()
360
+ }
357
361
  _ => "day".to_string(),
358
362
  };
359
363
 
@@ -1203,6 +1203,14 @@ impl TSQLDialect {
1203
1203
  span: None,
1204
1204
  });
1205
1205
  }
1206
+ Expression::Var(v) => {
1207
+ args[0] = Expression::Identifier(Identifier {
1208
+ name: v.this.to_uppercase(),
1209
+ quoted: false,
1210
+ trailing_comments: Vec::new(),
1211
+ span: None,
1212
+ });
1213
+ }
1206
1214
  Expression::Column(col) if col.table.is_none() => {
1207
1215
  args[0] = Expression::Identifier(Identifier {
1208
1216
  name: col.name.name.to_uppercase(),
@@ -9667,6 +9667,9 @@ pub struct Describe {
9667
9667
  /// AS JSON suffix (Databricks)
9668
9668
  #[serde(default)]
9669
9669
  pub as_json: bool,
9670
+ /// Parenthesized parameter types for DESCRIBE PROCEDURE/FUNCTION (e.g., INT, VARCHAR)
9671
+ #[serde(default, skip_serializing_if = "Vec::is_empty")]
9672
+ pub params: Vec<String>,
9670
9673
  }
9671
9674
 
9672
9675
  impl Describe {
@@ -9681,6 +9684,7 @@ impl Describe {
9681
9684
  partition: None,
9682
9685
  leading_comments: Vec::new(),
9683
9686
  as_json: false,
9687
+ params: Vec::new(),
9684
9688
  }
9685
9689
  }
9686
9690
  }
@@ -13846,6 +13846,18 @@ impl Generator {
13846
13846
  self.write_space();
13847
13847
  self.generate_expression(&d.target)?;
13848
13848
 
13849
+ // Output parenthesized parameter types for PROCEDURE/FUNCTION
13850
+ if !d.params.is_empty() {
13851
+ self.write("(");
13852
+ for (i, param) in d.params.iter().enumerate() {
13853
+ if i > 0 {
13854
+ self.write(", ");
13855
+ }
13856
+ self.write(param);
13857
+ }
13858
+ self.write(")");
13859
+ }
13860
+
13849
13861
  // Output PARTITION clause if present (the Partition expression outputs its own PARTITION keyword)
13850
13862
  if let Some(ref partition) = d.partition {
13851
13863
  self.write_space();
@@ -17955,6 +17967,7 @@ impl Generator {
17955
17967
  Some(s.clone())
17956
17968
  }
17957
17969
  Expression::Identifier(id) => Some(id.name.clone()),
17970
+ Expression::Var(v) => Some(v.this.clone()),
17958
17971
  Expression::Column(col) if col.table.is_none() => {
17959
17972
  // Simple column reference without table prefix, treat as identifier
17960
17973
  Some(col.name.name.clone())