Release Query Tools 0.2.0
Verify / verify (push) Canceled after 0s

This commit is contained in:
2026-09-02 10:28:20 +02:00
parent 2730ce08b2
commit f44d0598da
34 changed files with 5153 additions and 300 deletions
+25
View File
@@ -0,0 +1,25 @@
import { describe, expect, it } from "vitest";
import { parseDuckDbQuery } from "../../src/core/duckdb";
describe("DuckDB query boundary", () => {
it("records a single SELECT token stream", () => {
expect(
parseDuckDbQuery("SELECT team, avg(score) FROM data GROUP BY team"),
).toMatchObject({
type: "duckdb-query",
statement: "SELECT",
tokens: expect.arrayContaining([
{ kind: "word", value: "data", offset: 29 },
]),
});
});
it.each([
"INSTALL httpfs",
"SELECT * FROM data; DROP TABLE data",
"COPY data TO 'x.csv'",
"PRAGMA version",
])("rejects non-read-only statement %s", (source) => {
expect(() => parseDuckDbQuery(source)).toThrow();
});
});