Support adding prefix to an `@id` field
Open
Nobody has claimed this yet.
kind/feature
topic: default
topic: extend-client
topic: schema
- Dominant language
- TypeScript
- Stars
- 47.6k
- Forks
- 2.5k
- Avg merge
- 21h 59m
- Merged PRs (30d)
- 95
Description
model User {
id String @default(cuid()) @id
}
It works. But I want to generate an Id that is easier to refer like user_c2ajhsad8923jiesd, company_c3jkasdhjkhaskd
Something like this could be helpful, thanks :)
model User {
id String @default("user_" + cuid()) @id
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file, test, or entry point is named. Start by reviewing the 39-comment discussion and the ORM's existing @id and cuid handling to clarify the supported expression semantics. Done means a schema can generate an @id with a configured prefix and the resulting value follows the requested format.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100