Skip to content
New issue

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

Wrapped types are not generated as per kysely suggestion #81

Open
khaelys opened this issue Oct 3, 2023 · 1 comment · May be fixed by #85
Open

Wrapped types are not generated as per kysely suggestion #81

khaelys opened this issue Oct 3, 2023 · 1 comment · May be fixed by #85
Labels
enhancement New feature or request

Comments

@khaelys
Copy link

khaelys commented Oct 3, 2023

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.

@taro-kayo taro-kayo linked a pull request Oct 28, 2023 that will close this issue
@valtyr
Copy link
Owner

valtyr commented May 8, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants