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

Prevent SQLite from inserting NULL values into NOT NULL columns #97

Open
bgrgicak opened this issue Apr 15, 2024 · 0 comments
Open

Prevent SQLite from inserting NULL values into NOT NULL columns #97

bgrgicak opened this issue Apr 15, 2024 · 0 comments

Comments

@bgrgicak
Copy link
Collaborator

In #94 we added support for allowing columns to be updated to null even if they have NOT NULL in the column definition and don't have a DEFAULT value.

This was done to match how MySQL works without the STRICT_TRANS_TABLES mode.

An unwanted consequence is that we now allow the insertion of NULL to NOT NULL columns which isn't how MySQL works without STRICT_TRANS_TABLES mode.

To fix this we need to prevent SQLite from inserting NULL values into NOT NULL columns, but still allow updates.

Some options I explored earlier were triggers or modifying the update query to ensure a default value.

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

1 participant