feat(fk): Foreign Key Enforcement — ON DELETE/UPDATE CASCADE, SET NULL, RESTRICT
- Add tkRestrict token to lexer - Parse ON DELETE CASCADE/SET NULL/RESTRICT and ON UPDATE CASCADE/SET NULL/RESTRICT in both table-level and column-level FK constraints - Add fkOnDelete/fkOnUpdate to ColumnDef and ForeignKeyDef - Fix table-level FK constraint application (third pass after columns are created) - Implement enforceFkOnDelete, enforceFkOnUpdate, enforceFkOnChildUpdate helpers - Wire FK enforcement into DELETE and UPDATE execution paths - Add 9 regression tests covering all FK actions
This commit is contained in:
@@ -85,6 +85,7 @@ type
|
||||
tkForeign
|
||||
tkReferences
|
||||
tkCascade
|
||||
tkRestrict
|
||||
tkUnique
|
||||
tkCheck
|
||||
tkDefault
|
||||
@@ -308,6 +309,7 @@ const keywords*: Table[string, TokenKind] = {
|
||||
"foreign": tkForeign,
|
||||
"references": tkReferences,
|
||||
"cascade": tkCascade,
|
||||
"restrict": tkRestrict,
|
||||
"unique": tkUnique,
|
||||
"check": tkCheck,
|
||||
"default": tkDefault,
|
||||
|
||||
Reference in New Issue
Block a user