Skip to content

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

Open
@bgrgicak

Description

@bgrgicak

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions