prisma-kysely icon indicating copy to clipboard operation
prisma-kysely copied to clipboard

Wrapped types are not generated as per kysely suggestion

Open khaelys opened this issue 2 years ago • 1 comments

Reading Kysely documentation I noticed they suggest using Insertable, Selectable, and Updatable wrappers.

export interface PetTable {
  id: Generated<number>
  name: string
  owner_id: number
  species: 'dog' | 'cat'
}

// You should not use the table schema interfaces directly. Instead, you should
// use the `Selectable`, `Insertable` and `Updateable` wrappers. These wrappers
// make sure that the correct types are used in each operation.
export type Pet = Selectable<PetTable>
export type NewPet = Insertable<PetTable>
export type PetUpdate = Updateable<PetTable>

It'll be nice if they'll be generated too.

khaelys avatar Oct 03 '23 14:10 khaelys

That would be cool. If you're willing to create a PR for that I'd be more than happy to have a look.

valtyr avatar May 08 '24 00:05 valtyr