Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling foreign key constraints #147

Closed
kalafut opened this issue Mar 12, 2024 · 2 comments
Closed

Enabling foreign key constraints #147

kalafut opened this issue Mar 12, 2024 · 2 comments

Comments

@kalafut
Copy link

kalafut commented Mar 12, 2024

Hi,

This is a useful project! It has been working well for me but I've recently bumped into a couple data issues because constraints I expected weren't enforced (e.g., creating a reference to a nonexistent user and deletes not cascading). I think the foreign_keys pragma is OFF (at least it looks like that based on an ad-hoc query of the value), and based on #76 (comment) I don't think there is a way to change that.

Any chance of a new CLI option to turn on FK constraints?

Thanks.

@coleifer
Copy link
Owner

Yeah, I have it enabled by default on my system sqlite (via compilation flag) but most system installs do not have this, so I've added a new CLI option -- use -f or --foreign-keys to enable.

@kalafut
Copy link
Author

kalafut commented Mar 12, 2024

Excellent! Thank you for the super-quick update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants