patrick
Explore posts from serversDTDrizzle 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