8000 feat: support dbgenerated id type by ludalex · Pull Request #1148 · morintd/prismock · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: support dbgenerated id type #1148

New issue
8000

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 8, 2024
Merged

feat: support dbgenerated id type #1148

merged 1 commit into from
Dec 8, 2024

Conversation

ludalex
Copy link
Contributor
@ludalex ludalex commented Oct 31, 2024

This adds support for having dbgenerated() ids in your schema while still being able to use prismock to create entries without explicitly passing the id.

Previously, in a schema file with ids defined like this:

model Thing {
  id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
  ...

Calling prismock.thing.create({}) would result in an object with an undefined id.

@jkar32
Copy link
jkar32 commented Dec 2, 2024

Something akin to this would be legendary.

@morintd morintd merged commit 3ae786f into morintd:master Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0