Repository navigation
In progress
Labels
Milestone
Description
The structural changes to the engine, in the order to solve them. Each item is its own issue with what is needed to solve it. Tick an item when its pull request is merged.
The code areas are
- Expressions: identity by text and column lookup while generating code #2723 (expressions and binding)
- Subqueries: give each SELECT its own subqueries, one compiled form and a run context #2717 (subqueries)
- Set operations: parse UNION, INTERSECT and EXCEPT into a tree with their own ORDER BY and LIMIT #2718 (set operations)
- Query runs: state of one run kept on the cached statement, and separate sync and async paths #2724 (query runs)
- Query results: columns decided in several places and internal keys in result rows #2726 (query results)
- One comparison module with levels (dates compared by value, MAX/MIN on strings, one NULL order) #2595 (comparison)
- ORDER BY: one sort specification, keys beside the rows and one comparator #2720 (ORDER BY)
- GROUP BY: group keys as slots matched by structure, one aggregate interface and one partitioning step #2722 (GROUP BY)
- INSERT, UPDATE and DELETE: table rules checked in more than one place #2725 (INSERT, UPDATE and DELETE).
The themes for v5.0.0 are
- NULL as one value with one set of rules in every operator, function, aggregate, sort and key #3158 (NULL)
- Dialects as lists of behaviour modules, with one dialect that keeps today's behaviour as the way back from every breaking change #3159 (dialects)
- Dates as one kind of value, produced by one conversion and compared by time value everywhere #3160 (dates and times)
- Values and types, with one set of conversion rules for columns, casts, aggregates and file sources #3161 (values and types).
v4.x
Results stay as in 4.x. Only the bugs an item names may change results.
- Write the per-row read of a column from a source without column definitions only in the binding #2680
- Give each SELECT its own list of subqueries from parsing on #2666
- Keep the ORDER BY and LIMIT of each part of a set operation where they were written #2712
- Give each run of a statement a run context for its parameters, LIMIT, OFFSET and subquery caches #2667
- Decide the result columns of a SELECT in one function and let modify() read them from it #2651
- Keep the rows of a plain SELECT as tuples inside the engine and build objects only at output #3162
- Add one comparison module with today's rules for ORDER BY, DISTINCT and set operations #3163
- Give file sources one source interface that opens rows for a run and reports errors in one place #2677
- Compile every subquery to one form with a kind and correlation from the binding, and read FROM subqueries, views and CTEs through one table source #3164
- Keep ORDER BY sort keys beside the rows instead of inside them #3165
- Resolve ORDER BY items in one step for plain, grouped and set-operation queries #2693
- Sort GROUP_CONCAT values by the expressions of its ORDER BY #3166
- Compare the rows of set operations and DISTINCT with one key function #3167
- Match GROUP BY keys by structure and keep each group's state in slots #2647
- Give every aggregate the same init, step and result interface #2660
- Group rows for GROUP BY, grouping sets and DISTINCT in one partitioning step #3168
- Let modifiers and INTO formats only read the finished result #2699
- Move the key and check rules of a table into one module #2716
- Keep the definition of a table as data in table.schema and build its rules from it #3169
- Pass the rows of INSERT, UPDATE and DELETE through one write pipeline #2650
- Check a foreign key against the key of the referenced table that it names #2662
- Run UPDATE, DELETE and INSERT on a parameter array without a temporary table #2682
- Run a statement through one runner so every error reaches the caller, and key the statement cache on every compile option #2652
The INSERT, UPDATE and DELETE items (#2716 to #2662) do not depend on the items above them, so a second person can take them at any time. #2682 waits for #2677.
v5.0.0
These change results on purpose. Where it can, each one keeps the 4.x behaviour available through the v4 dialect.
- Rules that differ between dialects become named rules chosen when a statement is compiled #3170
- Return null, not undefined, for SQL NULL: what it means for the code #2588
- Three-valued logic for NOT, AND, OR and IN with NULL (measured against SQLite) #2597
- Make the standard comparison level the default, with dates by value and SQLite's order across types #3171
- Reject an ambiguous bare column inside a built-in function and in the SELECT list #2928
- GROUP BY name prefers a source column over a SELECT alias, as SQLite #2710
- Write the text of every expression from all of its parts, so unaliased column names are complete #2675
- Evaluate set operations left to right with INTERSECT binding tighter, with a dialect keeping the old order #202
- Sort NULL and mixed values in ORDER BY as SQLite, and honour NULLS FIRST and NULLS LAST, with a dialect keeping the old order #3172
- MIN and MAX compare through the comparison module, and SUM over no rows is NULL, with a dialect keeping the old rules #2696
- Compute window functions per partition over the source rows, sorted by the window's ORDER BY #2702
- Convert values for a typed column in one function, used by every write into a table #2659
- Make one date conversion produce every date value, so NOW, DATE, CAST and DATE columns agree #3173
- Give every storage engine one storage interface that saves the whole table definition and writes through the pipeline #2681
- A dialect that keeps today's behaviour, as the way back from each breaking change #2851
For every item
- One pull request per item, unless the item says how to split it.
- The full test suite and the CI checks (dialect test, parity check, run-state check, binding check) pass.
- The pull request lists every parity difference.
Activity
mathiasrw commentedon Nov 26, 2026
Open decisions for the v5.0.0 items. The issues are written with the first option.
nullno way back. A dialect that keeps today's behaviour, as the way back from each breaking change #2851 lists "NULL as undefined" in the v4 dialect. One of the two changes.+valueas INSERT does today.dateAsStringas the switch, orDateobjects.alasql.loadinto the shared instance, separate instances, or both. No issue tracks it yet.