I have created a table using the following command:
CREATE TABLE Person (id INTEGER PRIMARY KEY NOT NULL, name TEXT NOT NULL)
The problem I am having is that I can insert NULL for the id column despite the NOT NULL constraint. From what I understand, this is because the id column is now an alias for rowid.
If I change the data type of id to INT instead of INTEGER, the constraint works as I expect but I lose the rowid alias (and the benefits that come with it).
My question is: Is there a way to throw a constraint error when passing in NULL for a column that is an alias for rowid?
It seems the short answer here is that there is no way to maintain the
rowidalias while also preventing null insertions.