Open nyyakko opened 1 month ago
Let me elabore a bit better on what I'm trying to achieve here. I have two tables:
CREATE TABLE "child" (
"id" INTEGER NOT NULL,
"parentId" INTEGER NOT NULL REFERENCES parent ON DELETE CASCADE,
PRIMARY KEY ("id" AUTOINCREMENT)
);
CREATE TABLE "parent" (
"id" INTEGER NOT NULL,
PRIMARY KEY ("id" AUTOINCREMENT)
);
Making that when I delete the parent table, the child table is automatically deleted together in a cascade fashion. The thing is that thats not what happening currently. I did a quick research and learned that sqlite disables the foreign_keys pragma for backward compatibility, which, as far as I understand (firs time playing around with databases), would actually make possible for me to achieve the behavior I want.
so the question here really is about how I can enable that pragma so I can achieve the behavior I want? Is there any other way to achieve this? Is it documented?
Anyone cares to shed a light on how to enable foreign_keys with this library? I've tried doing the following:
without success. if anyone could help me with this I'd be glad.