polyglot-sql 0.8.0__tar.gz → 0.9.0__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-0.8.0 → polyglot_sql-0.9.0}/Cargo.lock +6 -6
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/Cargo.toml +1 -1
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/PKG-INFO +33 -1
- {polyglot_sql-0.8.0/crates/polyglot-sql-python → polyglot_sql-0.9.0}/README.md +32 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/Cargo.toml +2 -2
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/README.md +1 -1
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/ast_transforms.rs +25 -89
- polyglot_sql-0.9.0/crates/polyglot-sql/src/builder/engine.rs +825 -0
- polyglot_sql-0.8.0/crates/polyglot-sql/src/builder.rs → polyglot_sql-0.9.0/crates/polyglot-sql/src/builder/mod.rs +578 -644
- polyglot_sql-0.9.0/crates/polyglot-sql/src/builder/plan.rs +1482 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/bigquery.rs +27 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/mod.rs +555 -32
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/normalization/aggregates.rs +112 -1
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/normalization/json.rs +63 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/normalization/mod.rs +94 -19
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/normalization/operators.rs +437 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/normalization/scalar.rs +426 -16
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/normalization/temporal.rs +76 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/normalization/types.rs +15 -10
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/snowflake.rs +96 -2
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/tsql.rs +215 -28
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/generator.rs +161 -9
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/parser.rs +117 -11
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/tokens.rs +18 -3
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/transforms.rs +337 -15
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/common/known_failures.rs +19 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/dialect_matrix.rs +878 -1
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/fabric_regression.rs +225 -2
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/snowflake_regression_test.rs +117 -1
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/sqlglot_compat.rs +23 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/tsql_regression.rs +245 -10
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0/crates/polyglot-sql-python}/README.md +32 -0
- polyglot_sql-0.9.0/crates/polyglot-sql-python/src/builders.rs +642 -0
- polyglot_sql-0.9.0/crates/polyglot-sql-python/src/expr.rs +1568 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/src/lib.rs +2 -0
- polyglot_sql-0.9.0/crates/polyglot-sql-python/tests/test_builders.py +132 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/python/polyglot_sql/__init__.py +208 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/python/polyglot_sql/__init__.pyi +132 -0
- polyglot_sql-0.8.0/crates/polyglot-sql-python/src/expr.rs +0 -728
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/benches/allocation_hotspots.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/benches/ast_traversal.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/benches/in_list.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/benches/lineage.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/benches/parsing.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/benches/performance_hotspots.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/benches/rust_parsing.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/benches/transpile.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/examples/basic_usage.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/examples/bench_json.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/ast_children.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/ast_json.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/athena.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/clickhouse.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/cockroachdb.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/databricks.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/datafusion.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/doris.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/dremio.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/drill.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/druid.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/duckdb.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/dune.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/exasol.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/fabric.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/generic.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/hive.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/materialize.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/mysql.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/normalization/collections.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/normalization/postgres_interval.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/normalization/statements.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/oracle.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/postgres.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/presto.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/redshift.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/risingwave.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/singlestore.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/solr.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/spark.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/sqlite.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/starrocks.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/tableau.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/teradata.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/tidb.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/dialects/trino.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/diff.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/error.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/expressions.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/format_tokens.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/function_catalog.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/function_registry.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/guard.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/helper.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/lib.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/lineage.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/openlineage.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/optimizer/annotate_types.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/optimizer/canonicalize.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/optimizer/eliminate_ctes.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/optimizer/eliminate_joins.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/optimizer/isolate_table_selects.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/optimizer/mod.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/optimizer/normalize.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/optimizer/normalize_identifiers.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/optimizer/optimize_joins.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/optimizer/optimizer.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/optimizer/pushdown_predicates.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/optimizer/pushdown_projections.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/optimizer/qualify_columns.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/optimizer/qualify_tables.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/optimizer/simplify.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/optimizer/subquery.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/planner.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/query_analysis.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/resolver.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/schema.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/scope.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/time.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/traversal.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/trie.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/validation/tests.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/src/validation.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/analyze_failures.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/clickhouse_regression.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/common/mod.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/common/test_data.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/common/test_runner.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/create_view_security_comment_regression.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/custom_clickhouse_coverage.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/custom_clickhouse_parser.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/custom_dialect.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/custom_dialect_tests.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/custom_fixtures/datafusion/ddl.json +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/custom_fixtures/datafusion/dml.json +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/custom_fixtures/datafusion/functions.json +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/custom_fixtures/datafusion/identity.json +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/custom_fixtures/datafusion/operators.json +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/custom_fixtures/datafusion/select.json +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/custom_fixtures/datafusion/transpilation.json +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/custom_fixtures/datafusion/types.json +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/data_type_api.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/deep_nesting_regression.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/error_handling.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/fabric_tpch_regression.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/identity_roundtrip.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/oracle_data_types_regression.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/postgres_explain_options.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/postgres_regexp_clickhouse.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/postgres_sqlite_regression.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/query_analysis.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/query_analysis_regression.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/sqlglot_dialect_identity.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/sqlglot_identity.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/sqlglot_identity_detailed.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/sqlglot_parser.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/sqlglot_pretty.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/sqlglot_transpilation.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/sqlglot_transpile.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/tpch_transpile_stack.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql/tests/transform_regression.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-ast-derive/Cargo.toml +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-ast-derive/src/lib.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-function-catalogs/Cargo.toml +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-function-catalogs/README.md +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-function-catalogs/src/clickhouse.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-function-catalogs/src/duckdb.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-function-catalogs/src/lib.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-function-catalogs/tools/clickhouse/extract_functions.py +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-function-catalogs/tools/duckdb/extract_functions.py +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/Cargo.toml +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/docs/api.md +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/docs/index.md +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/mkdocs.yml +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/src/annotate_types.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/src/dialects.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/src/diff.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/src/errors.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/src/expr_types.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/src/format.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/src/generate.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/src/helpers.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/src/lineage.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/src/openlineage.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/src/optimize.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/src/parse.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/src/query_analysis.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/src/tokenize.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/src/transforms.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/src/transpile.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/src/types.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/src/validate.rs +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/tests/conftest.py +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/tests/test_compat.py +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/tests/test_dialects.py +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/tests/test_diff.py +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/tests/test_expression.py +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/tests/test_format.py +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/tests/test_generate.py +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/tests/test_lineage.py +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/tests/test_optimize.py +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/tests/test_parse.py +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/tests/test_query_analysis.py +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/tests/test_transforms.py +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/tests/test_transpile.py +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/tests/test_validate.py +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/crates/polyglot-sql-python/uv.lock +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/pyproject.toml +0 -0
- {polyglot_sql-0.8.0 → polyglot_sql-0.9.0}/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.
|
|
608
|
+
version = "0.9.0"
|
|
609
609
|
dependencies = [
|
|
610
610
|
"criterion",
|
|
611
611
|
"once_cell",
|
|
@@ -623,7 +623,7 @@ dependencies = [
|
|
|
623
623
|
|
|
624
624
|
[[package]]
|
|
625
625
|
name = "polyglot-sql-ast-derive"
|
|
626
|
-
version = "0.
|
|
626
|
+
version = "0.9.0"
|
|
627
627
|
dependencies = [
|
|
628
628
|
"proc-macro2",
|
|
629
629
|
"quote",
|
|
@@ -632,7 +632,7 @@ dependencies = [
|
|
|
632
632
|
|
|
633
633
|
[[package]]
|
|
634
634
|
name = "polyglot-sql-ffi"
|
|
635
|
-
version = "0.
|
|
635
|
+
version = "0.9.0"
|
|
636
636
|
dependencies = [
|
|
637
637
|
"cbindgen",
|
|
638
638
|
"polyglot-sql",
|
|
@@ -642,11 +642,11 @@ dependencies = [
|
|
|
642
642
|
|
|
643
643
|
[[package]]
|
|
644
644
|
name = "polyglot-sql-function-catalogs"
|
|
645
|
-
version = "0.
|
|
645
|
+
version = "0.9.0"
|
|
646
646
|
|
|
647
647
|
[[package]]
|
|
648
648
|
name = "polyglot-sql-python"
|
|
649
|
-
version = "0.
|
|
649
|
+
version = "0.9.0"
|
|
650
650
|
dependencies = [
|
|
651
651
|
"polyglot-sql",
|
|
652
652
|
"pyo3",
|
|
@@ -657,7 +657,7 @@ dependencies = [
|
|
|
657
657
|
|
|
658
658
|
[[package]]
|
|
659
659
|
name = "polyglot-sql-wasm"
|
|
660
|
-
version = "0.
|
|
660
|
+
version = "0.9.0"
|
|
661
661
|
dependencies = [
|
|
662
662
|
"console_error_panic_hook",
|
|
663
663
|
"js-sys",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: polyglot-sql
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.9.0
|
|
4
4
|
Classifier: Development Status :: 4 - Beta
|
|
5
5
|
Classifier: Intended Audience :: Developers
|
|
6
6
|
Classifier: License :: OSI Approved :: MIT License
|
|
@@ -68,6 +68,38 @@ polyglot_sql.parse_one("VARCHAR(255)", dialect="duckdb", into=polyglot_sql.DataT
|
|
|
68
68
|
polyglot_sql.format_sql("SELECT a,b FROM t WHERE x=1", dialect="postgres")
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
+
### SQLGlot-Compatible Builders
|
|
72
|
+
|
|
73
|
+
The common SQLGlot builder surface is available directly from
|
|
74
|
+
`polyglot_sql`. Builders return normal Polyglot expression objects and are
|
|
75
|
+
immutable: each chained call returns a new expression.
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
query = (
|
|
79
|
+
polyglot_sql.select("customer_id", "COUNT(*) AS orders")
|
|
80
|
+
.from_("orders")
|
|
81
|
+
.where("status = 'complete'")
|
|
82
|
+
.group_by("customer_id")
|
|
83
|
+
.order_by("orders DESC")
|
|
84
|
+
.limit(10)
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
query.sql("postgres")
|
|
88
|
+
# "SELECT customer_id, COUNT(*) AS orders FROM orders WHERE status = 'complete' GROUP BY customer_id ORDER BY orders DESC LIMIT 10"
|
|
89
|
+
|
|
90
|
+
active = polyglot_sql.column("status").eq("active")
|
|
91
|
+
active.sql()
|
|
92
|
+
# "status = 'active'"
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
The shared builder feature set also includes named aggregate/string/math/date
|
|
96
|
+
helpers, all join and set-operation variants, named windows, lateral views,
|
|
97
|
+
hints, row locks, CTAS, `CASE`, `INSERT`, `UPDATE`, `DELETE`, and conditional
|
|
98
|
+
`MERGE` actions. Repeated clauses append by default; pass `append=False` to
|
|
99
|
+
replace one. Advanced parser options, mutable `copy=False` behavior, and the
|
|
100
|
+
complete SQLGlot expression catalog are not included. Polyglot expressions
|
|
101
|
+
remain the native AST type; SQLGlot is not a runtime dependency.
|
|
102
|
+
|
|
71
103
|
```python
|
|
72
104
|
ast = polyglot_sql.parse_one("SELECT id FROM a UNION ALL SELECT id FROM b")
|
|
73
105
|
order_expr = polyglot_sql.parse_one("SELECT id").args["expressions"][0]
|
|
@@ -41,6 +41,38 @@ polyglot_sql.parse_one("VARCHAR(255)", dialect="duckdb", into=polyglot_sql.DataT
|
|
|
41
41
|
polyglot_sql.format_sql("SELECT a,b FROM t WHERE x=1", dialect="postgres")
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
+
### SQLGlot-Compatible Builders
|
|
45
|
+
|
|
46
|
+
The common SQLGlot builder surface is available directly from
|
|
47
|
+
`polyglot_sql`. Builders return normal Polyglot expression objects and are
|
|
48
|
+
immutable: each chained call returns a new expression.
|
|
49
|
+
|
|
50
|
+
```python
|
|
51
|
+
query = (
|
|
52
|
+
polyglot_sql.select("customer_id", "COUNT(*) AS orders")
|
|
53
|
+
.from_("orders")
|
|
54
|
+
.where("status = 'complete'")
|
|
55
|
+
.group_by("customer_id")
|
|
56
|
+
.order_by("orders DESC")
|
|
57
|
+
.limit(10)
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
query.sql("postgres")
|
|
61
|
+
# "SELECT customer_id, COUNT(*) AS orders FROM orders WHERE status = 'complete' GROUP BY customer_id ORDER BY orders DESC LIMIT 10"
|
|
62
|
+
|
|
63
|
+
active = polyglot_sql.column("status").eq("active")
|
|
64
|
+
active.sql()
|
|
65
|
+
# "status = 'active'"
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
The shared builder feature set also includes named aggregate/string/math/date
|
|
69
|
+
helpers, all join and set-operation variants, named windows, lateral views,
|
|
70
|
+
hints, row locks, CTAS, `CASE`, `INSERT`, `UPDATE`, `DELETE`, and conditional
|
|
71
|
+
`MERGE` actions. Repeated clauses append by default; pass `append=False` to
|
|
72
|
+
replace one. Advanced parser options, mutable `copy=False` behavior, and the
|
|
73
|
+
complete SQLGlot expression catalog are not included. Polyglot expressions
|
|
74
|
+
remain the native AST type; SQLGlot is not a runtime dependency.
|
|
75
|
+
|
|
44
76
|
```python
|
|
45
77
|
ast = polyglot_sql.parse_one("SELECT id FROM a UNION ALL SELECT id FROM b")
|
|
46
78
|
order_expr = polyglot_sql.parse_one("SELECT id").args["expressions"][0]
|
|
@@ -100,14 +100,14 @@ function-catalog-all-dialects = [
|
|
|
100
100
|
]
|
|
101
101
|
|
|
102
102
|
[dependencies]
|
|
103
|
-
polyglot-sql-ast-derive = { path = "../polyglot-sql-ast-derive", version = "0.
|
|
103
|
+
polyglot-sql-ast-derive = { path = "../polyglot-sql-ast-derive", version = "0.9.0" }
|
|
104
104
|
serde = { workspace = true }
|
|
105
105
|
serde_json = { workspace = true }
|
|
106
106
|
thiserror = { workspace = true }
|
|
107
107
|
unicode-segmentation = { workspace = true }
|
|
108
108
|
stacker = { version = "0.1", optional = true }
|
|
109
109
|
ts-rs = { version = "12.0", features = ["serde-compat"], optional = true }
|
|
110
|
-
polyglot-sql-function-catalogs = { path = "../polyglot-sql-function-catalogs", version = "0.
|
|
110
|
+
polyglot-sql-function-catalogs = { path = "../polyglot-sql-function-catalogs", version = "0.9.0", optional = true, default-features = false }
|
|
111
111
|
|
|
112
112
|
[dev-dependencies]
|
|
113
113
|
pretty_assertions = "1.4"
|
|
@@ -25,7 +25,7 @@ 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.
|
|
28
|
+
polyglot-sql = { version = "0.9.0", default-features = false }
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
```toml
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
use std::collections::{HashMap, HashSet};
|
|
11
11
|
|
|
12
|
+
use crate::builder::engine;
|
|
12
13
|
use crate::expressions::*;
|
|
13
14
|
use crate::traversal::ExpressionWalk;
|
|
14
15
|
|
|
@@ -28,12 +29,9 @@ fn xform<F: Fn(Expression) -> Expression>(expr: Expression, fun: F) -> Expressio
|
|
|
28
29
|
/// If `expr` is a `Select`, the given `columns` are appended to its expression list.
|
|
29
30
|
/// Non-SELECT expressions are returned unchanged.
|
|
30
31
|
pub fn add_select_columns(expr: Expression, columns: Vec<Expression>) -> Expression {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
} else {
|
|
35
|
-
expr
|
|
36
|
-
}
|
|
32
|
+
let mut expression = expr;
|
|
33
|
+
let _ = engine::append_select(&mut expression, columns, true);
|
|
34
|
+
expression
|
|
37
35
|
}
|
|
38
36
|
|
|
39
37
|
/// Remove columns from the SELECT list where `predicate` returns `true`.
|
|
@@ -51,12 +49,9 @@ pub fn remove_select_columns<F: Fn(&Expression) -> bool>(
|
|
|
51
49
|
|
|
52
50
|
/// Set or remove the DISTINCT flag on a SELECT.
|
|
53
51
|
pub fn set_distinct(expr: Expression, distinct: bool) -> Expression {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
} else {
|
|
58
|
-
expr
|
|
59
|
-
}
|
|
52
|
+
let mut expression = expr;
|
|
53
|
+
let _ = engine::apply_distinct(&mut expression, distinct);
|
|
54
|
+
expression
|
|
60
55
|
}
|
|
61
56
|
|
|
62
57
|
// ---------------------------------------------------------------------------
|
|
@@ -69,6 +64,14 @@ pub fn set_distinct(expr: Expression, distinct: bool) -> Expression {
|
|
|
69
64
|
/// existing one using AND (default) or OR (when `use_or` is `true`).
|
|
70
65
|
/// If there is no WHERE clause, one is created.
|
|
71
66
|
pub fn add_where(expr: Expression, condition: Expression, use_or: bool) -> Expression {
|
|
67
|
+
if !use_or {
|
|
68
|
+
if !matches!(expr, Expression::Select(_)) {
|
|
69
|
+
return expr;
|
|
70
|
+
}
|
|
71
|
+
let mut expression = expr;
|
|
72
|
+
let _ = engine::apply_where(&mut expression, condition, true);
|
|
73
|
+
return expression;
|
|
74
|
+
}
|
|
72
75
|
if let Expression::Select(mut sel) = expr {
|
|
73
76
|
sel.where_clause = Some(match sel.where_clause.take() {
|
|
74
77
|
Some(existing) => {
|
|
@@ -108,29 +111,9 @@ pub fn set_limit(expr: Expression, limit: usize) -> Expression {
|
|
|
108
111
|
|
|
109
112
|
/// Set the LIMIT on a SELECT or set operation using an expression.
|
|
110
113
|
pub fn set_limit_expr(expr: Expression, limit: Expression) -> Expression {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
this: limit,
|
|
115
|
-
percent: false,
|
|
116
|
-
comments: Vec::new(),
|
|
117
|
-
});
|
|
118
|
-
Expression::Select(sel)
|
|
119
|
-
}
|
|
120
|
-
Expression::Union(mut union) => {
|
|
121
|
-
union.limit = Some(Box::new(limit));
|
|
122
|
-
Expression::Union(union)
|
|
123
|
-
}
|
|
124
|
-
Expression::Intersect(mut intersect) => {
|
|
125
|
-
intersect.limit = Some(Box::new(limit));
|
|
126
|
-
Expression::Intersect(intersect)
|
|
127
|
-
}
|
|
128
|
-
Expression::Except(mut except) => {
|
|
129
|
-
except.limit = Some(Box::new(limit));
|
|
130
|
-
Expression::Except(except)
|
|
131
|
-
}
|
|
132
|
-
other => other,
|
|
133
|
-
}
|
|
114
|
+
let mut expression = expr;
|
|
115
|
+
let _ = engine::apply_limit(&mut expression, limit);
|
|
116
|
+
expression
|
|
134
117
|
}
|
|
135
118
|
|
|
136
119
|
/// Set the OFFSET on a SELECT or set operation.
|
|
@@ -140,28 +123,9 @@ pub fn set_offset(expr: Expression, offset: usize) -> Expression {
|
|
|
140
123
|
|
|
141
124
|
/// Set the OFFSET on a SELECT or set operation using an expression.
|
|
142
125
|
pub fn set_offset_expr(expr: Expression, offset: Expression) -> Expression {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
this: offset,
|
|
147
|
-
rows: None,
|
|
148
|
-
});
|
|
149
|
-
Expression::Select(sel)
|
|
150
|
-
}
|
|
151
|
-
Expression::Union(mut union) => {
|
|
152
|
-
union.offset = Some(Box::new(offset));
|
|
153
|
-
Expression::Union(union)
|
|
154
|
-
}
|
|
155
|
-
Expression::Intersect(mut intersect) => {
|
|
156
|
-
intersect.offset = Some(Box::new(offset));
|
|
157
|
-
Expression::Intersect(intersect)
|
|
158
|
-
}
|
|
159
|
-
Expression::Except(mut except) => {
|
|
160
|
-
except.offset = Some(Box::new(offset));
|
|
161
|
-
Expression::Except(except)
|
|
162
|
-
}
|
|
163
|
-
other => other,
|
|
164
|
-
}
|
|
126
|
+
let mut expression = expr;
|
|
127
|
+
let _ = engine::apply_offset(&mut expression, offset);
|
|
128
|
+
expression
|
|
165
129
|
}
|
|
166
130
|
|
|
167
131
|
/// Set the ORDER BY clause on a SELECT or set operation.
|
|
@@ -169,38 +133,10 @@ pub fn set_offset_expr(expr: Expression, offset: Expression) -> Expression {
|
|
|
169
133
|
/// Bare expressions are normalized to ascending order expressions. Existing
|
|
170
134
|
/// `Ordered` expressions preserve their direction and null-ordering metadata.
|
|
171
135
|
pub fn set_order_by(expr: Expression, expressions: Vec<Expression>) -> Expression {
|
|
172
|
-
let
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
match expr {
|
|
179
|
-
Expression::Select(mut sel) => {
|
|
180
|
-
sel.order_by = Some(order_by);
|
|
181
|
-
Expression::Select(sel)
|
|
182
|
-
}
|
|
183
|
-
Expression::Union(mut union) => {
|
|
184
|
-
union.order_by = Some(order_by);
|
|
185
|
-
Expression::Union(union)
|
|
186
|
-
}
|
|
187
|
-
Expression::Intersect(mut intersect) => {
|
|
188
|
-
intersect.order_by = Some(order_by);
|
|
189
|
-
Expression::Intersect(intersect)
|
|
190
|
-
}
|
|
191
|
-
Expression::Except(mut except) => {
|
|
192
|
-
except.order_by = Some(order_by);
|
|
193
|
-
Expression::Except(except)
|
|
194
|
-
}
|
|
195
|
-
other => other,
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
fn normalize_ordered(expression: Expression) -> Ordered {
|
|
200
|
-
match expression {
|
|
201
|
-
Expression::Ordered(ordered) => *ordered,
|
|
202
|
-
other => Ordered::asc(other),
|
|
203
|
-
}
|
|
136
|
+
let mut expression = expr;
|
|
137
|
+
let values = expressions.into_iter().map(engine::ordered).collect();
|
|
138
|
+
let _ = engine::apply_order_by(&mut expression, values, false);
|
|
139
|
+
expression
|
|
204
140
|
}
|
|
205
141
|
|
|
206
142
|
/// Remove both LIMIT and OFFSET from a SELECT.
|