Drizzle SQLite not implicitly handling autoincrement primary key id
schema
code
hi
in the above code, I am getting an error
I am iterating a collection of items that I am trying to upsert to the drizzle table
I am letting Drizzle automatically assign an autoincrementing integer as the primary key, starting at 1. That way I dont use the returning() accessor to get the resulting inserted id
however, it is not working like i expect since it is showing the SQLITE_CONSTRAINT_PRIMARYKEY: UNIQUE constraint failed error
Feedback appreciated
thanks
1 Reply
resolved. I needed to define it as
id: integer("id").primaryKey(),
and didn't need the rest of the constraint