-
Couldn't load subscription status.
- Fork 579
Open
Labels
Description
CASCADE DELETE in turso v0.3.0-pre.4
Issue
CASCADE actions fail during INSERT with error:
Parse error: foreign key actions other than NO ACTION are not implemented
Steps
- Create table with
ON DELETE CASCADE - Enable
PRAGMA foreign_keys = ON - Try to INSERT data
- INSERT fails with error above
Code
conn.execute("PRAGMA foreign_keys = ON", ()).await?;
conn.execute("CREATE TABLE parent (id INTEGER PRIMARY KEY, name TEXT)", ()).await?;
conn.execute(
"CREATE TABLE child (
id INTEGER PRIMARY KEY,
parent_id INTEGER NOT NULL,
FOREIGN KEY (parent_id) REFERENCES parent(id) ON DELETE CASCADE
)",
()
).await?; // ✓ Succeeds
conn.execute("INSERT INTO parent (id, name) VALUES (1, 'test')", ()).await?;
// ❌ Fails: Parse error: foreign key actions other than NO ACTION are not implemented