Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

227
Views
How to have Custom ids in prisma / postgresql?

I am using Prisma + PostgreSQL for my data. So far, I have been using ids generated by Prisma:

id             String           @id @default(cuid())

However, I'd like to use my own ids, something like ABCD-WXYZ, as my data will not grow so much and I'd like to have shorter ids and be able to see what the item is about using the id (e.g. PULP-FICT might represent the film Pulp Fiction, and I would easily be able to remember it this way.

How can I achieve this with Prisma + PostgreSQL?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can manually specify id values and not have any default like this:

id        String   @id

In such a case, you would have to manually specify the id field when creating a new object. If you'd like to use some arbitrary database function to generate default values for the field, you can also take a look at dbgenerated().

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!