Skip to main content

Decorators

Drizzle

@config

config - Mark this property as a configuration.

@Drizzle.config(config: valueof Drizzle.Configuration)

Target

Namespace

Parameters

NameTypeDescription
configvalueof model Drizzle.Configuration

@default

default - Mark this property as a default value.

@Drizzle.default(type?: valueof string | int32 | int16 | int8 | uint32 | uint16 | uint8 | float32 | float64 | boolean)

Target

ModelProperty

Parameters

NameTypeDescription
typevalueof union string | int32 | int16 | int8 | uint32 | uint16 | uint8 | float32 | float64 | boolean

@id

id - Mark this property as the primary key, or the list of columns that make up the primary key.

@Drizzle.id(name?: valueof string, fields?: valueof string[])

Target

union ModelProperty | Model

Parameters

NameTypeDescription
namevalueof scalar stringThe alternate name.
fieldsvalueof model string[]The list of columns that make up the primary key.

@index

index - Mark this property as an index.

@Drizzle.index(name?: valueof string, sql?: valueof string)

Target

ModelProperty

Parameters

NameTypeDescription
namevalueof scalar stringThe alternate name.
sqlvalueof scalar stringThe SQL statement to use for the index. It will replace {column} with the name of the current column. so you can use {column} in the SQL statement.
Think lower(\{column\}) to lower case the index. If \

@map

map - Mark this property as a column in a table.

@Drizzle.map(column: valueof string)

Target

ModelProperty

Parameters

NameTypeDescription
columnvalueof scalar string

@relation

relation - Mark this property as a relation.

@Drizzle.relation(relation?: valueof Drizzle.RelationOptions)

Target

ModelProperty

Parameters

NameTypeDescription
relationvalueof model Drizzle.RelationOptions

@sql

sql - Mark this property as the value of a SQL statement.

@Drizzle.sql(statement: valueof string)

Target

ModelProperty

Parameters

NameTypeDescription
statementvalueof scalar string

@table

table - Mark this model as a table, optionally with a name.

@Drizzle.table(tableName?: valueof string)

Target

union Model | Enum

Parameters

NameTypeDescription
tableNamevalueof scalar string

@unique

unique - Mark this property as a unique value.

@Drizzle.unique(...columns: valueof string[])

Target

union ModelProperty | Model

Parameters

NameTypeDescription
columnsvalueof model string[]

@uuid

uuid - Mark this property as a UUID.

@Drizzle.uuid(defaultRandom?: boolean)

Target

ModelProperty

Parameters

NameTypeDescription
defaultRandomscalar boolean