@d34d/w-orm - v0.6.0
    Preparing search index...

    Type Alias FieldOptions<T>

    Describes a field on a model.

    Multiple options can be passed to the decorator:

    • primaryKey: Whether the field is the primary key of the model, if multiple fields are marked as primary key, their combination will be the key.
    • unique: Whether the field has an unique constraint. This will be enforced by the database.
    • nullable: Whether the field can be null, primary keys cannot be nullable.
    • default: The default value of the field, it can be a value or a function that returns the value.
    • type: The type of the field, it is automatically inferred with typescript.
    • index: Whether the field should be indexed, it is recommended to keep it unless the type isn't indexable (eg. a Blob).
    type FieldOptions<T> = {
        default?: T | (() => T);
        index: boolean;
        nullable: boolean;
        primaryKey: boolean;
        type: () => T;
        unique: boolean;
    }

    Type Parameters

    • T
    Index
    default?: T | (() => T)
    index: boolean
    nullable: boolean
    primaryKey: boolean
    type: () => T
    unique: boolean