Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Insertable

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
// }
type Insertable<R> = DrainOuterGeneric<[K in NonNullableInsertKeys<R>]: InsertType<R[K]> & [K in NullableInsertKeys<R>]?: InsertType<R[K]>>;