polyglot-sql 0.3.11__tar.gz → 0.4.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.
Files changed (174) hide show
  1. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/Cargo.lock +5 -5
  2. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/Cargo.toml +1 -1
  3. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/PKG-INFO +24 -1
  4. {polyglot_sql-0.3.11/crates/polyglot-sql-python → polyglot_sql-0.4.1}/README.md +23 -0
  5. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/Cargo.toml +26 -3
  6. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/README.md +47 -0
  7. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/athena.rs +8 -0
  8. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/bigquery.rs +6 -0
  9. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/clickhouse.rs +9 -0
  10. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/cockroachdb.rs +6 -0
  11. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/databricks.rs +6 -0
  12. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/datafusion.rs +6 -0
  13. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/doris.rs +6 -0
  14. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/dremio.rs +6 -0
  15. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/drill.rs +6 -0
  16. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/druid.rs +6 -0
  17. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/duckdb.rs +6 -0
  18. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/dune.rs +5 -0
  19. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/exasol.rs +6 -0
  20. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/fabric.rs +6 -0
  21. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/hive.rs +6 -0
  22. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/materialize.rs +6 -0
  23. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/mod.rs +369 -107
  24. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/mysql.rs +6 -0
  25. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/oracle.rs +6 -0
  26. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/postgres.rs +6 -0
  27. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/presto.rs +6 -0
  28. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/redshift.rs +6 -0
  29. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/risingwave.rs +6 -0
  30. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/singlestore.rs +6 -0
  31. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/snowflake.rs +6 -0
  32. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/solr.rs +5 -0
  33. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/spark.rs +6 -0
  34. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/sqlite.rs +6 -0
  35. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/starrocks.rs +6 -0
  36. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/tableau.rs +6 -0
  37. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/teradata.rs +6 -0
  38. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/tidb.rs +6 -0
  39. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/trino.rs +6 -0
  40. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/tsql.rs +6 -0
  41. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/expressions.rs +4 -2
  42. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/generator.rs +10 -1
  43. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/lib.rs +76 -8
  44. polyglot_sql-0.4.1/crates/polyglot-sql/src/openlineage.rs +1247 -0
  45. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/optimizer/subquery.rs +19 -3
  46. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/parser.rs +20 -6
  47. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/identity_roundtrip.rs +1 -0
  48. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/sqlglot_compat.rs +16 -0
  49. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1/crates/polyglot-sql-python}/README.md +23 -0
  50. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/src/lib.rs +7 -0
  51. polyglot_sql-0.4.1/crates/polyglot-sql-python/src/openlineage.rs +61 -0
  52. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/tests/test_lineage.py +53 -0
  53. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/python/polyglot_sql/__init__.py +6 -0
  54. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/python/polyglot_sql/__init__.pyi +29 -0
  55. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/benches/in_list.rs +0 -0
  56. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/benches/parsing.rs +0 -0
  57. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/benches/rust_parsing.rs +0 -0
  58. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/benches/transpile.rs +0 -0
  59. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/examples/basic_usage.rs +0 -0
  60. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/examples/bench_json.rs +0 -0
  61. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/ast_transforms.rs +0 -0
  62. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/builder.rs +0 -0
  63. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/dialects/generic.rs +0 -0
  64. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/diff.rs +0 -0
  65. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/error.rs +0 -0
  66. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/function_catalog.rs +0 -0
  67. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/function_registry.rs +0 -0
  68. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/helper.rs +0 -0
  69. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/lineage.rs +0 -0
  70. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/optimizer/annotate_types.rs +0 -0
  71. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/optimizer/canonicalize.rs +0 -0
  72. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/optimizer/eliminate_ctes.rs +0 -0
  73. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/optimizer/eliminate_joins.rs +0 -0
  74. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/optimizer/isolate_table_selects.rs +0 -0
  75. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/optimizer/mod.rs +0 -0
  76. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/optimizer/normalize.rs +0 -0
  77. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/optimizer/normalize_identifiers.rs +0 -0
  78. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/optimizer/optimize_joins.rs +0 -0
  79. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/optimizer/optimizer.rs +0 -0
  80. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/optimizer/pushdown_predicates.rs +0 -0
  81. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/optimizer/pushdown_projections.rs +0 -0
  82. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/optimizer/qualify_columns.rs +0 -0
  83. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/optimizer/qualify_tables.rs +0 -0
  84. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/optimizer/simplify.rs +0 -0
  85. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/planner.rs +0 -0
  86. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/resolver.rs +0 -0
  87. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/schema.rs +0 -0
  88. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/scope.rs +0 -0
  89. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/time.rs +0 -0
  90. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/tokens.rs +0 -0
  91. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/transforms.rs +0 -0
  92. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/traversal.rs +0 -0
  93. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/trie.rs +0 -0
  94. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/validation/tests.rs +0 -0
  95. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/src/validation.rs +0 -0
  96. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/analyze_failures.rs +0 -0
  97. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/clickhouse_regression.rs +0 -0
  98. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/common/known_failures.rs +0 -0
  99. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/common/mod.rs +0 -0
  100. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/common/test_data.rs +0 -0
  101. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/common/test_runner.rs +0 -0
  102. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/custom_clickhouse_coverage.rs +0 -0
  103. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/custom_clickhouse_parser.rs +0 -0
  104. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/custom_dialect.rs +0 -0
  105. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/custom_dialect_tests.rs +0 -0
  106. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/custom_fixtures/datafusion/ddl.json +0 -0
  107. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/custom_fixtures/datafusion/dml.json +0 -0
  108. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/custom_fixtures/datafusion/functions.json +0 -0
  109. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/custom_fixtures/datafusion/identity.json +0 -0
  110. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/custom_fixtures/datafusion/operators.json +0 -0
  111. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/custom_fixtures/datafusion/select.json +0 -0
  112. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/custom_fixtures/datafusion/transpilation.json +0 -0
  113. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/custom_fixtures/datafusion/types.json +0 -0
  114. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/deep_nesting_regression.rs +0 -0
  115. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/dialect_matrix.rs +0 -0
  116. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/error_handling.rs +0 -0
  117. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/fabric_regression.rs +0 -0
  118. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/fabric_tpch_regression.rs +0 -0
  119. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/issue201_regression_test.rs +0 -0
  120. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/postgres_sqlite_regression.rs +0 -0
  121. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/snowflake_regression_test.rs +0 -0
  122. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/sqlglot_dialect_identity.rs +0 -0
  123. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/sqlglot_identity.rs +0 -0
  124. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/sqlglot_identity_detailed.rs +0 -0
  125. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/sqlglot_parser.rs +0 -0
  126. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/sqlglot_pretty.rs +0 -0
  127. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/sqlglot_transpilation.rs +0 -0
  128. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/sqlglot_transpile.rs +0 -0
  129. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/tpch_transpile_stack.rs +0 -0
  130. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/transform_regression.rs +0 -0
  131. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql/tests/tsql_regression.rs +0 -0
  132. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-function-catalogs/Cargo.toml +0 -0
  133. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-function-catalogs/README.md +0 -0
  134. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-function-catalogs/src/clickhouse.rs +0 -0
  135. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-function-catalogs/src/duckdb.rs +0 -0
  136. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-function-catalogs/src/lib.rs +0 -0
  137. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-function-catalogs/tools/clickhouse/extract_functions.py +0 -0
  138. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-function-catalogs/tools/duckdb/extract_functions.py +0 -0
  139. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/Cargo.toml +0 -0
  140. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/docs/api.md +0 -0
  141. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/docs/index.md +0 -0
  142. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/mkdocs.yml +0 -0
  143. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/src/annotate_types.rs +0 -0
  144. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/src/dialects.rs +0 -0
  145. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/src/diff.rs +0 -0
  146. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/src/errors.rs +0 -0
  147. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/src/expr.rs +0 -0
  148. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/src/expr_types.rs +0 -0
  149. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/src/format.rs +0 -0
  150. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/src/generate.rs +0 -0
  151. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/src/helpers.rs +0 -0
  152. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/src/lineage.rs +0 -0
  153. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/src/optimize.rs +0 -0
  154. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/src/parse.rs +0 -0
  155. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/src/tokenize.rs +0 -0
  156. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/src/transforms.rs +0 -0
  157. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/src/transpile.rs +0 -0
  158. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/src/types.rs +0 -0
  159. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/src/validate.rs +0 -0
  160. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/tests/conftest.py +0 -0
  161. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/tests/test_compat.py +0 -0
  162. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/tests/test_dialects.py +0 -0
  163. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/tests/test_diff.py +0 -0
  164. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/tests/test_expression.py +0 -0
  165. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/tests/test_format.py +0 -0
  166. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/tests/test_generate.py +0 -0
  167. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/tests/test_optimize.py +0 -0
  168. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/tests/test_parse.py +0 -0
  169. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/tests/test_transforms.py +0 -0
  170. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/tests/test_transpile.py +0 -0
  171. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/tests/test_validate.py +0 -0
  172. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/crates/polyglot-sql-python/uv.lock +0 -0
  173. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/pyproject.toml +0 -0
  174. {polyglot_sql-0.3.11 → polyglot_sql-0.4.1}/python/polyglot_sql/py.typed +0 -0
