Skip to content

SQLite connection starts without foreign key enforcement #798

@Yagich

Description

@Yagich

SQLite's enforcement of foreign key constraints is disabled by default. It can be enabled with a PRAGMA foreign_keys = ON statement.

While it can be manually called in user code, it's not clear where the best place for it is. In my app, I did it in app.lua, in the outermost scope. That makes the statement run seemingly every time app is required by something, and I'm not sure if it matters. I wasn't able to find any way to add a db connection hook or something like that.

Would it be possible to add that query when establishing the connection on Lapis' side? If not, is there some function that is run on app init, after the connection was established?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions