foreign key default is set on the experimental backend <:meowthinking:350680941804388352>
foreign key default is set on the experimental backend 

PRAGMA defer_foreign_keys = ondocument and document_type and document has a foreign key of document_type. document is a relatively large table and document_type has 10 or 20 records. What should I do when I want to get data from both tables, using JOIN or SELECT two times and use code to get the final data?


Pass the --d1=BINDING_NAME flag when developing locally. BINDING_NAME should match what call in your code
JS transactionssupport for SQL transactions in the JS API? if so, look into
db.batch (https://developers.cloudflare.com/d1/platform/client-api/#batch-statements)
batch API is not feasible for this 

wrangler.toml, why do we need to specify database_name? it seems redundant, given that you specify the database IDPRAGMA defer_foreign_keys = ondocumentdocumentdocumentdocument_typedocument_typedocument_type (error) Error: D1_ERROR
at D1Database._send (functionsWorker-0.5813307969025092.js:11813:13)
at async D1PreparedStatement.first (functionsWorker-0.5813307969025092.js:11858:7)
at async default (functionsWorker-0.5813307969025092.js:6789:45)
at async handle_action_json_request (functionsWorker-0.5813307969025092.js:8923:19)
at async resolve (functionsWorker-0.5813307969025092.js:11347:22)
at async Object.handle (functionsWorker-0.5813307969025092.js:389:24)
at async respond (functionsWorker-0.5813307969025092.js:11243:22)
at async Object.fetch (functionsWorker-0.5813307969025092.js:11715:13)db.batchbatchdatabase_name