import { PostgresRecordModel } from './PostgresRecordModel'; import { PostgresTriggerModel } from './PostgresTriggerModel'; export type PropKeyOf = keyof S['properties'] & string; export type Nulls = '' | ' NULLS FIRST' | ' NULLS LAST' | ' nulls first' | ' nulls last'; export type Order = '' | ' ASC' | ' DESC' | ' asc' | ' desc'; export type Mods = `${Nulls}${Order}` | `${Order}${Nulls}`; export type IndexColumn = PropKeyOf | `${PropKeyOf}${Mods}`; export type Columns = IndexColumn | readonly IndexColumn[]; export type IndexesOf = readonly (Columns | { columns: Columns; name?: string; })[]; export type PostgresTableModel = { readonly schema: S; readonly indexes?: IndexesOf; readonly docs?: any[]; readonly primaryKey?: keyof S['properties'] | readonly (keyof S['properties'])[]; readonly foreignKeys?: Partial>; readonly triggers?: readonly PostgresTriggerModel[]; readonly unique?: keyof S['properties'] | readonly (keyof S['properties'])[]; };