cheers - btw #wrangler might be a better place to ask folks if they've run into this issue
cheers - btw #wrangler might be a better place to ask folks if they've run into this issue

ON DUPLICATE KEY isn’t supported by D1’s query engine (SQLite) - use UPSERT or INSERT OR IGNORE instead: https://stackoverflow.com/a/4330694/556573ALTER TABLE likely to also cause requests to be held while it applies?table_list, table_info and table_xinfo workSELECT * FROM example with wrangler or the dashboard console, it works as expected, but the table viewer shows this:
table_info pragma to discover the structure of the table, when, for historical reasons, that pragma doesn't show generated columns - table_xinfo must be used instead. (see https://www.sqlite.org/gencol.html 2.3 #9)
PRAGMA foreign_keys=on on every connection, but this seems to always be a no-op. Anyone else run into this before?foreign_keys=1, while the beta backend defaults to foreign_keys=0.foreign_keys=1 on the beta backend. It's tricky because that's per-SQLite connection, but the D1 API doesn't have a concept of a connection
PRAGMA defer_foreign_keys = onON DUPLICATE KEYUPSERTINSERT OR IGNOREALTER TABLEtable_listtable_infotable_infotable_xinfotable_xinfoSELECT * FROM examplePRAGMA foreign_keys=onforeign_keys=1foreign_keys=1foreign_keys=0PRAGMA defer_foreign_keys = onCREATE TABLE example (
fruit TEXT,
fruit_but_lowercase TEXT GENERATED ALWAYS AS (lower(fruit)) VIRTUAL,
vegetable TEXT
);
INSERT INTO example (fruit, vegetable) VALUES
('Apples', 'Carrots'),
('Bananas', 'Broccoli');