patrick
patrick
Explore posts from servers
DTDrizzle 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...
update shows
set gross = (case when id = '397ac0a7-d8e3-4a2e-8dcf-789ee99638a5' then 1 end)
where id in ('397ac0a7-d8e3-4a2e-8dcf-789ee99638a5')
update shows
set gross = (case when id = '397ac0a7-d8e3-4a2e-8dcf-789ee99638a5' then 1 end)
where id in ('397ac0a7-d8e3-4a2e-8dcf-789ee99638a5')
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
TtRPC
Created by patrick on 9/8/2023 in #❓-help
query with no input reports error
also, important data point, it compiles with tsc and esbuild just fine, and runs just fine, this is a VSCode only error!?
4 replies
TtRPC
Created by patrick on 9/8/2023 in #❓-help
query with no input reports error
I just checked and nothing has changed in createTPCReact.tsx in 9 months, so it must be something i am doing wrong.
4 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