
all() returns a D1Result objectconst { results } = await stmt.all(); to grab just the results propertyconst { 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: strftimeconst results = await stmt.all();
if (results.length > 0) {const { results } = await stmt.all();
if (results && results.length > 0) {not authorized to use function: strftime