

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 IDpreview_ :^)ms to s, but no, the query really did only take 0.3msstmt.raw() return an empty array or null if there are no results? (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_namepreview_mssstmt.raw()[[d1_databases]]
binding = "MY_DB" # i.e. available in your Worker on env.DB
database_name = "...."
database_id = "..."