I've tried this, but got error with the "env" variable. Any suggestion ?
I've tried this, but got error with the "env" variable. Any suggestion ?
env or bindings in general - once you have env working then D1 will just work as you'd expect normally.CF-IPCountry header ? but should I build a table with states on the east/west cost ... and redirect based on it? or is there a way to get a ping to the D1 center location?request.cf has the data you need: https://developers.cloudflare.com/workers/runtime-apis/request/#incomingrequestcfpropertiesSupport for more than 100,000+ databases for Workers for Platforms users — there’s no limit, but if we said “unlimited” you might not believe us — on top of the 50,000 databases per account that D1 already enables.

ALTER TABLE is supported.value column to store some JSON data, but when I query with json(value) it return the string instead the parsed JSON.json(value) function given in docs - https://developers.cloudflare.com/d1/learning/querying-json/#supported-functions

The json(X) function verifies that its argument X is a valid JSON string and returns a minified version of that JSON string
db.batch()) on D1?100,000 bytes (100 KB) and it should apply. But is there any other limits as well?SELECT statements?ALTER TABLEvaluejson(value) const sqlQuery = ctx.env.DB.prepare(
`
SELECT key, json(value) as value, created_at, updated_at, expire_at
FROM Example
Where account_id = ?
LIMIT ?, ?`
).bind(authUser.account_id, offset, limit);
const { results } = await sqlQuery.all();[
{
"key": "rMDrWHc",
"value": "{\"url\":\"https://agenty.com\",\"params\":{},\"key\":\"rMDrWHc\"}",
"created_at": "2023-12-01 05:27:45",
"updated_at": null,
"expire_at": null
}
]json(value) db.batch()100,000 bytes (100 KB)SELECT