Yeaba_12
Yeaba_12
DTDrizzle Team
Created by lucasp on 12/12/2024 in #help
im getting problems with drizzle schemas
and if you use node you can make it like this ->>> app.get('/', async c => { // Destructure and combine schemas explicitly const schema = { ...userSchema, ...giverSchema, ...transportistSchema, } const db = drizzle(c.env.DB, { schema }) const res = await db.query.user.findMany({ with: { cargoGiver: true } }) return c.json(res) })
9 replies
DTDrizzle Team
Created by lucasp on 12/12/2024 in #help
im getting problems with drizzle schemas
and when importing and using the schema, make sure you're importing all necessary components and some thing like this in another file -> import * as userSchema from './config/schema/users.schema' import * as giverSchema from './config/schema/cargoGiver.schema' import * as transportistSchema from './config/schema/transportist.schema'
9 replies
DTDrizzle Team
Created by lucasp on 12/12/2024 in #help
im getting problems with drizzle schemas
Make sure to export everything that's needed export { trailer, documentTransportist, unit, offer // ... any other related tables }
9 replies
DTDrizzle Team
Created by Yeaba_12 on 12/12/2024 in #help
drizzle-postgresql migratin error using nestjs framework
and for this my drizzle-config file was like this -> import { defineConfig } from 'drizzle-kit'; export default defineConfig({ out: './drizzle', schema: './src/**/schema.ts', dialect: 'postgresql', dbCredentials: { url: process.env.DATABASE_URL!, }, });
2 replies
DTDrizzle Team
Created by lucasp on 12/12/2024 in #help
im getting problems with drizzle schemas
First, make sure all your schema files are exporting their tables and relations correctly. Looking at your transportist schema file, modify the exports to be explicit
9 replies