BiffBaffBoff
BiffBaffBoff
Explore posts from servers
SSolidJS
Created by omfj on 7/14/2024 in #support
How do get Cloudflare bindings in dev?
Sorry to drag up an old post, has this improved at all? I followed Ryan's guide here: https://ryanjc.com/blog/solidstart-cloudflare-pages/ but it just wasn't working locally (I tried D1 and R2).
4 replies
DTDrizzle Team
Created by BiffBaffBoff on 12/20/2023 in #help
How to use the Batch API?
Ah nvm, sorry it does work, needed to do this:
if (isTuple(ins)) {
await db.batch(ins)
}
if (isTuple(ins)) {
await db.batch(ins)
}
Thanks again for your help
7 replies
DTDrizzle Team
Created by BiffBaffBoff on 12/20/2023 in #help
How to use the Batch API?
Hiya, thanks for the reply but that still doesnt work:
function isTuple<T>(array: T[]): array is [T, ...T[]] {
return array.length > 0
}
function isTuple<T>(array: T[]): array is [T, ...T[]] {
return array.length > 0
}
Further down:
if (isTuple(peopleArray)) {
const ins = peopleArray.map((p) => db.insert(people).values(p))
await db.batch(ins)
}
if (isTuple(peopleArray)) {
const ins = peopleArray.map((p) => db.insert(people).values(p))
await db.batch(ins)
}
Error: Source provides no match for required element at position 0 in target
7 replies