init
This commit is contained in:
parent
3b2ec4fe5f
commit
8086aa8f38
51 changed files with 4109 additions and 0 deletions
6
website/src/lib/server/db/index.ts
Normal file
6
website/src/lib/server/db/index.ts
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import { drizzle } from 'drizzle-orm/postgres-js';
|
||||
import postgres from 'postgres';
|
||||
import { env } from '$env/dynamic/private';
|
||||
if (!env.DATABASE_URL) throw new Error('DATABASE_URL is not set');
|
||||
const client = postgres(env.DATABASE_URL);
|
||||
export const db = drizzle(client);
|
||||
6
website/src/lib/server/db/schema.ts
Normal file
6
website/src/lib/server/db/schema.ts
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import { pgTable, serial, text, integer } from 'drizzle-orm/pg-core';
|
||||
|
||||
export const user = pgTable('user', {
|
||||
id: serial('id').primaryKey(),
|
||||
age: integer('age')
|
||||
});
|
||||
Reference in a new issue