prorm API Reference
← Documentation
GitLab
Preparing search index...
index
FieldDefinition
Interface FieldDefinition
interface
FieldDefinition
{
name
?:
string
;
type
:
string
|
{
key
?:
string
;
toSqlString
?:
()
=>
string
}
;
primaryKey
?:
boolean
;
foreignKey
?:
boolean
;
unique
?:
boolean
;
allowNull
?:
boolean
;
defaultValue
?:
any
;
autoIncrement
?:
boolean
;
references
?:
{
model
:
string
;
key
:
string
}
;
comment
?:
string
;
validate
?:
Record
<
string
,
any
>
;
enum
?:
string
[]
;
}
Index
Properties
name?
type
primary
Key?
foreign
Key?
unique?
allow
Null?
default
Value?
auto
Increment?
references?
comment?
validate?
enum?
Properties
Optional
name
name
?:
string
type
type
:
string
|
{
key
?:
string
;
toSqlString
?:
()
=>
string
}
Optional
primary
Key
primaryKey
?:
boolean
Optional
foreign
Key
foreignKey
?:
boolean
Treated as FK even without
references
when set to true
Optional
unique
unique
?:
boolean
Optional
allow
Null
allowNull
?:
boolean
Optional
default
Value
defaultValue
?:
any
Optional
auto
Increment
autoIncrement
?:
boolean
Optional
references
references
?:
{
model
:
string
;
key
:
string
}
Optional
comment
comment
?:
string
Optional
validate
validate
?:
Record
<
string
,
any
>
Optional
enum
enum
?:
string
[]
Settings
Member Visibility
Protected
Inherited
Theme
OS
Light
Dark
On This Page
Properties
name
type
primary
Key
foreign
Key
unique
allow
Null
default
Value
auto
Increment
references
comment
validate
enum
← Documentation
GitLab
prorm API Reference
Loading...
Treated as FK even without
referenceswhen set to true