polyglot-sql-chio 0.13.2__tar.gz → 0.13.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.
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/Cargo.lock +6 -6
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/Cargo.toml +1 -1
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/PKG-INFO +1 -1
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/Cargo.toml +2 -2
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/README.md +4 -4
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/ast_mutation.rs +2 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/athena.rs +3 -1
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/bigquery.rs +2 -1
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/clickhouse.rs +0 -2
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/hive.rs +2 -1
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/mod.rs +39 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/mysql.rs +2 -1
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/normalization/mod.rs +19 -6
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/normalization/operators.rs +1 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/normalization/scalar.rs +2 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/oracle.rs +2 -1
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/presto.rs +3 -1
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/snowflake.rs +2 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/sqlite.rs +4 -1
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/trino.rs +3 -1
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/tsql.rs +2 -1
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/expressions.rs +6 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/function_registry.rs +16 -1
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/generator.rs +49 -23
- polyglot_sql_chio-0.13.4/crates/polyglot-sql/src/optimizer/annotate_types/engine.rs +1194 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/optimizer/annotate_types.rs +65 -15
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/optimizer/set_operation_types.rs +1 -1
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/parser.rs +55 -42
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/transforms.rs +27 -13
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/traversal.rs +1 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/validation/coercion.rs +9 -0
- polyglot_sql_chio-0.13.4/crates/polyglot-sql/tests/engine_type_truth.rs +292 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/fabric_regression.rs +1 -1
- polyglot_sql_chio-0.13.4/crates/polyglot-sql/tests/fixtures/engine_types/duckdb.json +2877 -0
- polyglot_sql_chio-0.13.4/crates/polyglot-sql/tests/fixtures/engine_types/postgres.json +1362 -0
- polyglot_sql_chio-0.13.4/crates/polyglot-sql/tests/prefix_not_regression.rs +469 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/query_analysis.rs +1 -1
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/transform_regression.rs +1 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/tsql_regression.rs +1 -1
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-function-catalogs/README.md +1 -1
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-function-catalogs/src/duckdb.rs +11 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/README.md +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/benches/allocation_hotspots.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/benches/ast_traversal.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/benches/in_list.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/benches/lineage.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/benches/parsing.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/benches/performance_hotspots.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/benches/rust_parsing.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/benches/transpile.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/examples/basic_usage.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/examples/bench_json.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/examples/validate_batch.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/ast_children.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/ast_json.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/ast_transforms.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/binding.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/builder/mod.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/builder/plan.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/cockroachdb.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/databricks.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/datafusion.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/doris.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/dremio.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/drill.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/druid.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/duckdb.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/dune.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/exasol.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/fabric.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/generic.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/materialize.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/normalization/aggregates.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/normalization/collections.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/normalization/json.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/normalization/postgres_interval.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/normalization/statements.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/normalization/temporal.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/normalization/types.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/postgres.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/redshift.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/risingwave.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/singlestore.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/solr.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/spark.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/starrocks.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/tableau.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/teradata.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/tidb.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/diff.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/error.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/format_tokens.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/function_catalog.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/guard.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/helper.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/lib.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/lineage.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/openlineage.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/optimizer/canonicalize.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/optimizer/eliminate_ctes.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/optimizer/eliminate_joins.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/optimizer/isolate_table_selects.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/optimizer/mod.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/optimizer/normalize.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/optimizer/normalize_identifiers.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/optimizer/optimize_joins.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/optimizer/optimizer.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/optimizer/pushdown_predicates.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/optimizer/pushdown_projections.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/optimizer/qualify_columns.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/optimizer/qualify_tables.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/optimizer/simplify.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/optimizer/subquery.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/planner.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/query_analysis/column_uses.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/query_analysis.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/resolver.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/schema.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/scope.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/set_operation.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/time.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/tokens.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/trie.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/validation/expressions.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/validation/semantics.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/validation/signatures.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/validation/snowflake_setops.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/validation/tests.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/validation.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/analyze_failures.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/clickhouse_regression.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/common/known_failures.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/common/mod.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/common/test_data.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/common/test_runner.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/create_view_security_comment_regression.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/custom_clickhouse_coverage.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/custom_clickhouse_parser.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/custom_dialect.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/custom_dialect_tests.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/custom_fixtures/datafusion/ddl.json +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/custom_fixtures/datafusion/dml.json +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/custom_fixtures/datafusion/functions.json +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/custom_fixtures/datafusion/identity.json +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/custom_fixtures/datafusion/operators.json +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/custom_fixtures/datafusion/select.json +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/custom_fixtures/datafusion/transpilation.json +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/custom_fixtures/datafusion/types.json +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/data_type_api.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/deep_nesting_regression.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/dialect_matrix.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/error_handling.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/fabric_tpch_regression.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/fixtures/snowflake_semantic_truth.json +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/fixtures/snowflake_set_operation_chains.json +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/fixtures/snowflake_set_operation_matrix.txt +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/fixtures/snowflake_set_operation_results.txt +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/identity_roundtrip.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/oracle_data_types_regression.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/postgres_explain_options.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/postgres_regexp_clickhouse.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/postgres_sqlite_regression.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/qualify_tables.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/query_analysis_regression.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/snowflake_regression_test.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/sqlglot_compat.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/sqlglot_dialect_identity.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/sqlglot_identity.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/sqlglot_identity_detailed.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/sqlglot_parser.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/sqlglot_pretty.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/sqlglot_transpilation.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/sqlglot_transpile.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/tests/tpch_transpile_stack.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-ast-derive/Cargo.toml +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-ast-derive/src/lib.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-function-catalogs/Cargo.toml +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-function-catalogs/src/clickhouse.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-function-catalogs/src/lib.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-function-catalogs/src/types.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-function-catalogs/tools/clickhouse/extract_functions.py +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-function-catalogs/tools/duckdb/extract_functions.py +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/Cargo.toml +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/README.md +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/docs/api.md +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/docs/index.md +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/mkdocs.yml +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/src/annotate_types.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/src/builders.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/src/dialects.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/src/diff.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/src/errors.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/src/expr.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/src/expr_types.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/src/format.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/src/generate.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/src/helpers.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/src/lib.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/src/lineage.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/src/openlineage.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/src/optimize.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/src/parse.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/src/query_analysis.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/src/tokenize.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/src/transforms.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/src/transpile.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/src/types.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/src/validate.rs +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/tests/conftest.py +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/tests/test_builders.py +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/tests/test_compat.py +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/tests/test_dialects.py +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/tests/test_diff.py +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/tests/test_expression.py +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/tests/test_format.py +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/tests/test_generate.py +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/tests/test_lineage.py +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/tests/test_optimize.py +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/tests/test_parse.py +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/tests/test_query_analysis.py +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/tests/test_transforms.py +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/tests/test_transpile.py +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/tests/test_validate.py +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql-python/uv.lock +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/pyproject.toml +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/python/polyglot_sql/__init__.py +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/python/polyglot_sql/__init__.pyi +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/python/polyglot_sql/analysis_types.py +0 -0
- {polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/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.13.
|
|
608
|
+
version = "0.13.4"
|
|
609
609
|
dependencies = [
|
|
610
610
|
"criterion",
|
|
611
611
|
"once_cell",
|
|
@@ -624,7 +624,7 @@ dependencies = [
|
|
|
624
624
|
|
|
625
625
|
[[package]]
|
|
626
626
|
name = "polyglot-sql-ast-derive"
|
|
627
|
-
version = "0.13.
|
|
627
|
+
version = "0.13.4"
|
|
628
628
|
dependencies = [
|
|
629
629
|
"proc-macro2",
|
|
630
630
|
"quote",
|
|
@@ -633,7 +633,7 @@ dependencies = [
|
|
|
633
633
|
|
|
634
634
|
[[package]]
|
|
635
635
|
name = "polyglot-sql-ffi"
|
|
636
|
-
version = "0.13.
|
|
636
|
+
version = "0.13.4"
|
|
637
637
|
dependencies = [
|
|
638
638
|
"cbindgen",
|
|
639
639
|
"polyglot-sql",
|
|
@@ -643,11 +643,11 @@ dependencies = [
|
|
|
643
643
|
|
|
644
644
|
[[package]]
|
|
645
645
|
name = "polyglot-sql-function-catalogs"
|
|
646
|
-
version = "0.13.
|
|
646
|
+
version = "0.13.4"
|
|
647
647
|
|
|
648
648
|
[[package]]
|
|
649
649
|
name = "polyglot-sql-python"
|
|
650
|
-
version = "0.13.
|
|
650
|
+
version = "0.13.4"
|
|
651
651
|
dependencies = [
|
|
652
652
|
"polyglot-sql",
|
|
653
653
|
"pyo3",
|
|
@@ -658,7 +658,7 @@ dependencies = [
|
|
|
658
658
|
|
|
659
659
|
[[package]]
|
|
660
660
|
name = "polyglot-sql-wasm"
|
|
661
|
-
version = "0.13.
|
|
661
|
+
version = "0.13.4"
|
|
662
662
|
dependencies = [
|
|
663
663
|
"console_error_panic_hook",
|
|
664
664
|
"js-sys",
|
|
@@ -101,14 +101,14 @@ function-catalog-all-dialects = [
|
|
|
101
101
|
|
|
102
102
|
[dependencies]
|
|
103
103
|
regex = { version = "1", optional = true }
|
|
104
|
-
polyglot-sql-ast-derive = { path = "../polyglot-sql-ast-derive", version = "0.13.
|
|
104
|
+
polyglot-sql-ast-derive = { path = "../polyglot-sql-ast-derive", version = "0.13.4" }
|
|
105
105
|
serde = { workspace = true }
|
|
106
106
|
serde_json = { workspace = true }
|
|
107
107
|
thiserror = { workspace = true }
|
|
108
108
|
unicode-segmentation = { workspace = true }
|
|
109
109
|
stacker = { version = "0.1", optional = true }
|
|
110
110
|
ts-rs = { version = "12.0", features = ["serde-compat"], optional = true }
|
|
111
|
-
polyglot-sql-function-catalogs = { path = "../polyglot-sql-function-catalogs", version = "0.13.
|
|
111
|
+
polyglot-sql-function-catalogs = { path = "../polyglot-sql-function-catalogs", version = "0.13.4", optional = true, default-features = false }
|
|
112
112
|
|
|
113
113
|
[dev-dependencies]
|
|
114
114
|
pretty_assertions = "1.4"
|
|
@@ -25,12 +25,12 @@ By default, `polyglot-sql` enables the full public API. Parser-only consumers ca
|
|
|
25
25
|
disable default features and opt into only the dialect parsers they need:
|
|
26
26
|
|
|
27
27
|
```toml
|
|
28
|
-
polyglot-sql = { version = "0.13.
|
|
28
|
+
polyglot-sql = { version = "0.13.4", default-features = false }
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
```toml
|
|
32
32
|
polyglot-sql = {
|
|
33
|
-
version = "0.13.
|
|
33
|
+
version = "0.13.4",
|
|
34
34
|
default-features = false,
|
|
35
35
|
features = ["dialect-clickhouse"],
|
|
36
36
|
}
|
|
@@ -44,14 +44,14 @@ Examples:
|
|
|
44
44
|
```toml
|
|
45
45
|
# Parse and generate SQL for one dialect.
|
|
46
46
|
polyglot-sql = {
|
|
47
|
-
version = "0.13.
|
|
47
|
+
version = "0.13.4",
|
|
48
48
|
default-features = false,
|
|
49
49
|
features = ["generate", "dialect-clickhouse"],
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
# Cross-dialect transpilation.
|
|
53
53
|
polyglot-sql = {
|
|
54
|
-
version = "0.13.
|
|
54
|
+
version = "0.13.4",
|
|
55
55
|
default-features = false,
|
|
56
56
|
features = ["transpile", "dialect-clickhouse", "dialect-postgresql"],
|
|
57
57
|
}
|
{polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/ast_mutation.rs
RENAMED
|
@@ -77,6 +77,7 @@ pub(crate) fn binary(kind: BinaryKind, left: Expression, right: Expression) -> E
|
|
|
77
77
|
BinaryKind::Div => Expression::Div(Box::new(operation)),
|
|
78
78
|
BinaryKind::Mod => Expression::Mod(Box::new(operation)),
|
|
79
79
|
BinaryKind::Like => Expression::Like(Box::new(LikeOp {
|
|
80
|
+
negated: false,
|
|
80
81
|
left: operation.left,
|
|
81
82
|
right: operation.right,
|
|
82
83
|
escape: None,
|
|
@@ -84,6 +85,7 @@ pub(crate) fn binary(kind: BinaryKind, left: Expression, right: Expression) -> E
|
|
|
84
85
|
inferred_type: None,
|
|
85
86
|
})),
|
|
86
87
|
BinaryKind::ILike => Expression::ILike(Box::new(LikeOp {
|
|
88
|
+
negated: false,
|
|
87
89
|
left: operation.left,
|
|
88
90
|
right: operation.right,
|
|
89
91
|
escape: None,
|
{polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/athena.rs
RENAMED
|
@@ -107,8 +107,10 @@ impl DialectImpl for AthenaDialect {
|
|
|
107
107
|
// ILike -> LOWER() LIKE LOWER() (Trino doesn't support ILIKE)
|
|
108
108
|
Expression::ILike(op) => {
|
|
109
109
|
let lower_left = Expression::Lower(Box::new(UnaryFunc::new(op.left.clone())));
|
|
110
|
-
let lower_right =
|
|
110
|
+
let lower_right =
|
|
111
|
+
super::lower_like_pattern(op.right.clone(), op.quantifier.is_some());
|
|
111
112
|
Ok(Expression::Like(Box::new(LikeOp {
|
|
113
|
+
negated: op.negated,
|
|
112
114
|
left: lower_left,
|
|
113
115
|
right: lower_right,
|
|
114
116
|
escape: op.escape,
|
{polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/bigquery.rs
RENAMED
|
@@ -172,8 +172,9 @@ impl DialectImpl for BigQueryDialect {
|
|
|
172
172
|
// ILIKE -> LOWER() LIKE LOWER() in BigQuery (no ILIKE support)
|
|
173
173
|
Expression::ILike(op) => {
|
|
174
174
|
let lower_left = Expression::Lower(Box::new(UnaryFunc::new(op.left)));
|
|
175
|
-
let lower_right =
|
|
175
|
+
let lower_right = super::lower_like_pattern(op.right, op.quantifier.is_some());
|
|
176
176
|
Ok(Expression::Like(Box::new(LikeOp {
|
|
177
|
+
negated: op.negated,
|
|
177
178
|
left: lower_left,
|
|
178
179
|
right: lower_right,
|
|
179
180
|
escape: op.escape,
|
{polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/clickhouse.rs
RENAMED
|
@@ -119,8 +119,6 @@ impl DialectImpl for ClickHouseDialect {
|
|
|
119
119
|
| Expression::IsTrue(_)
|
|
120
120
|
| Expression::IsFalse(_)
|
|
121
121
|
| Expression::IsJson(_)
|
|
122
|
-
| Expression::Like(_)
|
|
123
|
-
| Expression::ILike(_)
|
|
124
122
|
| Expression::SimilarTo(_)
|
|
125
123
|
| Expression::Glob(_)
|
|
126
124
|
| Expression::RegexpLike(_)
|
{polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/hive.rs
RENAMED
|
@@ -120,8 +120,9 @@ impl DialectImpl for HiveDialect {
|
|
|
120
120
|
// ILIKE -> LOWER() LIKE LOWER() in Hive (no ILIKE support)
|
|
121
121
|
Expression::ILike(op) => {
|
|
122
122
|
let lower_left = Expression::Lower(Box::new(UnaryFunc::new(op.left)));
|
|
123
|
-
let lower_right =
|
|
123
|
+
let lower_right = super::lower_like_pattern(op.right, op.quantifier.is_some());
|
|
124
124
|
Ok(Expression::Like(Box::new(LikeOp {
|
|
125
|
+
negated: op.negated,
|
|
125
126
|
left: lower_left,
|
|
126
127
|
right: lower_right,
|
|
127
128
|
escape: op.escape,
|
{polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/mod.rs
RENAMED
|
@@ -631,6 +631,45 @@ fn is_default_presto_date_format(fmt: &str) -> bool {
|
|
|
631
631
|
fmt == "%Y-%m-%d" || fmt == "%F"
|
|
632
632
|
}
|
|
633
633
|
|
|
634
|
+
/// Lower each literal quantified pattern, not its containing tuple/array.
|
|
635
|
+
#[cfg(feature = "transpile")]
|
|
636
|
+
pub(crate) fn lower_like_pattern(pattern: Expression, quantified: bool) -> Expression {
|
|
637
|
+
if quantified {
|
|
638
|
+
match pattern {
|
|
639
|
+
Expression::Paren(mut paren) => {
|
|
640
|
+
paren.this = lower_like_pattern(paren.this, true);
|
|
641
|
+
return Expression::Paren(paren);
|
|
642
|
+
}
|
|
643
|
+
Expression::Tuple(mut tuple) => {
|
|
644
|
+
tuple.expressions = tuple
|
|
645
|
+
.expressions
|
|
646
|
+
.into_iter()
|
|
647
|
+
.map(|value| lower_like_pattern(value, false))
|
|
648
|
+
.collect();
|
|
649
|
+
return Expression::Tuple(tuple);
|
|
650
|
+
}
|
|
651
|
+
Expression::Array(mut array) => {
|
|
652
|
+
array.expressions = array
|
|
653
|
+
.expressions
|
|
654
|
+
.into_iter()
|
|
655
|
+
.map(|value| lower_like_pattern(value, false))
|
|
656
|
+
.collect();
|
|
657
|
+
return Expression::Array(array);
|
|
658
|
+
}
|
|
659
|
+
Expression::ArrayFunc(mut array) => {
|
|
660
|
+
array.expressions = array
|
|
661
|
+
.expressions
|
|
662
|
+
.into_iter()
|
|
663
|
+
.map(|value| lower_like_pattern(value, false))
|
|
664
|
+
.collect();
|
|
665
|
+
return Expression::ArrayFunc(array);
|
|
666
|
+
}
|
|
667
|
+
other => return lower_like_pattern(other, false),
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
Expression::Lower(Box::new(crate::expressions::UnaryFunc::new(pattern)))
|
|
671
|
+
}
|
|
672
|
+
|
|
634
673
|
/// Applies a transform function bottom-up through an entire expression tree.
|
|
635
674
|
///
|
|
636
675
|
/// The public entrypoint uses an explicit task stack for the recursion-heavy shapes
|
{polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/mysql.rs
RENAMED
|
@@ -162,8 +162,9 @@ impl DialectImpl for MySQLDialect {
|
|
|
162
162
|
Expression::ILike(op) => {
|
|
163
163
|
// Transform ILIKE to: LOWER(left) LIKE LOWER(right)
|
|
164
164
|
let lower_left = Expression::Lower(Box::new(UnaryFunc::new(op.left)));
|
|
165
|
-
let lower_right =
|
|
165
|
+
let lower_right = super::lower_like_pattern(op.right, op.quantifier.is_some());
|
|
166
166
|
Ok(Expression::Like(Box::new(LikeOp {
|
|
167
|
+
negated: op.negated,
|
|
167
168
|
left: lower_left,
|
|
168
169
|
right: lower_right,
|
|
169
170
|
escape: op.escape,
|
|
@@ -152,10 +152,18 @@ pub(super) fn normalize(
|
|
|
152
152
|
|
|
153
153
|
if matches!(source, DialectType::Generic) && matches!(target, DialectType::Drill) {
|
|
154
154
|
if let Expression::ILike(ref like) = e {
|
|
155
|
-
|
|
155
|
+
if like.quantifier.is_some() {
|
|
156
|
+
return Ok(e);
|
|
157
|
+
}
|
|
158
|
+
let function = Expression::Function(Box::new(Function::new(
|
|
156
159
|
"ILIKE".to_string(),
|
|
157
160
|
vec![like.left.clone(), like.right.clone()],
|
|
158
|
-
)))
|
|
161
|
+
)));
|
|
162
|
+
return Ok(if like.negated {
|
|
163
|
+
Expression::Not(Box::new(crate::expressions::UnaryOp::new(function)))
|
|
164
|
+
} else {
|
|
165
|
+
function
|
|
166
|
+
});
|
|
159
167
|
}
|
|
160
168
|
}
|
|
161
169
|
|
|
@@ -3977,11 +3985,16 @@ pub(super) fn normalize(
|
|
|
3977
3985
|
"LOWER".to_string(),
|
|
3978
3986
|
vec![like.left],
|
|
3979
3987
|
)));
|
|
3980
|
-
let lower_right =
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3988
|
+
let lower_right = if like.quantifier.is_some() {
|
|
3989
|
+
super::lower_like_pattern(like.right, true)
|
|
3990
|
+
} else {
|
|
3991
|
+
Expression::Function(Box::new(Function::new(
|
|
3992
|
+
"LOWER".to_string(),
|
|
3993
|
+
vec![like.right],
|
|
3994
|
+
)))
|
|
3995
|
+
};
|
|
3984
3996
|
return Ok(Expression::Like(Box::new(crate::expressions::LikeOp {
|
|
3997
|
+
negated: like.negated,
|
|
3985
3998
|
left: lower_left,
|
|
3986
3999
|
right: lower_right,
|
|
3987
4000
|
escape: like.escape,
|
|
@@ -3080,6 +3080,7 @@ pub(super) fn rewrite(
|
|
|
3080
3080
|
None
|
|
3081
3081
|
};
|
|
3082
3082
|
Ok(Expression::Like(Box::new(crate::expressions::LikeOp {
|
|
3083
|
+
negated: false,
|
|
3083
3084
|
left: this,
|
|
3084
3085
|
right: pattern,
|
|
3085
3086
|
escape,
|
|
@@ -3097,6 +3098,7 @@ pub(super) fn rewrite(
|
|
|
3097
3098
|
None
|
|
3098
3099
|
};
|
|
3099
3100
|
Ok(Expression::ILike(Box::new(crate::expressions::LikeOp {
|
|
3101
|
+
negated: false,
|
|
3100
3102
|
left: this,
|
|
3101
3103
|
right: pattern,
|
|
3102
3104
|
escape,
|
{polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/oracle.rs
RENAMED
|
@@ -92,8 +92,9 @@ impl DialectImpl for OracleDialect {
|
|
|
92
92
|
// ILIKE -> LOWER() LIKE LOWER() in Oracle (no ILIKE support)
|
|
93
93
|
Expression::ILike(op) => {
|
|
94
94
|
let lower_left = Expression::Lower(Box::new(UnaryFunc::new(op.left)));
|
|
95
|
-
let lower_right =
|
|
95
|
+
let lower_right = super::lower_like_pattern(op.right, op.quantifier.is_some());
|
|
96
96
|
Ok(Expression::Like(Box::new(LikeOp {
|
|
97
|
+
negated: op.negated,
|
|
97
98
|
left: lower_left,
|
|
98
99
|
right: lower_right,
|
|
99
100
|
escape: op.escape,
|
{polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/presto.rs
RENAMED
|
@@ -74,8 +74,10 @@ impl DialectImpl for PrestoDialect {
|
|
|
74
74
|
// ILike -> LOWER() LIKE LOWER() (Presto doesn't support ILIKE)
|
|
75
75
|
Expression::ILike(op) => {
|
|
76
76
|
let lower_left = Expression::Lower(Box::new(UnaryFunc::new(op.left.clone())));
|
|
77
|
-
let lower_right =
|
|
77
|
+
let lower_right =
|
|
78
|
+
super::lower_like_pattern(op.right.clone(), op.quantifier.is_some());
|
|
78
79
|
Ok(Expression::Like(Box::new(LikeOp {
|
|
80
|
+
negated: op.negated,
|
|
79
81
|
left: lower_left,
|
|
80
82
|
right: lower_right,
|
|
81
83
|
escape: op.escape,
|
{polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/snowflake.rs
RENAMED
|
@@ -2432,6 +2432,7 @@ impl SnowflakeDialect {
|
|
|
2432
2432
|
let right = args.next().unwrap();
|
|
2433
2433
|
let escape = args.next();
|
|
2434
2434
|
Ok(Expression::Like(Box::new(crate::expressions::LikeOp {
|
|
2435
|
+
negated: false,
|
|
2435
2436
|
left,
|
|
2436
2437
|
right,
|
|
2437
2438
|
escape,
|
|
@@ -2447,6 +2448,7 @@ impl SnowflakeDialect {
|
|
|
2447
2448
|
let right = args.next().unwrap();
|
|
2448
2449
|
let escape = args.next();
|
|
2449
2450
|
Ok(Expression::ILike(Box::new(crate::expressions::LikeOp {
|
|
2451
|
+
negated: false,
|
|
2450
2452
|
left,
|
|
2451
2453
|
right,
|
|
2452
2454
|
escape,
|
{polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/sqlite.rs
RENAMED
|
@@ -82,8 +82,10 @@ impl DialectImpl for SQLiteDialect {
|
|
|
82
82
|
// ILike -> LOWER() LIKE LOWER() (SQLite doesn't support ILIKE)
|
|
83
83
|
Expression::ILike(op) => {
|
|
84
84
|
let lower_left = Expression::Lower(Box::new(UnaryFunc::new(op.left.clone())));
|
|
85
|
-
let lower_right =
|
|
85
|
+
let lower_right =
|
|
86
|
+
super::lower_like_pattern(op.right.clone(), op.quantifier.is_some());
|
|
86
87
|
Ok(Expression::Like(Box::new(LikeOp {
|
|
88
|
+
negated: op.negated,
|
|
87
89
|
left: lower_left,
|
|
88
90
|
right: lower_right,
|
|
89
91
|
escape: op.escape,
|
|
@@ -375,6 +377,7 @@ impl SQLiteDialect {
|
|
|
375
377
|
let escape = args.remove(0);
|
|
376
378
|
Ok(Expression::Like(Box::new(LikeOp {
|
|
377
379
|
left: string,
|
|
380
|
+
negated: false,
|
|
378
381
|
right: pattern,
|
|
379
382
|
escape: Some(escape),
|
|
380
383
|
quantifier: None,
|
{polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/trino.rs
RENAMED
|
@@ -80,8 +80,10 @@ impl DialectImpl for TrinoDialect {
|
|
|
80
80
|
// ILike -> LOWER() LIKE LOWER() (Trino doesn't support ILIKE)
|
|
81
81
|
Expression::ILike(op) => {
|
|
82
82
|
let lower_left = Expression::Lower(Box::new(UnaryFunc::new(op.left.clone())));
|
|
83
|
-
let lower_right =
|
|
83
|
+
let lower_right =
|
|
84
|
+
super::lower_like_pattern(op.right.clone(), op.quantifier.is_some());
|
|
84
85
|
Ok(Expression::Like(Box::new(LikeOp {
|
|
86
|
+
negated: op.negated,
|
|
85
87
|
left: lower_left,
|
|
86
88
|
right: lower_right,
|
|
87
89
|
escape: op.escape,
|
{polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/dialects/tsql.rs
RENAMED
|
@@ -343,8 +343,9 @@ impl DialectImpl for TSQLDialect {
|
|
|
343
343
|
// SQL Server is case-insensitive by default based on collation
|
|
344
344
|
// But for explicit case-insensitive matching, use LOWER
|
|
345
345
|
let lower_left = Expression::Lower(Box::new(UnaryFunc::new(op.left)));
|
|
346
|
-
let lower_right =
|
|
346
|
+
let lower_right = super::lower_like_pattern(op.right, op.quantifier.is_some());
|
|
347
347
|
Ok(Expression::Like(Box::new(LikeOp {
|
|
348
|
+
negated: op.negated,
|
|
348
349
|
left: lower_left,
|
|
349
350
|
right: lower_right,
|
|
350
351
|
escape: op.escape,
|
{polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/expressions.rs
RENAMED
|
@@ -4727,6 +4727,10 @@ impl BinaryOp {
|
|
|
4727
4727
|
#[derive(polyglot_sql_ast_derive::AstNode, Debug, Clone, PartialEq, Serialize, Deserialize)]
|
|
4728
4728
|
#[cfg_attr(feature = "bindings", derive(TS))]
|
|
4729
4729
|
pub struct LikeOp {
|
|
4730
|
+
/// Infix NOT LIKE negates each comparison, before ANY/ALL reduction.
|
|
4731
|
+
/// Prefix NOT is represented separately as Expression::Not(Like(...)).
|
|
4732
|
+
#[serde(default, skip_serializing_if = "std::ops::Not::not")]
|
|
4733
|
+
pub negated: bool,
|
|
4730
4734
|
pub left: Expression,
|
|
4731
4735
|
pub right: Expression,
|
|
4732
4736
|
/// ESCAPE character/expression
|
|
@@ -4744,6 +4748,7 @@ pub struct LikeOp {
|
|
|
4744
4748
|
impl LikeOp {
|
|
4745
4749
|
pub fn new(left: Expression, right: Expression) -> Self {
|
|
4746
4750
|
Self {
|
|
4751
|
+
negated: false,
|
|
4747
4752
|
left,
|
|
4748
4753
|
right,
|
|
4749
4754
|
escape: None,
|
|
@@ -4754,6 +4759,7 @@ impl LikeOp {
|
|
|
4754
4759
|
|
|
4755
4760
|
pub fn with_escape(left: Expression, right: Expression, escape: Expression) -> Self {
|
|
4756
4761
|
Self {
|
|
4762
|
+
negated: false,
|
|
4757
4763
|
left,
|
|
4758
4764
|
right,
|
|
4759
4765
|
escape: Some(escape),
|
{polyglot_sql_chio-0.13.2 → polyglot_sql_chio-0.13.4}/crates/polyglot-sql/src/function_registry.rs
RENAMED
|
@@ -40,7 +40,7 @@ pub(crate) const NO_PAREN_FUNCTION_NAME_LIST: &[&str] = &[
|
|
|
40
40
|
"UTC_TIMESTAMP",
|
|
41
41
|
"SESSION_USER",
|
|
42
42
|
"SYSTEM_USER",
|
|
43
|
-
//
|
|
43
|
+
// Bare USER is dialect-specific; see `bare_user_is_function`.
|
|
44
44
|
"PI",
|
|
45
45
|
// MySQL/Databricks CURDATE
|
|
46
46
|
"CURDATE",
|
|
@@ -2224,6 +2224,21 @@ pub(crate) fn is_no_paren_function_name_upper(upper_name: &str) -> bool {
|
|
|
2224
2224
|
NO_PAREN_FUNCTION_NAME_SET.contains(upper_name)
|
|
2225
2225
|
}
|
|
2226
2226
|
|
|
2227
|
+
/// Whether an unquoted, unqualified `USER` is the niladic session-user function.
|
|
2228
|
+
/// Other dialects either require `USER()` or treat `user` as an ordinary name.
|
|
2229
|
+
pub(crate) fn bare_user_is_function(dialect: Option<DialectType>) -> bool {
|
|
2230
|
+
matches!(
|
|
2231
|
+
dialect,
|
|
2232
|
+
Some(
|
|
2233
|
+
DialectType::PostgreSQL
|
|
2234
|
+
| DialectType::Redshift
|
|
2235
|
+
| DialectType::DuckDB
|
|
2236
|
+
| DialectType::TSQL
|
|
2237
|
+
| DialectType::Oracle
|
|
2238
|
+
)
|
|
2239
|
+
)
|
|
2240
|
+
}
|
|
2241
|
+
|
|
2227
2242
|
/// Returns true if the given uppercased name should use aggregate parsing behavior.
|
|
2228
2243
|
pub(crate) fn is_aggregate_function_name_upper(upper_name: &str) -> bool {
|
|
2229
2244
|
AGGREGATE_FUNCTION_NAME_SET.contains(upper_name)
|
|
@@ -3382,11 +3382,7 @@ impl Generator {
|
|
|
3382
3382
|
Expression::JSONBDeleteAtPath(op) => self.generate_binary_op(op, "#-"),
|
|
3383
3383
|
Expression::ExtendsLeft(op) => self.generate_binary_op(op, "&<"),
|
|
3384
3384
|
Expression::ExtendsRight(op) => self.generate_binary_op(op, "&>"),
|
|
3385
|
-
Expression::Not(op) =>
|
|
3386
|
-
Expression::Like(like) => self.generate_like_op_negated(like, "LIKE"),
|
|
3387
|
-
Expression::ILike(like) => self.generate_like_op_negated(like, "ILIKE"),
|
|
3388
|
-
_ => self.generate_unary_op(op, "NOT"),
|
|
3389
|
-
},
|
|
3385
|
+
Expression::Not(op) => self.generate_unary_op(op, "NOT"),
|
|
3390
3386
|
Expression::Neg(op) => self.generate_unary_op(op, "-"),
|
|
3391
3387
|
Expression::BitwiseNot(op) => {
|
|
3392
3388
|
// Presto/Trino use BITWISE_NOT function
|
|
@@ -23869,7 +23865,8 @@ impl Generator {
|
|
|
23869
23865
|
) -> Result<()> {
|
|
23870
23866
|
let wrap_left = infix_operator.is_some_and(|parent| {
|
|
23871
23867
|
Self::infix_operand_needs_parentheses(parent, &op.left, OperandSide::Left)
|
|
23872
|
-
})
|
|
23868
|
+
}) || (matches!(&op.left, Expression::Not(_))
|
|
23869
|
+
&& !matches!(operator, "AND" | "OR" | "XOR"));
|
|
23873
23870
|
if wrap_left {
|
|
23874
23871
|
self.write("(");
|
|
23875
23872
|
}
|
|
@@ -23947,7 +23944,8 @@ impl Generator {
|
|
|
23947
23944
|
self.write_space();
|
|
23948
23945
|
let wrap_right = infix_operator.is_some_and(|parent| {
|
|
23949
23946
|
Self::infix_operand_needs_parentheses(parent, &op.right, OperandSide::Right)
|
|
23950
|
-
})
|
|
23947
|
+
}) || (matches!(&op.right, Expression::Not(_))
|
|
23948
|
+
&& !matches!(operator, "AND" | "OR" | "XOR"));
|
|
23951
23949
|
if wrap_right {
|
|
23952
23950
|
self.write("(");
|
|
23953
23951
|
}
|
|
@@ -24165,28 +24163,41 @@ impl Generator {
|
|
|
24165
24163
|
|
|
24166
24164
|
/// Generate LIKE/ILIKE operation with optional ESCAPE clause
|
|
24167
24165
|
fn generate_like_op(&mut self, op: &LikeOp, operator: &str) -> Result<()> {
|
|
24168
|
-
self.generate_like_op_inner(op, operator,
|
|
24169
|
-
}
|
|
24170
|
-
|
|
24171
|
-
fn generate_like_op_negated(&mut self, op: &LikeOp, operator: &str) -> Result<()> {
|
|
24172
|
-
self.generate_like_op_inner(op, operator, true)
|
|
24166
|
+
self.generate_like_op_inner(op, operator, op.negated)
|
|
24173
24167
|
}
|
|
24174
24168
|
|
|
24175
24169
|
fn generate_like_op_inner(&mut self, op: &LikeOp, operator: &str, negated: bool) -> Result<()> {
|
|
24170
|
+
// DataFusion's established unquantified spelling is prefix NOT. This
|
|
24171
|
+
// equivalence must never be applied before an ANY/ALL reduction.
|
|
24176
24172
|
if negated
|
|
24177
|
-
&&
|
|
24178
|
-
|
|
24179
|
-
Some(DialectType::ClickHouse)
|
|
24180
|
-
| Some(DialectType::DataFusion)
|
|
24181
|
-
| Some(DialectType::TSQL)
|
|
24182
|
-
| Some(DialectType::Fabric)
|
|
24183
|
-
)
|
|
24173
|
+
&& op.quantifier.is_none()
|
|
24174
|
+
&& self.config.dialect == Some(DialectType::DataFusion)
|
|
24184
24175
|
{
|
|
24185
24176
|
self.write_keyword("NOT");
|
|
24186
24177
|
self.write_space();
|
|
24187
24178
|
return self.generate_like_op_inner(op, operator, false);
|
|
24188
24179
|
}
|
|
24189
|
-
|
|
24180
|
+
// Snowflake does not accept infix NOT LIKE ANY/ALL. Negating every
|
|
24181
|
+
// comparison is equivalent to negating the dual positive quantifier.
|
|
24182
|
+
if negated && self.config.dialect == Some(DialectType::Snowflake) {
|
|
24183
|
+
let dual = match op.quantifier.as_deref() {
|
|
24184
|
+
Some(q) if q.eq_ignore_ascii_case("ALL") => Some("ANY"),
|
|
24185
|
+
Some(q) if q.eq_ignore_ascii_case("ANY") || q.eq_ignore_ascii_case("SOME") => {
|
|
24186
|
+
Some("ALL")
|
|
24187
|
+
}
|
|
24188
|
+
_ => None,
|
|
24189
|
+
};
|
|
24190
|
+
if let Some(dual) = dual {
|
|
24191
|
+
let mut positive = op.clone();
|
|
24192
|
+
positive.negated = false;
|
|
24193
|
+
positive.quantifier = Some(dual.into());
|
|
24194
|
+
self.write_keyword("NOT");
|
|
24195
|
+
self.write(" (");
|
|
24196
|
+
self.generate_like_op_inner(&positive, operator, false)?;
|
|
24197
|
+
self.write(")");
|
|
24198
|
+
return Ok(());
|
|
24199
|
+
}
|
|
24200
|
+
}
|
|
24190
24201
|
if matches!(self.config.dialect, Some(DialectType::ClickHouse)) {
|
|
24191
24202
|
if let Expression::Star(star) = &op.left {
|
|
24192
24203
|
if star
|
|
@@ -24304,7 +24315,8 @@ impl Generator {
|
|
|
24304
24315
|
) -> Result<()> {
|
|
24305
24316
|
let wrap_left = infix_operator.is_some_and(|parent| {
|
|
24306
24317
|
Self::infix_operand_needs_parentheses(parent, &op.left, OperandSide::Left)
|
|
24307
|
-
})
|
|
24318
|
+
}) || (matches!(&op.left, Expression::Not(_))
|
|
24319
|
+
&& !matches!(operator, "AND" | "OR" | "XOR"));
|
|
24308
24320
|
if wrap_left {
|
|
24309
24321
|
self.write("(");
|
|
24310
24322
|
}
|
|
@@ -24361,7 +24373,8 @@ impl Generator {
|
|
|
24361
24373
|
self.write_space();
|
|
24362
24374
|
let wrap_right = infix_operator.is_some_and(|parent| {
|
|
24363
24375
|
Self::infix_operand_needs_parentheses(parent, &op.right, OperandSide::Right)
|
|
24364
|
-
})
|
|
24376
|
+
}) || (matches!(&op.right, Expression::Not(_))
|
|
24377
|
+
&& !matches!(operator, "AND" | "OR" | "XOR"));
|
|
24365
24378
|
if wrap_right {
|
|
24366
24379
|
self.write("(");
|
|
24367
24380
|
}
|
|
@@ -24401,7 +24414,20 @@ impl Generator {
|
|
|
24401
24414
|
self.write_space();
|
|
24402
24415
|
}
|
|
24403
24416
|
}
|
|
24404
|
-
|
|
24417
|
+
let wrap = operator == "NOT"
|
|
24418
|
+
&& (matches!(
|
|
24419
|
+
&op.this,
|
|
24420
|
+
Expression::And(_) | Expression::Or(_) | Expression::Xor(_)
|
|
24421
|
+
) || (self.config.dialect == Some(DialectType::ClickHouse)
|
|
24422
|
+
&& matches!(&op.this, Expression::Like(like) | Expression::ILike(like) if like.quantifier.is_some())));
|
|
24423
|
+
if wrap {
|
|
24424
|
+
self.write("(");
|
|
24425
|
+
}
|
|
24426
|
+
self.generate_expression(&op.this)?;
|
|
24427
|
+
if wrap {
|
|
24428
|
+
self.write(")");
|
|
24429
|
+
}
|
|
24430
|
+
Ok(())
|
|
24405
24431
|
}
|
|
24406
24432
|
|
|
24407
24433
|
fn generate_in(&mut self, in_expr: &In) -> Result<()> {
|