Yeah, that’s the way. There is *sort of* a way to do globals, but it shouldn’t give you much of a be
Yeah, that’s the way. There is sort of a way to do globals, but it shouldn’t give you much of a benefit since Drizzle itself is stateless
await DB.prepare('SELECT col FROM table WHERE col1 = ?2 AND col2 = ?1 AND col3 = ?1').bind(1, 2).run()SELECT file_id FROM file WHERE ref_id = '123' shows "rows_read": 2. Does it mean that reading index is also counted as well as reading the data?npx wrangler d1 migrations --help / npx wrangler d1 migrations apply --help lists persist-to as a valid option?--help output? Also is there any way to prevent this replication? Like when does that happen? If for anyone outside of an specific region no DB access happens, does that mean no replication is happening either?There is no replication at the moment. Once it's out, we will have some control for jurisdictions once those are added for D1.
meta object, and the dashboard will show it soon as well.Or does it count rows that were checked and not returned as well?All rows read are counted. From indices, non-indices, views, etc.


newUser.id and account.id from the first two queries to use in the third one. Since the queries are in an array, I can't assign these values to a constant. Is there a way to achieve this within a single batch, or do I need to split it into two?await DB.prepare('SELECT col FROM table WHERE col1 = ?2 AND col2 = ?1 AND col3 = ?1').bind(1, 2).run()SELECT file_id FROM file WHERE ref_id = '123'"rows_read": 2npx wrangler d1 migrations --helpnpx wrangler d1 migrations apply --helppersist-to--helpmetanewUser.idaccount.idif (e.message.startsWith(`D1_ERROR: UNIQUE constraint failed:`)){
throw createError({statusCode:400, statusMessage:`Your name needs to be unique`})
}