Created
April 25, 2024 19:36
-
-
Save PaulieScanlon/ac2500b9fb526532e32aacade17e19ab to your computer and use it in GitHub Desktop.
Kysely generated types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ./kysely-db.d.ts | |
import type { ColumnType } from 'kysely'; | |
export type Generated<T> = T extends ColumnType<infer S, infer I, infer U> | |
? ColumnType<S, I | undefined, U> | |
: ColumnType<T, T | undefined, T>; | |
export interface Users { | |
country: string | null; | |
email: string; | |
first_name: string; | |
id: Generated<number>; | |
last_name: string; | |
} | |
export interface DB { | |
users: Users; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment