N
Neon2y ago
foreign-sapphire

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
rival-black
rival-black2y ago
No description
rival-black
rival-black2y 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
rival-black
rival-black2y ago
my actual neon table schema is something like this
No description
rival-black
rival-black2y 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
foreign-sapphire
foreign-sapphire2y 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?