Skip to main content
Module

x/kysely_deno_postgres_dialect/mod.ts>kysely.Insertable

Kysely dialect for PostgreSQL using the deno-postgres client.
Latest
type alias kysely.Insertable
import { type kysely } from "https://deno.land/x/kysely_deno_postgres_dialect@v0.27.1/mod.ts";
const { Insertable } = kysely;

Given a table interface, extracts the insert type from all ColumnType types.

Examples

interface PersonTable {
  id: Generated<number>
  first_name: string
  modified_at: ColumnType<Date, string, never>
}

type InsertablePerson = Insertable<PersonTable>
// {
//   id?: number,
//   first_name: string
//   modified_at: string
// }
definition: DrainOuterGeneric<[K in NonNullableInsertKeys<R>]: InsertType<R[K]> & [K in NullableInsertKeys<R>]?: InsertType<R[K]>>