Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ PYTHON_TYPED := scripts tests/unit/scripts python/src $(PYTHON_API_TESTS)
PYTHON_TESTS := tests/unit/scripts $(PYTHON_API_TESTS)
endif

.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
.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

format:
cargo fmt --all
Expand Down Expand Up @@ -74,6 +74,11 @@ polyglot-guard:
generate-cases:
uv run python -m scripts.generate_cases

# Rewrites the outcomes recorded in corpora/everyday, everyday-models and basics from the current
# converter. Run it in the PR whose change moves an outcome, and commit the corpora with it.
corpus-rerecord:
SQLQUACK_RERECORD=1 cargo test --locked -p sqlquack --lib everyday_corpus

# Fails when a generated case file differs from what its generator writes.
generated-cases:
uv run python -m scripts.generate_cases --check
Expand Down
29 changes: 29 additions & 0 deletions corpora/basics/fixture.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
-- The rows the basics corpus's translations run over, in the DuckDB types converted SQL reads
-- corpora/basics/schema.json as; the playground's sample rows.
CREATE TABLE "CUSTOMERS" ("CUSTOMER_ID" DECIMAL(38,0), "EMAIL" VARCHAR, "FIRST_NAME" VARCHAR, "COUNTRY" VARCHAR, "SIGNUP_DATE" DATE);
CREATE TABLE "EVENTS" ("EVENT_ID" DECIMAL(38,0), "CUSTOMER_ID" DECIMAL(38,0), "EVENT_TYPE" VARCHAR, "OCCURRED_AT" TIMESTAMP_NS, "PAYLOAD" JSON);
CREATE TABLE "ORDERS" ("ORDER_ID" DECIMAL(38,0), "CUSTOMER_ID" DECIMAL(38,0), "STATUS" VARCHAR, "TOTAL" DECIMAL(12,2), "ORDERED_AT" TIMESTAMP_NS);
CREATE TABLE "ORDER_ITEMS" ("ORDER_ID" DECIMAL(38,0), "PRODUCT_ID" DECIMAL(38,0), "QUANTITY" DECIMAL(38,0), "UNIT_PRICE" DECIMAL(10,2));
CREATE TABLE "PRODUCTS" ("PRODUCT_ID" DECIMAL(38,0), "NAME" VARCHAR, "CATEGORY" VARCHAR, "PRICE" DECIMAL(10,2));
INSERT INTO "ORDERS" VALUES
(1, 10, 'shipped', 120.50, TIMESTAMP '2026-10-01 09:30:00'),
(2, 10, 'shipped', 80.00, TIMESTAMP '2026-10-03 14:00:00'),
(3, 11, 'pending', 45.25, TIMESTAMP '2026-10-04 11:15:00'),
(4, 12, 'shipped', 310.00, TIMESTAMP '2026-10-05 16:45:00'),
(5, 12, NULL, 12.99, TIMESTAMP '2026-10-06 08:05:00');
INSERT INTO "CUSTOMERS" VALUES
(10, 'ada@example.com', 'Ada', 'GB', DATE '2026-01-15'),
(11, 'grace@example.com', 'Grace', 'US', DATE '2026-03-02'),
(12, 'linus@example.com', 'Linus', 'FI', DATE '2026-06-20');
INSERT INTO "PRODUCTS" VALUES
(100, 'Duck mug', 'kitchen', 12.50),
(101, 'Rubber duck', 'toys', 4.99),
(102, 'Pond map', 'books', 30.00);
INSERT INTO "ORDER_ITEMS" VALUES
(1, 100, 2, 12.50), (1, 101, 1, 4.99), (2, 102, 2, 30.00),
(3, 101, 5, 4.99), (4, 102, 10, 30.00), (5, 101, 1, 4.99);
INSERT INTO "EVENTS" VALUES
(1000, 10, 'view', TIMESTAMP '2026-10-01 09:00:00', '{"page": "/mugs", "ms": 820}'),
(1001, 10, 'purchase', TIMESTAMP '2026-10-01 09:30:00', '{"order_id": 1, "items": [100, 101]}'),
(1002, 11, 'view', TIMESTAMP '2026-10-04 11:00:00', '{"page": "/ducks", "ms": 310}'),
(1003, 12, 'purchase', TIMESTAMP '2026-10-05 16:45:00', '{"order_id": 4, "items": [102]}');
Loading