Questions

Questions
16 Replies
Isaac McFadyen
Isaac McFadyenOP3y ago
here @albertsp
asp
asp3y ago
Does this limitation cover SELECT/INSERT queries; or does it cover rows selected/inserted?
lukeed
lukeed3y ago
how firm is the 20MB total storage limit? Are the reads/writes limits a per-database limit or totaled across all DBs? How far off are pricing details? no egress is great, but would be good to know/plan workloads according to operations' pricing metrics
Isaac McFadyen
Isaac McFadyenOP3y ago
How scalable will read/write numbers be in the future? Read replicas will scale reads but are writes very scalable?
asp
asp3y ago
I am also curious if this is a hard rate limit or just the expected performance level?
lukeed
lukeed3y ago
(betas are always released w/ significantly low limits to meter performance & monitor scaling. r2 limits are low right now too, but are 100% not reflective of prod-ready performance)
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
John Spurlock
John Spurlock3y ago
wait, no transactions? : ) also, any plans on supporting sqlite's json extensions? they are so good
asp
asp3y ago
@sven continuing here in the #Questions thread… The projects I have in mind just require simple SELECT … LIMIT 1 or COUNT operations. Is the limit just a rough estimate of the performance achievable with the current resource allocations? Or is it a hard rate limit?
John Spurlock
John Spurlock3y ago
curious: any reason why db uuids are formatted with dashes instead of the normal cf ids without dashes used everywhere else in the api? does the /d1/database/${databaseUuid}/query api endpoint accept an array of bound statements to issue multiple queries (with params) at once? if passed an array, it seems to want a string as the first element, then a "D1Request struct", I can't figure it out - tried:
[ { sql, params } ]
[ { sql, params } ]
and
[ "foo", { sql, params } ]
[ "foo", { sql, params } ]
both of which fail with internal error works fine for the single query case:
{ sql, params }
{ sql, params }
and that sql can be multiple statements, but then params are not supported
Isaac McFadyen
Isaac McFadyenOP3y ago
Just curious: where'd you find the actual fetch endpoints? Just by examining the package code?
John Spurlock
John Spurlock3y ago
https://github.com/cloudflare/wrangler2/compare/main...d1 i don't believe all of the functions in the runtime bindings surface area have corresponding rest api calls yet, I'm hoping they do/will do eventually but /query with { sql, params } as the post body does work
Isaac McFadyen
Isaac McFadyenOP3y ago
Yeah. In answer to your question:
async batch<T>(statements: Array<PreparedStatement>): Promise<Array<SQLSuccess<T>>> {
const exec = await this._send(
"/query",
statements.map((s: PreparedStatement) => s.statement),
statements.map((s: PreparedStatement) => s.params)
);
return exec as Array<SQLSuccess<T>>;
}
async batch<T>(statements: Array<PreparedStatement>): Promise<Array<SQLSuccess<T>>> {
const exec = await this._send(
"/query",
statements.map((s: PreparedStatement) => s.statement),
statements.map((s: PreparedStatement) => s.params)
);
return exec as Array<SQLSuccess<T>>;
}
One sec, looking at _send.
John Spurlock
John Spurlock3y ago
doesn't work tho, that doesn't end up calling the rest api i don't think - it calls some sort of magic binding
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server