`D1_ERROR: internal error; reference = ...` - what is this?
D1_ERROR: internal error; reference = ... - what is this?D1_ERROR: internal error; reference = ...



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.SELECTRead replicationenv.DBPRAGMA table_info(table_name)CREATE TABLE IF NOT EXISTS...