Initial commit

This commit is contained in:
agent
2026-03-13 23:21:55 +00:00
commit c8ed262197
113 changed files with 13211 additions and 0 deletions

16
lib/db/src/index.ts Normal file
View File

@@ -0,0 +1,16 @@
import { drizzle } from "drizzle-orm/node-postgres";
import pg from "pg";
import * as schema from "./schema";
const { Pool } = pg;
if (!process.env.DATABASE_URL) {
throw new Error(
"DATABASE_URL must be set. Did you forget to provision a database?",
);
}
export const pool = new Pool({ connectionString: process.env.DATABASE_URL });
export const db = drizzle(pool, { schema });
export * from "./schema";

View File

@@ -0,0 +1,20 @@
// Export your models here. Add one export per file
// export * from "./posts";
//
// Each model/table should ideally be split into different files.
// Each model/table should define a Drizzle table, insert schema, and types:
//
// import { pgTable, text, serial } from "drizzle-orm/pg-core";
// import { createInsertSchema } from "drizzle-zod";
// import { z } from "zod/v4";
//
// export const postsTable = pgTable("posts", {
// id: serial("id").primaryKey(),
// title: text("title").notNull(),
// });
//
// export const insertPostSchema = createInsertSchema(postsTable).omit({ id: true });
// export type InsertPost = z.infer<typeof insertPostSchema>;
// export type Post = typeof postsTable.$inferSelect;
export {}