Skip to content

Add dialect test that compares alasql with SQLite - #2729

Merged
mathiasrw merged 1 commit into
developfrom
fix/2593
Oct 21, 2026
Merged

mathiasrw merged 1 commit into
developfrom
fix/2593

Conversation

@mathiasrw

@mathiasrw mathiasrw commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Closes #2593. The rest continues in #2730.

Moves the comparison script into test/dialect/ as the first step of #2593. The test runs SQL text in alasql and in SQLite (bun:sqlite, so no new dependency) and compares the answers.

yarn build-only
bun test/dialect/run.js                        # check dist/alasql.fs.js
bun test/dialect/run.js path/to/alasql.fs.js   # check another build
bun test/dialect/run.js --update               # rewrite expected-differences after an intended change

Files

Result (develop at be1b3dd, SQLite 3.43.2)

Area Cases As SQLite Differ
cases.sql 106 66 40
group-by 246 173 73
order-by 352 157 195
set-operations 144 53 91
subqueries 312 151 161
Total 1160 600 560

All 560 differences are listed, so the test passes. The 40 from cases.sql have a reason. The 517 from the matrices say "Not reviewed yet.": they are recorded so that a refactor that changes any of them is caught. 3 cases are marked unstable and not checked. They sort numbers against text after a UNION with DESC, and alasql's answer flips between runs in one process (#2720, point 3).

It fails when

  • a case differs from SQLite and is not listed;
  • a listed case gives another alasql answer than the one recorded;
  • a listed case now gives SQLite's answer;
  • an entry is no longer a case.

A different SQLite answer (another SQLite version) is a note, not a failure.

Not in this PR (#2730)

  • Running it in CI. The test is not picked up by bun test yet.
  • Testing the dialect modules (alasql/dialect/sqlite, PGlite for alasql/dialect/postgres).
  • Reasons for the 517 unreviewed differences.

@mathiasrw
mathiasrw merged commit 5222441 into develop Oct 21, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dialect test: compare alasql with SQLite expression by expression in CI (the reference engine for v5)

1 participant