give schema to allow drizzle queries
This commit is contained in:
8
packages/web/src/lib/db/index.ts
Normal file
8
packages/web/src/lib/db/index.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import * as schema from './schema'
|
||||
import { drizzle } from 'drizzle-orm/postgres-js';
|
||||
import postgres from 'postgres';
|
||||
|
||||
const client = postgres('postgresql://postgres:postgres@db:5432/db');
|
||||
export const db = drizzle(client, { schema });
|
||||
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
import { relations } from 'drizzle-orm';
|
||||
import { integer, pgTable, serial, timestamp, varchar } from 'drizzle-orm/pg-core';
|
||||
import { drizzle } from 'drizzle-orm/postgres-js';
|
||||
import postgres from 'postgres';
|
||||
|
||||
const client = postgres('postgresql://postgres:postgres@db:5432/db');
|
||||
export const db = drizzle(client, {});
|
||||
|
||||
export const tasks = pgTable('tasks', {
|
||||
id: serial('id').primaryKey(),
|
||||
|
||||
Reference in New Issue
Block a user