|
2 | 2 |
|
3 | 3 | > **Goal:** Full SQLite syntax parity + key PostgreSQL additions in SharpCoreDB. |
4 | 4 | > **Reference matrix:** `docs/compatibility/SQLITE_POSTGRESQL_AGGREGATE_SYNTAX_v1.7.0.md` |
5 | | -> **Last updated:** v1.7.0 |
6 | | -> **Estimated total effort:** ~19 weeks solo / ~10 weeks with AI pair-programming. |
| 5 | +> **Last updated:** v1.7.0 — 2025-07-03 (W3-5 DEFAULT expression marked done; AstExecutor VisitSetOperation implemented) |
7 | 6 |
|
8 | 7 | --- |
9 | 8 |
|
|
81 | 80 | ## 🟠 Wave 2 — P1 High Impact (~8 weeks) |
82 | 81 |
|
83 | 82 | ### W2-1 · Set operations |
84 | | -- [ ] Parse `UNION` between two SELECT arms |
85 | | -- [ ] Parse `UNION ALL` |
86 | | -- [ ] Parse `INTERSECT` |
87 | | -- [ ] Parse `EXCEPT` |
88 | | -- [ ] Add `SetOperationNode` to `SqlAst.Nodes.cs` |
89 | | -- [ ] Execute UNION (deduplicate) |
90 | | -- [ ] Execute UNION ALL (no dedup) |
91 | | -- [ ] Execute INTERSECT |
92 | | -- [ ] Execute EXCEPT |
93 | | -- [ ] `ORDER BY` / `LIMIT` on outer set result |
94 | | -- [ ] Tests for all four set operations |
| 83 | +- [x] Parse `UNION` between two SELECT arms |
| 84 | +- [x] Parse `UNION ALL` |
| 85 | +- [x] Parse `INTERSECT` |
| 86 | +- [x] Parse `EXCEPT` |
| 87 | +- [x] Add `SetOperationNode` to `SqlAst.Nodes.cs` |
| 88 | +- [x] Execute UNION (deduplicate) |
| 89 | +- [x] Execute UNION ALL (no dedup) |
| 90 | +- [x] Execute INTERSECT |
| 91 | +- [x] Execute EXCEPT |
| 92 | +- [x] `ORDER BY` / `LIMIT` on outer set result |
| 93 | +- [x] Tests for all four set operations |
95 | 94 |
|
96 | 95 | ### W2-2 · String scalar functions (extended) |
97 | 96 | - [x] `SUBSTR(s, start)` — 1-based index, SQLite convention |
|
107 | 106 | - [x] Tests for implemented string functions |
108 | 107 |
|
109 | 108 | ### W2-3 · Numeric scalar functions (extended) |
110 | | -- [ ] `MAX(a, b)` — 2-arg scalar form (distinct from aggregate MAX) |
111 | | -- [ ] `MIN(a, b)` — 2-arg scalar form |
112 | | -- [ ] `POW(x, y)` / `POWER(x, y)` |
113 | | -- [ ] `SQRT(x)` |
114 | | -- [ ] `MOD(x, y)` / `%` operator |
| 109 | +- [x] `MAX(a, b)` — 2-arg scalar form (distinct from aggregate MAX) |
| 110 | +- [x] `MIN(a, b)` — 2-arg scalar form |
| 111 | +- [x] `POW(x, y)` / `POWER(x, y)` |
| 112 | +- [x] `SQRT(x)` |
| 113 | +- [x] `MOD(x, y)` / `%` operator |
115 | 114 | - [x] `SIGN(x)` |
116 | | -- [ ] `RANDOM()` — returns random integer (SQLite: 64-bit signed) |
| 115 | +- [x] `RANDOM()` — returns random integer (SQLite: 64-bit signed) |
117 | 116 | - [x] Tests for implemented numeric functions |
118 | 117 |
|
119 | 118 | ### W2-4 · GLOB operator |
120 | | -- [ ] Parse `col GLOB pattern` in expression parser |
121 | | -- [ ] Implement glob→regex conversion (`*`→`.*`, `?`→`.`, case-sensitive) |
122 | | -- [ ] Support character classes `[A-Z]` |
123 | | -- [ ] Tests for GLOB with various patterns |
| 119 | +- [x] Parse `col GLOB pattern` in expression parser |
| 120 | +- [x] Implement glob→regex conversion (`*`→`.*`, `?`→`.`, case-sensitive) |
| 121 | +- [x] Support character classes `[A-Z]` |
| 122 | +- [x] Tests for GLOB with various patterns |
124 | 123 |
|
125 | 124 | ### W2-5 · `WITH RECURSIVE` CTE |
126 | 125 | - [ ] Detect `RECURSIVE` keyword in `WITH` clause |
|
171 | 170 | - [ ] `LAST_INSERT_ROWID()` — verify works in all execution paths |
172 | 171 |
|
173 | 172 | ### W3-5 · DEFAULT expression evaluation |
174 | | -- [ ] At INSERT time, evaluate `DEFAULT (expr)` for omitted columns |
175 | | -- [ ] Support `DEFAULT (strftime('%Y-%m-%d', 'now'))` |
176 | | -- [ ] Tests for DEFAULT expression columns |
| 173 | +- [x] At INSERT time, evaluate `DEFAULT (expr)` for omitted columns |
| 174 | +- [x] Support `DEFAULT (strftime('%Y-%m-%d', 'now'))` |
| 175 | +- [x] Tests for DEFAULT expression columns |
177 | 176 |
|
178 | 177 | ### W3-6 · Correlated subquery (full support) |
179 | 178 | - [ ] Pass outer row context into inner executor on each iteration |
|
242 | 241 | | Wave | Total items | Done | Remaining | |
243 | 242 | |---|---|---|---| |
244 | 243 | | Quick Wins | 14 | 14 | 0 | |
245 | | -| W1 — P0 | 18 | 2 | 16 | |
246 | | -| W2 — P1 | 34 | 8 | 26 | |
247 | | -| W3 — P2 | 28 | 2 | 26 | |
248 | | -| W4 — P3 | 24 | 1 | 23 | |
249 | | -| **Total** | **118** | **27** | **91** | |
| 244 | +| W1 — P0 | 31 | 31 | 0 | |
| 245 | +| W2 — P1 | 42 | 35 | 7 | |
| 246 | +| W3 — P2 | 38 | 5 | 33 | |
| 247 | +| W4 — P3 | 27 | 1 | 26 | |
| 248 | +| **Total** | **152** | **86** | **66** | |
250 | 249 |
|
251 | 250 | --- |
252 | 251 |
|
|
0 commit comments