Skip to content

Commit 1362af4

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix/playground-run-display
2 parents 17beff1 + 99e4ab3 commit 1362af4

309 files changed

Lines changed: 320531 additions & 229 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Cargo.lock‎

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ members = [
1313
"crates/sqlquack",
1414
"crates/sqlquack-polyglot-check",
1515
"crates/sqlquack-syntax-coverage",
16+
"crates/sqlquack-syntax-postgres",
1617
"crates/sqlquack-python",
1718
]
1819
exclude = ["fuzz"]
@@ -62,6 +63,7 @@ sqlquack-semantics = { path = "crates/sqlquack-semantics" }
6263
sqlquack-snowflake = { path = "crates/sqlquack-snowflake" }
6364
sqlquack-syntax = { path = "crates/sqlquack-syntax" }
6465
sqlquack-syntax-derive = { path = "crates/sqlquack-syntax-derive" }
66+
sqlquack-syntax-postgres = { path = "crates/sqlquack-syntax-postgres" }
6567
stacker = "0.1"
6668
syn = { version = "2", features = ["full"] }
6769
tempfile = "3"

‎Makefile‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ PYTHON_TYPED := scripts tests/unit/scripts python/src $(PYTHON_API_TESTS)
3030
PYTHON_TESTS := tests/unit/scripts $(PYTHON_API_TESTS)
3131
endif
3232

33-
.PHONY: format rust-lint python-check fensu syntax-coverage gate-build evidence-guard polyglot-guard generate-cases generated-cases generate-referee-cases referee-cases referee-pending translation-results check-ci check-merge test test-rust test-python python-module python-api python-wheel verify-recorded polyglot-duckshop census-duckshop fuzz-smoke gate gate-parallel census duckshop-compiled duckshop-measure
33+
.PHONY: format rust-lint python-check fensu syntax-coverage gate-build evidence-guard polyglot-guard generate-cases generated-cases corpus-rerecord generate-referee-cases referee-cases referee-pending translation-results check-ci check-merge test test-rust test-python python-module python-api python-wheel verify-recorded polyglot-duckshop census-duckshop fuzz-smoke gate gate-parallel census duckshop-compiled duckshop-measure
3434

3535
format:
3636
cargo fmt --all
@@ -74,6 +74,11 @@ polyglot-guard:
7474
generate-cases:
7575
uv run python -m scripts.generate_cases
7676

77+
# Rewrites the outcomes recorded in corpora/everyday, everyday-models and basics from the current
78+
# converter. Run it in the PR whose change moves an outcome, and commit the corpora with it.
79+
corpus-rerecord:
80+
SQLQUACK_RERECORD=1 cargo test --locked -p sqlquack --lib everyday_corpus
81+
7782
# Fails when a generated case file differs from what its generator writes.
7883
generated-cases:
7984
uv run python -m scripts.generate_cases --check

‎corpora/basics/fixture.sql‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
-- The rows the basics corpus's translations run over, in the DuckDB types converted SQL reads
2+
-- corpora/basics/schema.json as; the playground's sample rows.
3+
CREATE TABLE "CUSTOMERS" ("CUSTOMER_ID" DECIMAL(38,0), "EMAIL" VARCHAR, "FIRST_NAME" VARCHAR, "COUNTRY" VARCHAR, "SIGNUP_DATE" DATE);
4+
CREATE TABLE "EVENTS" ("EVENT_ID" DECIMAL(38,0), "CUSTOMER_ID" DECIMAL(38,0), "EVENT_TYPE" VARCHAR, "OCCURRED_AT" TIMESTAMP_NS, "PAYLOAD" JSON);
5+
CREATE TABLE "ORDERS" ("ORDER_ID" DECIMAL(38,0), "CUSTOMER_ID" DECIMAL(38,0), "STATUS" VARCHAR, "TOTAL" DECIMAL(12,2), "ORDERED_AT" TIMESTAMP_NS);
6+
CREATE TABLE "ORDER_ITEMS" ("ORDER_ID" DECIMAL(38,0), "PRODUCT_ID" DECIMAL(38,0), "QUANTITY" DECIMAL(38,0), "UNIT_PRICE" DECIMAL(10,2));
7+
CREATE TABLE "PRODUCTS" ("PRODUCT_ID" DECIMAL(38,0), "NAME" VARCHAR, "CATEGORY" VARCHAR, "PRICE" DECIMAL(10,2));
8+
INSERT INTO "ORDERS" VALUES
9+
(1, 10, 'shipped', 120.50, TIMESTAMP '2026-10-01 09:30:00'),
10+
(2, 10, 'shipped', 80.00, TIMESTAMP '2026-10-03 14:00:00'),
11+
(3, 11, 'pending', 45.25, TIMESTAMP '2026-10-04 11:15:00'),
12+
(4, 12, 'shipped', 310.00, TIMESTAMP '2026-10-05 16:45:00'),
13+
(5, 12, NULL, 12.99, TIMESTAMP '2026-10-06 08:05:00');
14+
INSERT INTO "CUSTOMERS" VALUES
15+
(10, 'ada@example.com', 'Ada', 'GB', DATE '2026-01-15'),
16+
(11, 'grace@example.com', 'Grace', 'US', DATE '2026-03-02'),
17+
(12, 'linus@example.com', 'Linus', 'FI', DATE '2026-06-20');
18+
INSERT INTO "PRODUCTS" VALUES
19+
(100, 'Duck mug', 'kitchen', 12.50),
20+
(101, 'Rubber duck', 'toys', 4.99),
21+
(102, 'Pond map', 'books', 30.00);
22+
INSERT INTO "ORDER_ITEMS" VALUES
23+
(1, 100, 2, 12.50), (1, 101, 1, 4.99), (2, 102, 2, 30.00),
24+
(3, 101, 5, 4.99), (4, 102, 10, 30.00), (5, 101, 1, 4.99);
25+
INSERT INTO "EVENTS" VALUES
26+
(1000, 10, 'view', TIMESTAMP '2026-10-01 09:00:00', '{"page": "/mugs", "ms": 820}'),
27+
(1001, 10, 'purchase', TIMESTAMP '2026-10-01 09:30:00', '{"order_id": 1, "items": [100, 101]}'),
28+
(1002, 11, 'view', TIMESTAMP '2026-10-04 11:00:00', '{"page": "/ducks", "ms": 310}'),
29+
(1003, 12, 'purchase', TIMESTAMP '2026-10-05 16:45:00', '{"order_id": 4, "items": [102]}');

0 commit comments

Comments
 (0)