Anyone know why BLOB fields return `number[]` instead of `ArrayBuffer`? Seems weird because the docs

Anyone know why BLOB fields return number[] instead of ArrayBuffer? Seems weird because the docs show that they should map to ArrayBuffers.
14 Replies
Unknown User
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
Walshy
Walshy•2mo ago
what's your ticket id?
Unknown User
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
Walshy
Walshy•2mo ago
I've escalated it to support to check on
Unknown User
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
shellsort
shellsort•2mo ago
Using rusts prepare and all functions, I execute an sql statement in my scheduled worker using the --test-scheduled flag of wrangler and then running
curl "http://localhost:8787/__scheduled?cron=*+*+*+*+*"
curl "http://localhost:8787/__scheduled?cron=*+*+*+*+*"
to simulate a scheduled event instantly. This returns an error:
Error: Error: D1_ERROR: no such table: image: SQLITE_ERROR - Cause: Error: D1_ERROR: no such table: image: SQLITE_ERROR
Error: Error: D1_ERROR: no such table: image: SQLITE_ERROR - Cause: Error: D1_ERROR: no such table: image: SQLITE_ERROR
When executing the same statement via the REST API I get the expected result. I tried wrapping the table name in ' ' marks, but get the same result. Does anyone have an idea? Yes it's the same database. Yes I double checked the table name. It's a really simple sql statement too. No joins or anything like that happening. Just good old select x from y when z. -> Fixed. Resolve was using the --remote flag/creating a local dev d1 db.
Unknown User
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
moonchav
moonchav•2mo ago
is it possible to bind multiple D1 dbs to a single worker? And is it possible to bind a single D1 db to multiple workers?
Isaac McFadyen
Isaac McFadyen•2mo ago
Yes and yes 😄 Just bind it like normal in your wrangler.toml but specify multiple of them
moonchav
moonchav•2mo ago
oh sweet, thank you! I should have just rolled the dice and tried it before asking 😄
Isaac McFadyen
Isaac McFadyen•2mo ago
No problem :lul:
veeque
veeque•2mo ago
in my wrangler.toml file I have this:
[[d1_databases]]
binding = "db"
database_name = "prod-main"
database_id = "[uuid1]"
preview_database_id = "[uuid2]"
[[d1_databases]]
binding = "db"
database_name = "prod-main"
database_id = "[uuid1]"
preview_database_id = "[uuid2]"
(it's a sveltekit app) however the preview deployments still use the production database... I thought that setting the preview_database_id to the uuid of the preview database would suffice, but apparently it doesn't. In the D1 documentation I could only find https://developers.cloudflare.com/d1/configuration/environments/ but the config used looks vastly different than mine. what do I have to do? 😅
Hard@Work
Hard@Work•2mo ago
IIRC preview IDs aren't used for anything on pages. You need to add a database_id to the preview env
veeque
veeque•2mo ago
and that env is set to be the staging one by preview deployments without me having anything to do, right? ah ok, i see now, ty
Want results from more Discord servers?
Add your server