



SELECT statements to use env.DB.withSession() but get this error:Read replication in the D1 setting, any clue what's wrong?env.DB is undefined.PRAGMA table_info(table_name) and show us the output? I'm wondering if the table was originally created with a different primary key and changed your code to something like, CREATE TABLE IF NOT EXISTS... with the primary key that you now think is the primary key but it actually isn't.
NOT NULL. https://sqlite.org/quirks.html#primary_keys_can_sometimes_contain_nullsThe value of an INTEGER PRIMARY KEY column must always be a non-NULL integer because the INTEGER PRIMARY KEY is an alias for the ROWID. If you try to insert a NULL into an INTEGER PRIMARY KEY column, SQLite automatically converts the NULL into a unique integer.
NOT NULL