improve backend logic

This commit is contained in:
Ishaan Dey
2024-04-21 22:55:49 -04:00
parent e7ca2d0124
commit 14d95eb8fe
12 changed files with 296 additions and 31 deletions

View File

@ -13,6 +13,8 @@ export interface Env {
DB: D1Database;
}
// https://github.com/drizzle-team/drizzle-orm/tree/main/examples/cloudflare-d1
export default {
async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
const url = new URL(request.url);

View File

@ -25,6 +25,7 @@ export const sandbox = sqliteTable("sandbox", {
name: text("name").notNull(),
type: text("type", { enum: ["react", "node"] }).notNull(),
bucket: text("bucket"),
init: integer("init", { mode: "boolean" }).default(false),
userId: text("user_id")
.notNull()
.references(() => user.id),