monolayer / 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
|PgUnmanagedCheck
)[]
constraints.foreignKeys?
optional
foreignKeys: keyofT
extendsstring
? (PgForeignKey
<keyofT
,any
> |PgSelfReferentialForeignKey
<keyofT
,any
> |PgUnmanagedForeignKey
<keyofT
,any
>)[] : []
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
> |PgUnmanagedIndex
)[] :never
triggers?
optional
triggers: (PgTrigger
<keyofT
extendsstring
? keyofT
:never
> |PgTrigger
<never
> |PgUnmanagedTrigger
)[]