A_Dev
A_Dev
DTDrizzle Team
Created by A_Dev on 10/22/2024 in #help
Pgschema
Hi all, can anyone guide me on the correct syntax for querying from a table with a table schema? Everything in public works fine with like db.query.publictable.findmany but as soon as I have a table with a custom db schema like myschema.table and I’ve added it to db I can’t query with db.query.myschema.table.findmany
2 replies
DTDrizzle Team
Created by A_Dev on 1/21/2024 in #help
reference composite primary key
I have a table with a composite primary key. I’m using the return object to make it by passing in the columns to primaryKey. How do I then use that as a foreign key in a child table? I tried referencing the return object but that doesn’t work.
1 replies
DTDrizzle Team
Created by A_Dev on 11/28/2023 in #help
Push with schema in separate files
I have my schemas setup something like customer.ts vendor.ts inventory.ts public.ts In my config I have schema: "./app/lib/data/db/schema/*" In public.ts I am creating tables with pgTable but in the non public ts files I am creating a schema with export const customer = pgSchema("customer") and then creating tables with export const customerTable = customer.table("customer", {fieilds here}) When I run drizzle-kit push:pg all that is created is anything in the public file and pgTable What am I missing?
13 replies