monolayer-pg / schema / TableDefinition
Type Alias: TableDefinition<T, PK>
TableDefinition<
T
,PK
>:object
Type Parameters
Type Parameter |
---|
T |
PK extends string |
Type declaration
columns?
optional
columns:T
extendsColumnRecord
?T
:never
constraints?
optional
constraints:object
constraints.checks?
optional
checks: (PgCheck
|PgMappedCheck
)[]
constraints.foreignKeys?
optional
foreignKeys: keyofT
extendsstring
? (PgForeignKey
<keyofT
,any
> |PgSelfReferentialForeignKey
<keyofT
,any
> |PgMappedForeignKey
)[] : []
constraints.primaryKey?
optional
primaryKey: keyofT
extendsstring
?PK
[] extends keyofT
[] ?PgPrimaryKey
<keyofT
,PK
> :PgPrimaryKey
<keyofT
,PK
> :never
constraints.unique?
optional
unique: keyofT
extendsstring
?PgUnique
<keyofT
>[] : []
indexes?
optional
indexes: keyofT
extendsstring
? (PgIndex
<keyofT
> |PgMappedIndex
)[] :never
triggers?
optional
triggers: (PgTrigger
<keyofT
extendsstring
? keyofT
:never
> |PgTrigger
<never
> |PgMappedTrigger
)[]