N
Neon2y ago
wee-brown

Can you share the error and schema?

Can you share the error and schema? Usually something sensible like a serial type is fine: https://github.com/evanshortiss/vercel-neon-drizzle-next/blob/main/src/db/schema.ts#L4
5 Replies
correct-apricot
correct-apricot2y ago
No description
correct-apricot
correct-apricot2y ago
as you can see there i've a type error if i don't pass in an id, it means i need to pass in a default value to the id
correct-apricot
correct-apricot2y ago
my actual neon table schema is something like this
No description
correct-apricot
correct-apricot2y ago
am asking for what to put in the default value:
id: text('id').primaryKey().default('gen_random_uuid()').notNull(),
id: text('id').primaryKey().default('gen_random_uuid()').notNull(),
what does Neon uses so i can put it there in the default value to generate the ids and shut up the type system
national-gold
national-gold2y ago
Change it from text to serial Of course, you can use uuid if you like. Neon doesn't have opinions about what you choose to use.

Did you find this page helpful?