feat: add ID generators, fix 6 forum-discovered deficiencies

ID Generators:
- AUTO_INCREMENT for INTEGER columns
- SERIAL / BIGSERIAL as syntactic sugar
- gen_random_uuid() / uuid() for UUID v4 generation
- nextval() / currval() for sequence support
- snowflake_id(node_id) for distributed 64-bit IDs
- RETURNING clause for INSERT

Deficiency Fixes:
- Comma join: FROM t1, t2 now works as implicit CROSS JOIN
- DEFAULT in restoreSchema: defaults survive server restart
- Duplicate column names: t.id instead of id in joins
- Empty result sets: always send column metadata to client
- GROUP BY non-agg columns: return first row value instead of empty
- Aggregate column names: count(*) instead of count()

Bug fix: PK uniqueness check now uses correct key format
This commit is contained in:
2026-05-16 02:57:30 +03:00
parent 406dcf4f4e
commit 652ed1b477
7 changed files with 591 additions and 21 deletions
+8
View File
@@ -158,6 +158,12 @@ type
tkDfs
tkPath
tkAutoIncrement
tkSequence
tkNextval
tkCurrval
tkUuid
# Window functions
tkOver
tkPartition
@@ -389,6 +395,8 @@ const keywords*: Table[string, TokenKind] = {
"first_value": tkFirstValue,
"last_value": tkLastValue,
"ntile": tkNtile,
"auto_increment": tkAutoIncrement,
"sequence": tkSequence,
}.toTable
proc newLexer*(input: string): Lexer =