feat: production polish — recursive CTE, UNION/INTERSECT/EXCEPT, DROP INDEX, JSON path, FTS SQL, covering index, SCRAM auth

- Recursive CTE execution (WITH RECURSIVE + UNION ALL, work-table loop)
- UNION / INTERSECT / EXCEPT parser + executor (nkSetOp)
- DROP INDEX parser + executor
- VIEW DDL persistence via AST-to-SQL serializer
- JSON path operators -> and ->> (lexer, parser, IR, executor)
- FTS SQL wiring WHERE col @@ 'query' (case-insensitive term match)
- Multi-column index range scans (prefix equality + range on last col)
- Covering index optimization (skip LSM read when index covers SELECT)
- SCRAM-SHA-256 authentication (password-based validation)
- 279 tests, 0 failures
This commit is contained in:
2026-05-07 13:00:36 +03:00
parent 7faae09ad3
commit 5deb38feb2
8 changed files with 548 additions and 41 deletions
+11 -1
View File
@@ -26,6 +26,7 @@ type
irLike, irILike
irBetween
irIsNull, irIsNotNull
irFtsMatch
IRAggregate* = enum
irCount, irSum, irAvg, irMin, irMax
@@ -50,6 +51,7 @@ type
irekConditional
irekExists
irekStar
irekJsonPath
IRJoinKind* = enum
irjkInner
@@ -166,6 +168,10 @@ type
existsSubquery*: IRPlan
of irekStar:
discard
of irekJsonPath:
jpExpr*: IRExpr
jpKey*: string
jpAsText*: bool
type
TypeChecker* = ref object
@@ -209,7 +215,8 @@ proc inferExpr*(tc: TypeChecker, expr: IRExpr, context: Table[string, IRType]):
return nil
case expr.unOp
of irEq, irNeq, irLt, irLte, irGt, irGte, irAnd, irOr, irNot,
irIsNull, irIsNotNull, irIn, irNotIn, irLike, irILike, irBetween:
irIsNull, irIsNotNull, irIn, irNotIn, irLike, irILike, irBetween,
irFtsMatch:
return IRType(name: "bool", kind: itkScalar)
else:
return nil
@@ -245,3 +252,6 @@ proc inferExpr*(tc: TypeChecker, expr: IRExpr, context: Table[string, IRType]):
return IRType(name: "bool", kind: itkScalar)
of irekStar:
return IRType(name: "star", kind: itkScalar)
of irekJsonPath:
if expr.jpAsText: return IRType(name: "str", kind: itkScalar)
return IRType(name: "json", kind: itkScalar)