1- import {
2- ColumnType ,
3- Generated ,
4- Insertable ,
5- Selectable ,
6- Updateable ,
7- } from "kysely" ;
1+ import { kysely } from "../../deps.ts" ;
82
93export interface Database {
104 person : PersonTable ;
@@ -15,7 +9,7 @@ export interface PersonTable {
159 // Columns that are generated by the database should be marked
1610 // using the `Generated` type. This way they are automatically
1711 // made optional in inserts and updates.
18- id : Generated < number > ;
12+ id : kysely . Generated < number > ;
1913
2014 first_name : string ;
2115 gender : "man" | "woman" | "other" ;
@@ -30,23 +24,23 @@ export interface PersonTable {
3024 // wrapper. Here we define a column `created_at` that is selected as
3125 // a `Date`, can optionally be provided as a `string` in inserts and
3226 // can never be updated:
33- created_at : ColumnType < Date , string | undefined , never > ;
27+ created_at : kysely . ColumnType < Date , string | undefined , never > ;
3428}
3529
3630// You should not use the table schema interfaces directly. Instead, you should
3731// use the `Selectable`, `Insertable` and `Updateable` wrappers. These wrappers
3832// make sure that the correct types are used in each operation.
39- export type Person = Selectable < PersonTable > ;
40- export type NewPerson = Insertable < PersonTable > ;
41- export type PersonUpdate = Updateable < PersonTable > ;
33+ export type Person = kysely . Selectable < PersonTable > ;
34+ export type NewPerson = kysely . Insertable < PersonTable > ;
35+ export type PersonUpdate = kysely . Updateable < PersonTable > ;
4236
4337export interface PetTable {
44- id : Generated < number > ;
38+ id : kysely . Generated < number > ;
4539 name : string ;
4640 owner_id : number ;
4741 species : "dog" | "cat" ;
4842}
4943
50- export type Pet = Selectable < PetTable > ;
51- export type NewPet = Insertable < PetTable > ;
52- export type PetUpdate = Updateable < PetTable > ;
44+ export type Pet = kysely . Selectable < PetTable > ;
45+ export type NewPet = kysely . Insertable < PetTable > ;
46+ export type PetUpdate = kysely . Updateable < PetTable > ;
0 commit comments