Sorry if this isn’t the right place to ask, but I’m having some trouble with inserting a record without specifying an ID.
My table&insert look like:
CREATE TABLE Recipe (
id INTEGER PRIMARY KEY AUTOINCREMENT,
title TEXT NOT NULL,
duration TEXT NOT NULL,
difficulty TEXT NOT NULL,
calories INTEGER AS Int NOT NULL
);
insert:
INSERT INTO Recipe (title, duration, difficulty, calories)
VALUES (?, ?, ?, ?);
now, when I call
recipeQueries.insert
, I get a
NOT NULL constraint failed: Recipe.id
.. I’ve been looking around SQLite docs as well, but still can’t figure it out..