@RexNormous Did you end up implementing this? Any pointers would be great.
@RexNormous Did you end up implementing this? Any pointers would be great.
wrangler d1 execute and wrangler d1 migrations apply now default to using a local database, to match the default behavior of wrangler dev.33 entries at a time before the server hits me with a 500 Internal Server Error. When concatinating the SQL query myself I found that I can go up to a query length of 10000 characters. Depending on the length of my input values I can insert more than 3000 entries at a time with this method. This could be however a security risk as I understand.wrangler, without needing to be logged in to a Cloudflare Account?npx wrangler d1 create database_namenpx wrangler d1 info, but yea would be nice in dash
; to the HTTP API if that works for you, but there are limits. Query string can be 10000 chars max and if you are sending params with the request I guess there is a limit of 100.D1Response is supposed to contain an error field, but the type is never? When I console log the error it says the error is D1_Error, so is there a way I catch this error in a type-safe way so I can determine the error message?
const e_error = e as unknown as Error and it works fineany, even unknown is questionable to use lolnever is very useful as a type to specify that something should never be set.bind() API to bind variables based on JS values.SELECT * FROM table WHERE name = ? and then you can bind a value for name binding D1USEAST of type d1 failed to generate. Please try again later or contact support. [code: 10021]wrangler d1 executewrangler d1 migrations apply{
sql: 'INSERT INTO "table" ("a", "b", "c") VALUES (?, ?, ?)',
params: [...],
}33500 Internal Server Error1000010000npx wrangler d1 create database_namenpx wrangler d1 info100D1ResponseD1_Error// Check if the user already exists
const checkUserQuery = 'SELECT Username FROM User WHERE Username = ?';
const checkUserStmt = env.usersDB.prepare(checkUserQuery);
console.log("existing user statement")
console.log(checkUserStmt)
let existingUser;
try {
existingUser = await checkUserStmt.bind(username).all();
}
catch (e)
{
console.log("Received Error")
console.log(e)
}const e_error = e as unknown as ErrorSELECT * FROM table WHERE name = ?