`json_each` - https://developers.cloudflare.com/d1/learning/querying-json/#supported-functions
D1 has built-in support for querying and parsing JSON data stored within a database. This enables you to:

__D1_BETA__DB__D1_BETA__DB and you will see lots of convos about it might be able to find something to fix it there
cf-bindings-proxy (v0.5.0) to fix this bug. expires_at column and using that in your queries (and indexes) can get you there. You can do a cleanup with another trigger or a Cron Trigger Worker that runs periodically and separately cleans up WHERE expires_at < now()__D1_BETA__DB const [{ results: sessionResults},{ results: userFromJoinResults }]
= (await db.batch([ getSessionStatement, getUserFromJoinStatement
])); const batchRes = (await db.batch([
getSessionStatement,
getUserFromJoinStatement
]));
const sessionResults = batchRes[0].results
const userFromJoinResults = batchRes[1].resultscf-bindings-proxyexpires_atWHERE expires_at < now()