patrick
Explore posts from serversDTDrizzle Team
•Created by patrick on 12/18/2024 in #help
drizzle-zod 0.6.0 breaks my createSelectSchema vs 0.5.1
I am on drizzle-orm 0.38.2, zod: 3.24.1
3 replies
DTDrizzle Team
•Created by nahtnam on 11/21/2024 in #help
Circular Reference in Schema Relation
seems to be related to the order esm modules are getting evaluated. i have a circular reference between two pgTables in two modules, and now none of my other tables can refer to one of those two in the circle without migrate failing.
12 replies
DTDrizzle Team
•Created by nahtnam on 11/21/2024 in #help
Circular Reference in Schema Relation
drizzle migrate
tool fails with TypeError: Cannot read properties of undefined (reading 'id') at mytable.myfield.references.onDelete
12 replies
DTDrizzle Team
•Created by nahtnam on 11/21/2024 in #help
Circular Reference in Schema Relation
did you get this to work with those onDelete: "cascades" in there? I am failing to get that to work!
12 replies
DTDrizzle Team
•Created by patrick on 7/23/2024 in #help
update multiple rows with uuid id's
without any cast(xxx as uuid)....
3 replies
DTDrizzle Team
•Created by patrick on 7/23/2024 in #help
update multiple rows with uuid id's
when I execute this directly against Postgres it succeeds, which is weird...
3 replies
DTDrizzle Team
•Created by micaww on 8/14/2023 in #help
Is there a way to declare a custom SQL index?
did this ever happen?
6 replies
DTDrizzle Team
•Created by patrick on 9/6/2023 in #help
drizzle-kit failing with Top-level await is currently not supported with the "cjs" output format
ahh, it seems if i remove my async functions to another file, that fixes it...
6 replies
DTDrizzle Team
•Created by patrick on 9/6/2023 in #help
drizzle-kit failing with Top-level await is currently not supported with the "cjs" output format
import { pgTable, serial, text, varchar } from "drizzle-orm/pg-core";
import { db } from "../db";
export const users = pgTable("users", {
id: serial("id").primaryKey(),
givenName: text("givenName"),
surname: text("surname"),
email: varchar("email"),
});
export type User = typeof users.$inferSelect; // return type when queried
export type NewUser = typeof users.$inferInsert; // insert type
export async function getUsers(): Promise<User[]> {
return await db.select().from(users);
}
export async function insertUser(user: NewUser): Promise<User[]> {
return db.insert(users).values(user).returning();
}
6 replies
DTDrizzle Team
•Created by patrick on 9/6/2023 in #help
drizzle-kit failing with Top-level await is currently not supported with the "cjs" output format
it exports a couple of async functions...
6 replies