0.0.4 • Published 1 year ago

prisma-selections v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Prisma Selections

Prisma selections allow you to define "select aliases", so instead of writing:

const user = await prisma.user.findUnique({
  select: {
    id: true,
    fullName: true,
    username: true,
    avatarUrl: true,
    // ...
  }
})

You can write this instead:

const user = await prisma.user.findUnique({
  select: selections.user({
    $profileData: true,
    // ...
  })
})

And fully leverage the powerful intellisense provided by Prisma's TypeScript types!

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago