const { results } = await stmt.all();results will be an empty array if there were no results, or null if it doesn't apply (that query doesn't return anything).
npx wrangler d1 execute or npx wrangler d1 migrations apply not authorized to use function: strftimeCURRENT_TIMESTAMP works when using it as the default for a column in the schema, but fails when used in any kind of statement (with a "not authorized")?datetime('now') works fine in the statement.PRAGMA foreign_keys = on; command is supported in the docs.const { results } = await stmt.all();resultsnpx wrangler d1 executenpx wrangler d1 migrations applynot authorized to use function: strftimeCURRENT_TIMESTAMPdatetime('now')PRAGMA foreign_keys = on;const { results } = await stmt.all();
if (results && results.length > 0) {