sqlbuilder.uda

UDA items for creating model structures for your datasets.

Members

Enums

Strong
enum Strong
Undocumented in source.
autoIncrement
enum autoIncrement

Tag a column as receiving an automatic value incremented by the database (usually the id).

ignore
enum ignore

Ignore a field, it is not considered part of the database data.

primaryKey
enum primaryKey

Tag a column as part of the primary key.

unique
enum unique

Mark a specific column as unique on the table. This only is used when generating the table and is not (currently) used in any queries or executions.

Functions

allowNull
AllowNull!T allowNull(T val)

Allow null for a specific field that is not typed as Nullable!T.

mustReferTo
refersTo!T mustReferTo(string name, Spec joinType)

This attribute identifies the table that this column or relation refers to. Use the mustReferTo form to more intuitively indicate a strong relation (rather than pass a true as a third parameter to refersTo).

Structs

AllowNull
struct AllowNull(T)
colName
struct colName

Specify a different column name for a field. By default, the field's name is used.

colType
struct colType

Specify an alternate column type. This is possibly specific to the database engine. By default the engine picks the type based on the field type. This only has any bearing when creating tables.

mapping
struct mapping

This defines a mapping for a relationship. Each item can either represent a field in the foreign table or a literal string to use as the mapping. The library distinguishes between the two by checking to see if the key could be a valid identifier. Typically, literals are not valid identifiers in any SQL.

refersTo
struct refersTo(T)

This attribute identifies the table that this column or relation refers to. Use the mustReferTo form to more intuitively indicate a strong relation (rather than pass a true as a third parameter to refersTo).

tableName
struct tableName

Tag your structure to provide an alternative table name. Without this, the struct's name is used as the table name.

Meta