@@ -605,7 +605,7 @@ dependencies = [
605
605
 
606
606
  [[package]]
607
607
  name = "polyglot-sql"
608
- version = "0.3.11"
608
+ version = "0.4.1"
609
609
  dependencies = [
610
610
  "criterion",
611
611
  "once_cell",
@@ -621,7 +621,7 @@ dependencies = [
621
621
 
622
622
  [[package]]
623
623
  name = "polyglot-sql-ffi"
624
- version = "0.3.11"
624
+ version = "0.4.1"
625
625
  dependencies = [
626
626
  "cbindgen",
627
627
  "polyglot-sql",
@@ -631,11 +631,11 @@ dependencies = [
631
631
 
632
632
  [[package]]
633
633
  name = "polyglot-sql-function-catalogs"
634
- version = "0.3.11"
634
+ version = "0.4.1"
635
635
 
636
636
  [[package]]
637
637
  name = "polyglot-sql-python"
638
- version = "0.3.11"
638
+ version = "0.4.1"
639
639
  dependencies = [
640
640
  "polyglot-sql",
641
641
  "pyo3",
@@ -646,7 +646,7 @@ dependencies = [
646
646
 
647
647
  [[package]]
648
648
  name = "polyglot-sql-wasm"
649
- version = "0.3.11"
649
+ version = "0.4.1"
650
650
  dependencies = [
651
651
  "console_error_panic_hook",
652
652
  "js-sys",
@@ -6,7 +6,7 @@ exclude = [
6
6
  ]
7
7
 
8
8
  [workspace.package]
9
- version = "0.3.11"
9
+ version = "0.4.1"
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.11
3
+ Version: 0.4.1
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -94,6 +94,26 @@ if result:
94
94
  print("valid")
95
95
  ```
96
96
 
97
+ ```python
98
+ options = {
99
+ "producer": "https://github.com/tobilg/polyglot",
100
+ "datasetNamespace": "postgres://warehouse",
101
+ "outputDataset": {
102
+ "namespace": "postgres://warehouse",
103
+ "name": "analytics.revenue",
104
+ },
105
+ }
106
+
107
+ payload = polyglot_sql.openlineage_column_lineage(
108
+ "SELECT order_id, amount * 100 AS amount_cents FROM raw.orders",
109
+ options,
110
+ )
111
+ print(payload["facet"]["fields"])
112
+ ```
113
+
114
+ OpenLineage helpers only produce compatible payloads. Transport and client
115
+ emission are intentionally out of scope.
116
+
97
117
  ## API Reference
98
118
 
99
119
  All functions are exported from `polyglot_sql`.
@@ -108,6 +128,9 @@ All functions are exported from `polyglot_sql`.
108
128
  - `optimize(sql: str, dialect: str = "generic") -> str`
109
129
  - `lineage(column: str, sql: str, dialect: str = "generic") -> dict`
110
130
  - `source_tables(column: str, sql: str, dialect: str = "generic") -> list[str]`
131
+ - `openlineage_column_lineage(sql: str, options: dict) -> dict`
132
+ - `openlineage_job_event(sql: str, options: dict) -> dict`
133
+ - `openlineage_run_event(sql: str, options: dict) -> dict`
111
134
  - `diff(sql1: str, sql2: str, dialect: str = "generic") -> list[dict]`
112
135
  - `dialects() -> list[str]`
113
136
  - `__version__: str`
@@ -67,6 +67,26 @@ if result:
67
67
  print("valid")
68
68
  ```
69
69
 
70
+ ```python
71
+ options = {
72
+ "producer": "https://github.com/tobilg/polyglot",
73
+ "datasetNamespace": "postgres://warehouse",
74
+ "outputDataset": {
75
+ "namespace": "postgres://warehouse",
76
+ "name": "analytics.revenue",
77
+ },
78
+ }
79
+
80
+ payload = polyglot_sql.openlineage_column_lineage(
81
+ "SELECT order_id, amount * 100 AS amount_cents FROM raw.orders",
82
+ options,
83
+ )
84
+ print(payload["facet"]["fields"])
85
+ ```
86
+
87
+ OpenLineage helpers only produce compatible payloads. Transport and client
88
+ emission are intentionally out of scope.
89
+
70
90
  ## API Reference
71
91
 
72
92
  All functions are exported from `polyglot_sql`.
@@ -81,6 +101,9 @@ All functions are exported from `polyglot_sql`.
81
101
  - `optimize(sql: str, dialect: str = "generic") -> str`
82
102
  - `lineage(column: str, sql: str, dialect: str = "generic") -> dict`
83
103
  - `source_tables(column: str, sql: str, dialect: str = "generic") -> list[str]`
104
+ - `openlineage_column_lineage(sql: str, options: dict) -> dict`
105
+ - `openlineage_job_event(sql: str, options: dict) -> dict`
106
+ - `openlineage_run_event(sql: str, options: dict) -> dict`
84
107
  - `diff(sql1: str, sql2: str, dialect: str = "generic") -> list[dict]`
85
108
  - `dialects() -> list[str]`
86
109
  - `__version__: str`
@@ -10,9 +10,29 @@ description = "SQL parsing, validating, formatting, and dialect translation libr
10
10
  readme = "README.md"
11
11
 
12
12
  [features]
13
- default = ["all-dialects", "transpile", "stacker"]
13
+ default = [
14
+ "all-dialects",
15
+ "generate",
16
+ "transpile",
17
+ "builder",
18
+ "ast-tools",
19
+ "semantic",
20
+ "openlineage",
21
+ "diff",
22
+ "planner",
23
+ "time",
24
+ "stacker",
25
+ ]
14
26
  bindings = ["dep:ts-rs"]
15
- transpile = []
27
+ generate = []
28
+ transpile = ["generate"]
29
+ builder = ["generate"]
30
+ ast-tools = []
31
+ semantic = ["ast-tools"]
32
+ openlineage = ["semantic"]
33
+ diff = ["generate"]
34
+ planner = []
35
+ time = []
16
36
  # Default-on for native builds so direct Rust users and the FFI/Python bindings
17
37
  # inherit stack-growth protection automatically. WASM opts out via
18
38
  # `default-features = false` in its dependency declaration.
@@ -64,14 +84,17 @@ dialect-dremio = []
64
84
  dialect-exasol = []
65
85
  dialect-datafusion = []
66
86
  function-catalog-clickhouse = [
87
+ "semantic",
67
88
  "dep:polyglot-sql-function-catalogs",
68
89
  "polyglot-sql-function-catalogs/dialect-clickhouse",
69
90
  ]
70
91
  function-catalog-duckdb = [
92
+ "semantic",
71
93
  "dep:polyglot-sql-function-catalogs",
72
94
  "polyglot-sql-function-catalogs/dialect-duckdb",
73
95
  ]
74
96
  function-catalog-all-dialects = [
97
+ "semantic",
75
98
  "dep:polyglot-sql-function-catalogs",
76
99
  "polyglot-sql-function-catalogs/all-dialects",
77
100
  ]
@@ -83,7 +106,7 @@ thiserror = { workspace = true }
83
106
  unicode-segmentation = { workspace = true }
84
107
  stacker = { version = "0.1", optional = true }
85
108
  ts-rs = { version = "12.0", features = ["serde-compat"], optional = true }
86
- polyglot-sql-function-catalogs = { path = "../polyglot-sql-function-catalogs", version = "0.3.11", optional = true, default-features = false }
109
+ polyglot-sql-function-catalogs = { path = "../polyglot-sql-function-catalogs", version = "0.4.1", optional = true, default-features = false }
87
110
 
88
111
  [dev-dependencies]
89
112
  pretty_assertions = "1.4"
@@ -17,6 +17,44 @@ Part of the [Polyglot](https://github.com/tobilg/polyglot) project.
17
17
 
18
18
  ## Usage
19
19
 
20
+ ### Cargo Features
21
+
22
+ By default, `polyglot-sql` enables the full public API. Parser-only consumers can
23
+ disable default features and opt into only the dialect parsers they need:
24
+
25
+ ```toml
26
+ polyglot-sql = { version = "0.4", default-features = false }
27
+ ```
28
+
29
+ ```toml
30
+ polyglot-sql = {
31
+ version = "0.4",
32
+ default-features = false,
33
+ features = ["dialect-clickhouse"],
34
+ }
35
+ ```
36
+
37
+ Optional capability features include `generate`, `transpile`, `builder`,
38
+ `ast-tools`, `semantic`, `openlineage`, `diff`, `planner`, and `time`.
39
+
40
+ Examples:
41
+
42
+ ```toml
43
+ # Parse and generate SQL for one dialect.
44
+ polyglot-sql = {
45
+ version = "0.4",
46
+ default-features = false,
47
+ features = ["generate", "dialect-clickhouse"],
48
+ }
49
+
50
+ # Cross-dialect transpilation.
51
+ polyglot-sql = {
52
+ version = "0.4",
53
+ default-features = false,
54
+ features = ["transpile", "dialect-clickhouse", "dialect-postgresql"],
55
+ }
56
+ ```
57
+
20
58
  ### Transpile
21
59
 
22
60
  ```rust
@@ -323,6 +361,15 @@ Athena, BigQuery, ClickHouse, CockroachDB, Databricks, Doris, Dremio, Drill, Dru
323
361
 
324
362
  | Flag | Description |
325
363
  |------|-------------|
364
+ | `generate` | Enable SQL generation and formatting from AST nodes |
365
+ | `transpile` | Enable cross-dialect transpilation; implies `generate` |
366
+ | `builder` | Enable the fluent query builder API; implies `generate` |
367
+ | `ast-tools` | Enable AST inspection and transform helper APIs |
368
+ | `semantic` | Enable schema, resolver, lineage, optimizer, and validation APIs |
369
+ | `openlineage` | Enable OpenLineage payload generation; implies `semantic` |
370
+ | `diff` | Enable AST diff support; implies `generate` |
371
+ | `planner` | Enable logical planning helpers |
372
+ | `time` | Enable time-format conversion helpers |
326
373
  | `bindings` | Enable `ts-rs` TypeScript type generation |
327
374
 
328
375
  ## License
@@ -13,6 +13,7 @@ use crate::error::Result;
13
13
  use crate::expressions::{
14
14
  AggFunc, Case, Cast, DataType, Expression, Function, LikeOp, UnaryFunc, VarArgFunc,
15
15
  };
16
+ #[cfg(feature = "generate")]
16
17
  use crate::generator::{GeneratorConfig, IdentifierQuoteStyle};
17
18
  use crate::tokens::TokenizerConfig;
18
19
 
@@ -36,6 +37,8 @@ impl DialectImpl for AthenaDialect {
36
37
  config
37
38
  }
38
39
 
40
+ #[cfg(feature = "generate")]
41
+
39
42
  fn generator_config(&self) -> GeneratorConfig {
40
43
  // Default config uses Trino style (double quotes)
41
44
  GeneratorConfig {
@@ -47,6 +50,8 @@ impl DialectImpl for AthenaDialect {
47
50
  }
48
51
  }
49
52
 
53
+ #[cfg(feature = "generate")]
54
+
50
55
  fn generator_config_for_expr(&self, expr: &Expression) -> GeneratorConfig {
51
56
  if should_use_hive_engine(expr) {
52
57
  // Hive mode: backticks for identifiers
@@ -69,6 +74,8 @@ impl DialectImpl for AthenaDialect {
69
74
  }
70
75
  }
71
76
 
77
+ #[cfg(feature = "transpile")]
78
+
72
79
  fn transform_expr(&self, expr: Expression) -> Result<Expression> {
73
80
  match expr {
74
81
  // IFNULL -> COALESCE in Athena
@@ -169,6 +176,7 @@ impl DialectImpl for AthenaDialect {
169
176
  }
170
177
  }
171
178
 
179
+ #[cfg(feature = "transpile")]
172
180
  impl AthenaDialect {
173
181
  fn transform_function(&self, f: Function) -> Result<Expression> {
174
182
  let name_upper = f.name.to_uppercase();
@@ -16,6 +16,7 @@ use crate::expressions::{
16
16
  Identifier, JsonExtractFunc, LikeOp, Literal, Select, SplitFunc, StringAggFunc, UnaryFunc,
17
17
  UnnestFunc, VarArgFunc, Where,
18
18
  };
19
+ #[cfg(feature = "generate")]
19
20
  use crate::generator::GeneratorConfig;
20
21
  use crate::tokens::TokenizerConfig;
21
22
 
@@ -53,6 +54,8 @@ impl DialectImpl for BigQueryDialect {
53
54
  config
54
55
  }
55
56
 
57
+ #[cfg(feature = "generate")]
58
+
56
59
  fn generator_config(&self) -> GeneratorConfig {
57
60
  use crate::generator::{IdentifierQuoteStyle, NormalizeFunctions};
58
61
  GeneratorConfig {
@@ -94,6 +97,8 @@ impl DialectImpl for BigQueryDialect {
94
97
  }
95
98
  }
96
99
 
100
+ #[cfg(feature = "transpile")]
101
+
97
102
  fn transform_expr(&self, expr: Expression) -> Result<Expression> {
98
103
  match expr {
99
104
  // ===== Data Type Mappings =====
@@ -857,6 +862,7 @@ impl DialectImpl for BigQueryDialect {
857
862
  }
858
863
  }
859
864
 
865
+ #[cfg(feature = "transpile")]
860
866
  impl BigQueryDialect {
861
867
  /// Transform data types according to BigQuery TYPE_MAPPING
862
868
  fn transform_data_type(&self, dt: crate::expressions::DataType) -> Result<Expression> {
@@ -4,11 +4,14 @@
4
4
  //! ClickHouse is case-sensitive and has unique function naming conventions.
5
5
 
6
6
  use super::{DialectImpl, DialectType};
7
+ #[cfg(feature = "transpile")]
7
8
  use crate::error::Result;
9
+ #[cfg(feature = "transpile")]
8
10
  use crate::expressions::{
9
11
  AggregateFunction, BinaryOp, Case, Cast, Expression, Function, In, IsNull, LikeOp,
10
12
  MapConstructor, Paren, UnaryOp,
11
13
  };
14
+ #[cfg(feature = "generate")]
12
15
  use crate::generator::GeneratorConfig;
13
16
  use crate::tokens::TokenizerConfig;
14
17
 
@@ -49,6 +52,8 @@ impl DialectImpl for ClickHouseDialect {
49
52
  config
50
53
  }
51
54
 
55
+ #[cfg(feature = "generate")]
56
+
52
57
  fn generator_config(&self) -> GeneratorConfig {
53
58
  use crate::generator::{IdentifierQuoteStyle, NormalizeFunctions};
54
59
  GeneratorConfig {
@@ -70,6 +75,8 @@ impl DialectImpl for ClickHouseDialect {
70
75
  }
71
76
  }
72
77
 
78
+ #[cfg(feature = "transpile")]
79
+
73
80
  fn transform_expr(&self, expr: Expression) -> Result<Expression> {
74
81
  let wrap_predicate_left = |expr: Expression| -> Expression {
75
82
  let needs_parens = matches!(
@@ -365,8 +372,10 @@ impl DialectImpl for ClickHouseDialect {
365
372
  }
366
373
  }
367
374
 
375
+ #[cfg(feature = "transpile")]
368
376
  impl ClickHouseDialect {}
369
377
 
378
+ #[cfg(feature = "transpile")]
370
379
  impl ClickHouseDialect {
371
380
  fn transform_function(&self, f: Function) -> Result<Expression> {
372
381
  let name_upper = f.name.to_uppercase();
@@ -6,6 +6,7 @@
6
6
  use super::{DialectImpl, DialectType};
7
7
  use crate::error::Result;
8
8
  use crate::expressions::{AggFunc, Case, Cast, Expression, Function, VarArgFunc};
9
+ #[cfg(feature = "generate")]
9
10
  use crate::generator::GeneratorConfig;
10
11
  use crate::tokens::TokenizerConfig;
11
12
 
@@ -26,6 +27,8 @@ impl DialectImpl for CockroachDBDialect {
26
27
  config
27
28
  }
28
29
 
30
+ #[cfg(feature = "generate")]
31
+
29
32
  fn generator_config(&self) -> GeneratorConfig {
30
33
  use crate::generator::IdentifierQuoteStyle;
31
34
  GeneratorConfig {
@@ -36,6 +39,8 @@ impl DialectImpl for CockroachDBDialect {
36
39
  }
37
40
  }
38
41
 
42
+ #[cfg(feature = "transpile")]
43
+
39
44
  fn transform_expr(&self, expr: Expression) -> Result<Expression> {
40
45
  match expr {
41
46
  // IFNULL -> COALESCE in CockroachDB
@@ -110,6 +115,7 @@ impl DialectImpl for CockroachDBDialect {
110
115
  }
111
116
  }
112
117
 
118
+ #[cfg(feature = "transpile")]
113
119
  impl CockroachDBDialect {
114
120
  fn transform_function(&self, f: Function) -> Result<Expression> {
115
121
  let name_upper = f.name.to_uppercase();
@@ -13,6 +13,7 @@ use crate::expressions::{
13
13
  AggregateFunction, Cast, DataType, Expression, Function, JSONExtract, Literal, UnaryFunc,
14
14
  VarArgFunc,
15
15
  };
16
+ #[cfg(feature = "generate")]
16
17
  use crate::generator::GeneratorConfig;
17
18
  use crate::tokens::TokenizerConfig;
18
19
 
@@ -70,6 +71,8 @@ impl DialectImpl for DatabricksDialect {
70
71
  config
71
72
  }
72
73
 
74
+ #[cfg(feature = "generate")]
75
+
73
76
  fn generator_config(&self) -> GeneratorConfig {
74
77
  use crate::generator::IdentifierQuoteStyle;
75
78
  GeneratorConfig {
@@ -86,6 +89,8 @@ impl DialectImpl for DatabricksDialect {
86
89
  }
87
90
  }
88
91
 
92
+ #[cfg(feature = "transpile")]
93
+
89
94
  fn transform_expr(&self, expr: Expression) -> Result<Expression> {
90
95
  match expr {
91
96
  // IFNULL -> COALESCE in Databricks
@@ -182,6 +187,7 @@ impl DialectImpl for DatabricksDialect {
182
187
  }
183
188
  }
184
189
 
190
+ #[cfg(feature = "transpile")]
185
191
  impl DatabricksDialect {
186
192
  fn transform_function(&self, f: Function) -> Result<Expression> {
187
193
  let name_upper = f.name.to_uppercase();
@@ -20,6 +20,7 @@
20
20
  use super::{DialectImpl, DialectType};
21
21
  use crate::error::Result;
22
22
  use crate::expressions::{Expression, Function};
23
+ #[cfg(feature = "generate")]
23
24
  use crate::generator::GeneratorConfig;
24
25
  use crate::tokens::TokenizerConfig;
25
26
 
@@ -40,6 +41,8 @@ impl DialectImpl for DataFusionDialect {
40
41
  config
41
42
  }
42
43
 
44
+ #[cfg(feature = "generate")]
45
+
43
46
  fn generator_config(&self) -> GeneratorConfig {
44
47
  use crate::generator::{IdentifierQuoteStyle, LimitFetchStyle, NormalizeFunctions};
45
48
  GeneratorConfig {
@@ -86,6 +89,8 @@ impl DialectImpl for DataFusionDialect {
86
89
  }
87
90
  }
88
91
 
92
+ #[cfg(feature = "transpile")]
93
+
89
94
  fn transform_expr(&self, expr: Expression) -> Result<Expression> {
90
95
  match expr {
91
96
  // Function transformations
@@ -100,6 +105,7 @@ impl DialectImpl for DataFusionDialect {
100
105
  }
101
106
  }
102
107
 
108
+ #[cfg(feature = "transpile")]
103
109
  impl DataFusionDialect {
104
110
  fn transform_function(&self, f: Function) -> Result<Expression> {
105
111
  let name_upper = f.name.to_uppercase();
@@ -8,6 +8,7 @@ use crate::error::Result;
8
8
  use crate::expressions::{
9
9
  AggFunc, Case, Cast, Expression, Function, Interval, IntervalUnit, IntervalUnitSpec, VarArgFunc,
10
10
  };
11
+ #[cfg(feature = "generate")]
11
12
  use crate::generator::GeneratorConfig;
12
13
  use crate::tokens::TokenizerConfig;
13
14
 
@@ -27,6 +28,8 @@ impl DialectImpl for DorisDialect {
27
28
  config
28
29
  }
29
30
 
31
+ #[cfg(feature = "generate")]
32
+
30
33
  fn generator_config(&self) -> GeneratorConfig {
31
34
  use crate::generator::IdentifierQuoteStyle;
32
35
  GeneratorConfig {
@@ -41,6 +44,8 @@ impl DialectImpl for DorisDialect {
41
44
  }
42
45
  }
43
46
 
47
+ #[cfg(feature = "transpile")]
48
+
44
49
  fn transform_expr(&self, expr: Expression) -> Result<Expression> {
45
50
  match expr {
46
51
  // IFNULL is native in Doris (MySQL-style)
@@ -107,6 +112,7 @@ impl DialectImpl for DorisDialect {
107
112
  }
108
113
  }
109
114
 
115
+ #[cfg(feature = "transpile")]
110
116
  impl DorisDialect {
111
117
  fn wrap_day_interval(expr: Expression) -> Expression {
112
118
  Expression::Interval(Box::new(Interval {
@@ -15,6 +15,7 @@
15
15
  use super::{DialectImpl, DialectType};
16
16
  use crate::error::Result;
17
17
  use crate::expressions::{Expression, Function};
18
+ #[cfg(feature = "generate")]
18
19
  use crate::generator::GeneratorConfig;
19
20
  use crate::tokens::TokenizerConfig;
20
21
 
@@ -35,6 +36,8 @@ impl DialectImpl for DremioDialect {
35
36
  config
36
37
  }
37
38
 
39
+ #[cfg(feature = "generate")]
40
+
38
41
  fn generator_config(&self) -> GeneratorConfig {
39
42
  use crate::generator::IdentifierQuoteStyle;
40
43
  GeneratorConfig {
@@ -53,6 +56,8 @@ impl DialectImpl for DremioDialect {
53
56
  }
54
57
  }
55
58
 
59
+ #[cfg(feature = "transpile")]
60
+
56
61
  fn transform_expr(&self, expr: Expression) -> Result<Expression> {
57
62
  match expr {
58
63
  // Generic function transformations
@@ -67,6 +72,7 @@ impl DialectImpl for DremioDialect {
67
72
  }
68
73
  }
69
74
 
75
+ #[cfg(feature = "transpile")]
70
76
  impl DremioDialect {
71
77
  fn transform_function(&self, f: Function) -> Result<Expression> {
72
78
  let name_upper = f.name.to_uppercase();
@@ -15,6 +15,7 @@
15
15
  use super::{DialectImpl, DialectType};
16
16
  use crate::error::Result;
17
17
  use crate::expressions::{Expression, Function};
18
+ #[cfg(feature = "generate")]
18
19
  use crate::generator::{GeneratorConfig, NormalizeFunctions};
19
20
  use crate::tokens::TokenizerConfig;
20
21
 
@@ -33,6 +34,8 @@ impl DialectImpl for DrillDialect {
33
34
  config
34
35
  }
35
36
 
37
+ #[cfg(feature = "generate")]
38
+
36
39
  fn generator_config(&self) -> GeneratorConfig {
37
40
  use crate::generator::IdentifierQuoteStyle;
38
41
  GeneratorConfig {
@@ -45,6 +48,8 @@ impl DialectImpl for DrillDialect {
45
48
  }
46
49
  }
47
50
 
51
+ #[cfg(feature = "transpile")]
52
+
48
53
  fn transform_expr(&self, expr: Expression) -> Result<Expression> {
49
54
  match expr {
50
55
  // TRY_CAST → CAST in Drill (no TRY_CAST support)
@@ -89,6 +94,7 @@ impl DialectImpl for DrillDialect {
89
94
  }
90
95
  }
91
96
 
97
+ #[cfg(feature = "transpile")]
92
98
  impl DrillDialect {
93
99
  fn transform_function(&self, f: Function) -> Result<Expression> {
94
100
  let name_upper = f.name.to_uppercase();
@@ -12,6 +12,7 @@
12
12
  use super::{DialectImpl, DialectType};
13
13
  use crate::error::Result;
14
14
  use crate::expressions::{Expression, Function};
15
+ #[cfg(feature = "generate")]
15
16
  use crate::generator::GeneratorConfig;
16
17
  use crate::tokens::TokenizerConfig;
17
18
 
@@ -30,6 +31,8 @@ impl DialectImpl for DruidDialect {
30
31
  config
31
32
  }
32
33
 
34
+ #[cfg(feature = "generate")]
35
+
33
36
  fn generator_config(&self) -> GeneratorConfig {
34
37
  use crate::generator::IdentifierQuoteStyle;
35
38
  GeneratorConfig {
@@ -40,6 +43,8 @@ impl DialectImpl for DruidDialect {
40
43
  }
41
44
  }
42
45
 
46
+ #[cfg(feature = "transpile")]
47
+
43
48
  fn transform_expr(&self, expr: Expression) -> Result<Expression> {
44
49
  match expr {
45
50
  // CurrentTimestamp without args in Druid
@@ -65,6 +70,7 @@ impl DialectImpl for DruidDialect {
65
70
  }
66
71
  }
67
72
 
73
+ #[cfg(feature = "transpile")]
68
74
  impl DruidDialect {
69
75
  fn transform_function(&self, f: Function) -> Result<Expression> {
70
76
  let name_upper = f.name.to_uppercase();
@@ -17,6 +17,7 @@ use crate::expressions::{
17
17
  JSONPathRoot, JSONPathSubscript, JsonExtractFunc, Literal, Null, Paren, Struct, Subquery,
18
18
  SubstringFunc, UnaryFunc, UnaryOp, VarArgFunc, WindowFunction,
19
19
  };
20
+ #[cfg(feature = "generate")]
20
21
  use crate::generator::GeneratorConfig;
21
22
  use crate::tokens::TokenizerConfig;
22
23
 
@@ -103,6 +104,8 @@ impl DialectImpl for DuckDBDialect {
103
104
  config
104
105
  }
105
106
 
107
+ #[cfg(feature = "generate")]
108
+
106
109
  fn generator_config(&self) -> GeneratorConfig {
107
110
  use crate::generator::IdentifierQuoteStyle;
108
111
  GeneratorConfig {
@@ -149,6 +152,8 @@ impl DialectImpl for DuckDBDialect {
149
152
  }
150
153
  }
151
154
 
155
+ #[cfg(feature = "transpile")]
156
+
152
157
  fn transform_expr(&self, expr: Expression) -> Result<Expression> {
153
158
  match expr {
154
159
  // ===== Data Type Mappings =====
@@ -1360,6 +1365,7 @@ impl DialectImpl for DuckDBDialect {
1360
1365
  }
1361
1366
  }
1362
1367
 
1368
+ #[cfg(feature = "transpile")]
1363
1369
  impl DuckDBDialect {
1364
1370
  /// Extract a numeric value from a literal expression, if possible
1365
1371
  fn extract_number_value(expr: &Expression) -> Option<f64> {
@@ -11,6 +11,7 @@
11
11
  use super::{DialectImpl, DialectType, TrinoDialect};
12
12
  use crate::error::Result;
13
13
  use crate::expressions::Expression;
14
+ #[cfg(feature = "generate")]
14
15
  use crate::generator::GeneratorConfig;
15
16
  use crate::tokens::TokenizerConfig;
16
17
 
@@ -30,6 +31,8 @@ impl DialectImpl for DuneDialect {
30
31
  trino.tokenizer_config()
31
32
  }
32
33
 
34
+ #[cfg(feature = "generate")]
35
+
33
36
  fn generator_config(&self) -> GeneratorConfig {
34
37
  use crate::generator::IdentifierQuoteStyle;
35
38
  // Inherit from Trino with Dune dialect type
@@ -41,6 +44,8 @@ impl DialectImpl for DuneDialect {
41
44
  }
42
45
  }
43
46
 
47
+ #[cfg(feature = "transpile")]
48
+
44
49
  fn transform_expr(&self, expr: Expression) -> Result<Expression> {
45
50
  // Delegate to Trino for most transformations
46
51
  let trino = TrinoDialect;