feat: db seeding

This commit is contained in:
2025-01-08 16:42:37 +01:00
parent e7383877df
commit 2a2a9f99bf
2 changed files with 13 additions and 2 deletions

View File

@@ -0,0 +1,10 @@
import { topics } from "./schema"
import * as schema from './schema'
import { drizzle } from 'drizzle-orm/postgres-js';
import postgres from 'postgres';
const client = postgres('postgresql://postgres:postgres@localhost:5432/db');
const db = drizzle(client, { schema });
db.insert(topics).values([{ name: 'Math', emoji: '👍' }, { name: 'Programming', emoji: '👍' }])