Is it possible to request an increase in the column limit of 100? If so, what's the best route to d
Is it possible to request an increase in the column limit of 100? If so, what's the best route to do that on the Worker Paid plan?
pivot or crosstab queries, calendar querying (for the type of data I'm dealing with) is very complex. I'd like to try a different approach. One column per day per resource with the value of the availability stored as a tinyint.SELECT id FROM projects WHERE url = ? then SELECT something FROM metadata WHERE id = ? using that ID (where there could be multiple somethings in the latter table).
The Cache API can be thought of as an ephemeral key-value store, whereby the Request object (or more specifically, the request URL) is the key, and the Response is the value.

.get(key) and .put(key,value)EXPLAIN QUERY PLAN SELECT * FROM objects WHERE object = '${key}' and it'll tell you what it's doing

null...pivotcrosstabtinyintSELECT id FROM projects WHERE url = ?SELECT something FROM metadata WHERE id = ?something.get(key).put(key,value)EXPLAIN QUERY PLAN SELECT * FROM objects WHERE object = '${key}'To execute a transaction, please use the state.storage.transaction() API instead of the SQL BEGIN TRANSACTION or SAVEPOINT statements. The JavaScript API is safer because it will automatically roll back on exceptions, and because it interacts correctly with Durable Objects' automatic atomic write coalescing.
Error: D1_ERROR: not authorized
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)export const user = sqliteTable('user', {
id: integer('id').notNull().primaryKey(),
avatarId: text('avatar_id', { mode: 'text', length: 255 }),
});export const user = sqliteTable('user', {
id: integer('id').notNull().primaryKey(),
avatarId: integer('avatar_id').references(() => media.id, { onDelete: 'set null' }),
});
// ...
export const media = sqliteTable('media', {
id: integer('id').notNull().primaryKey(),
createdAt: integer('created_at', { mode: 'timestamp' })
.notNull()
.default(sql`(unixepoch())`),
updatedAt: integer('updated_at', { mode: 'timestamp' })
.notNull()
.default(sql`(unixepoch())`),
fileName: text('file_name', { mode: 'text', length: 255 }).notNull(),
mediaType: text('file_type', { mode: 'text' }).notNull(),
mimeType: text('mime_type', { mode: 'text', length: 100 }).notNull(),
size: integer('size', { mode: 'number' }).notNull(),
width: integer('width', { mode: 'number' }).notNull(),
height: integer('height', { mode: 'number' }).notNull(),
src: text('src', { mode: 'text' }).notNull(),
srcSet: text('srcset').notNull(),
alt: text('alt', { mode: 'text' }).notNull(),
});-- RedefineTables
PRAGMA defer_foreign_keys=ON;
CREATE TABLE "new_Product" (
"id" TEXT NOT NULL PRIMARY KEY,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" DATETIME NOT NULL,
"name" TEXT NOT NULL,
"description" TEXT,
...some more rows
CONSTRAINT "Product_eventId_fkey" FOREIGN KEY ("eventId") REFERENCES "Event" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT "Product_totalCapacityId_fkey" FOREIGN KEY ("totalCapacityId") REFERENCES "Capacity" ("id") ON DELETE SET NULL ON UPDATE CASCADE
);
INSERT INTO "new_Product" ("createdAt", "description", "id", "name", "updatedAt", ...) SELECT "createdAt", "description", "id", "name", "updatedAt", ... FROM "Product";
DROP TABLE "Product";
ALTER TABLE "new_Product" RENAME TO "Product";
PRAGMA foreign_key_check("Product");
PRAGMA defer_foreign_keys=OFF;