Right, but you can only do that with a permanently on computer. I'd like to call an API from a cron
Right, but you can only do that with a permanently on computer. I'd like to call an API from a cron worker to do this.
Cannot create a string longer than 0x1fffffe8 characterslike works but ilike doesn'tCREATE TABLE "Post" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"authorId" INTEGER,
CONSTRAINT "Post_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES "User" ("id") ON DELETE SET NULL ON UPDATE CASCADE
);
CREATE TABLE "User" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT
);Cannot create a string longer than 0x1fffffe8 charactersexport async function searchByFontFamilyName(db: DB, search: string) {
return db
.select({
family: table_fonts.family,
})
.from(table_fonts)
.where(
ilike(table_fonts.family, `%${search}%`), // search: "nato"
);
}Query: select "family" from "fonts" where "fonts"."family" ilike ? -- params: ["%nato%"]D1_ERROR: near \"ilike\": syntax error at offset 66likeilikeconst insertedOptionValues = await c.env.DB.prepare(`INSERT INTO optionValues (optionId, valueName) VALUES (?, ?), (?, ?), (? ,? )`)
.bind(optionId, valueName[0], optionId, valueName[1], optionId, valueName[2])
.run();const ps = c.env.DB.prepare(`INSERT INTO optionValues (optionId, valueName) VALUES (?, ?)`);
const queries = [];
for(const row of rows) {
queries.push(ps.bind(...row));
}
await c.env.DB.batch(queries);