Type Alias Updateable<Q, S>
Updateable: S extends NoTable
? KUpdateable<Q>
: Q extends Kysely<infer DB>
? S extends keyof DB ? KUpdateable<DB[S]> : never
: S extends keyof Q ? KUpdateable<Q[S]> : never
? KUpdateable<Q>
: Q extends Kysely<infer DB>
? S extends keyof DB ? KUpdateable<DB[S]> : never
: S extends keyof Q ? KUpdateable<Q[S]> : never
Type Parameters
Example
// The following three types all describe the data that can be updated in the wrd.entities table:
type WRDEntitiesUpdate = Updateable<PlatformDB, "wrd.entities">;
const mydb = db<PlatformDB>();
type WRDEntitiesUpdate2 = Updateable<typeof mydb, "wrd.entities">;
type WRDEntitiesUpdate3 = Updateable<PlatformDB["wrd.entities"]>;
const updates: WRDEntitiesUpdate = { ... };
const id: number = ...;
await db<PlatformDB>().updateTable("wrd.entities").where("id", "=", id).set(updates).execute();
Converts a Kysely database definition (or type of the Kysely client returned by db()) to the type of the data that can be updated in that table