Fabian de Almeida Ramos
05/12/2020, 8:11 PMCREATE 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..Elka
05/15/2020, 10:16 AMid NOT NULLMarcelo Hernandez
05/16/2020, 5:21 AMAUTOINCREMENT, I have it set as:
INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL