© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•2y ago•
1 reply
Shezan

Best/recommended column type for Id - Drizzle Neon

Hi everyone. I am using Drizzle, Next.js 14 app router & Neon serverless. Could anyone help me sharing the best column type for id field in a table? I think a solution that is auto generating, random, yet not very large (like UUID) is best.

Most tutorials show a type of either text or serial. But text does not automatically set the Id, so I can't use insert without providing an id field. Serial is auto incrementing, but I read that such auto incrementing id is bad for security (ids being predictable). UUID is another option but they take up a lot of space & have some other downsides (https://dev.to/harshhhdev/uuidguid-cuid-nanoid-whats-the-difference-5dj1) . So which one should I use?

I would love if you could share a short example with your answer. Thank you.
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Drizzle rename id column
Drizzle TeamDTDrizzle Team / help
3y ago
column "player_id" cannot be cast automatically to type uuid in drizzle ORM
Drizzle TeamDTDrizzle Team / help
2y ago
How to Reference a Column Type in Drizzle
Drizzle TeamDTDrizzle Team / help
2y ago