prorm API Reference
    Preparing search index...

    Interface GeneratedOptions

    Options for

    decorator

    interface GeneratedOptions {
        type?: string;
        as?: string;
        stored?: boolean;
        identity?: boolean;
        start?: number;
        increment?: number;
        cache?: number;
        min?: number;
        max?: number;
        cycle?: boolean;
        sequence?: string;
    }
    Index
    type?: string

    Column type (required for stored/generated columns) Example: 'varchar(255)', 'integer', 'decimal(10,2)'

    as?: string

    SQL expression for the generated column Example: 'CONCAT(first_name, " ", last_name)', 'price * quantity'

    stored?: boolean

    Whether the column is stored or virtual

    • 'virtual' (default): Computed on read, not stored in DB
    • 'stored': Computed on write, physically stored in DB
    identity?: boolean

    Enable identity/auto-increment for the column PostgreSQL: IDENTITY, MySQL: AUTO_INCREMENT

    start?: number

    Starting value for identity sequence PostgreSQL: START WITH, MySQL: auto_increment

    increment?: number

    Increment value for identity sequence PostgreSQL: INCREMENT BY, MySQL: auto_increment_increment

    cache?: number

    Number of sequence values to cache PostgreSQL: CACHE, MySQL: auto_increment_cache_size

    min?: number

    Minimum value for the sequence

    max?: number

    Maximum value for the sequence

    cycle?: boolean

    Whether the sequence cycles when exhausted

    sequence?: string

    Custom sequence name (PostgreSQL specific)