Here's an example: ``` CREATE TABLE "Post" ( "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "a
Here's an example:
CREATE 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 characterslike works but ilike doesn'texport 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"
);
}const 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);