I tested deploying a worker, the query time seems ok but the response time is too slow to be accepta
I tested deploying a worker, the query time seems ok but the response time is too slow to be acceptable

D1PreparedStatement has a statement property, but TS doesn't know about itpreparedStatement.statement is not meant to be used by client Worker code (i.e. you). You have access to the statement since you are the one providing it to the prepare() method, so use that instead.prepare() and optionally bind(), only call these methods: https://developers.cloudflare.com/d1/worker-api/prepared-statements/When using Durable Objects, it's important to remember that they are intended to scale out, not up. A single object is inherently limited in throughput since it runs on a single thread of a single machine. To handle more traffic, you create more objects. This is easiest when different objects can handle different logical units of state (like different documents, different users, or different "shards" of a database), where each unit of state has low enough traffic to be handled by a single object.
wrangler d1 command, is there any way to change the output mode to be insert? --json flag value
const [ widget ] = await db.select().from(schema.widgets).where( eq(schema.widgets.id, widget_id) ).limit(1)D1PreparedStatementstatementTSpreparedStatement.statementprepare()prepare()bind()wrangler d1insert--jsonwrangler d1 backup create cyguro-db-dev
✘ [ERROR] A request to the Cloudflare API (/accounts/2d2da569ea5c41d87eba7d610279d290/d1/database/c25c6f21-3669-4672-9eaf-58242589258c/backup) failed.
The request is malformed: Only alpha D1 databases support backups. Production databases support
time-travel: c25c6f21-3669-4672-9eaf-58242589258c (v3) [code: 7400]// This code works
const ps = env.DB.prepare(pragmaStmts[key]);
const data = await ps.all();
jsonData.push({ statement: ps.statement, [key]: data.results });
//ts complains:
`Property 'statement' does not exist on type 'D1PreparedStatement'.ts(2339)`# npm ls
@cloudflare/workers-types@4.20241230.0