NyxSR
NyxSR
DTDrizzle Team
Created by NyxSR on 3/17/2024 in #help
db.query throwing undefined is not an object (evaluating 'relation.referencedTable')
Thanks a lot @Mykhailo , that works !
7 replies
DTDrizzle Team
Created by NyxSR on 3/17/2024 in #help
db.query throwing undefined is not an object (evaluating 'relation.referencedTable')
Ahh i see, let me try that
7 replies
DTDrizzle Team
Created by NyxSR on 3/17/2024 in #help
db.query throwing undefined is not an object (evaluating 'relation.referencedTable')
No description
7 replies
DTDrizzle Team
Created by NyxSR on 3/17/2024 in #help
db.query throwing undefined is not an object (evaluating 'relation.referencedTable')
So i've created a file called db.ts
// db.ts
import "dotenv/config";
import { drizzle } from 'drizzle-orm/postgres-js';
import postgres from "postgres";
import * as schema from '@/db/schema'

const postgresURI: string = process.env.POSTGRES_URI!

export const sql = postgres(postgresURI, {max: 1})

export const db = drizzle(sql, { schema });
// db.ts
import "dotenv/config";
import { drizzle } from 'drizzle-orm/postgres-js';
import postgres from "postgres";
import * as schema from '@/db/schema'

const postgresURI: string = process.env.POSTGRES_URI!

export const sql = postgres(postgresURI, {max: 1})

export const db = drizzle(sql, { schema });
7 replies
DTDrizzle Team
Created by IgnisMurasaki on 3/18/2024 in #help
having trouble to include relations with query function
5 replies