prorm API Reference
    Preparing search index...

    Interface CreateDomainOptions

    Options for creating a PostgreSQL domain (CREATE DOMAIN name AS base_type ...)

    interface CreateDomainOptions {
        schema?: string;
        default?: string | number | boolean;
        collation?: string;
        notNull?: boolean;
        checks?: { name?: string; expression: string }[];
    }
    Index
    schema?: string

    Schema to create the domain in

    default?: string | number | boolean

    Optional default value. Strings are single-quoted and escaped unless they look like a raw SQL expression (wrapped in the caller's own quoting is not performed automatically for anything other than plain strings).

    collation?: string

    Emits COLLATE collation

    notNull?: boolean

    Emits NOT NULL (mutually exclusive in intent with allowing NULL, but Postgres allows either)

    checks?: { name?: string; expression: string }[]

    One or more CHECK expressions, e.g. ['VALUE > 0'], each emitted as CONSTRAINT name CHECK (expression) when a corresponding name is given, or a bare CHECK (expression) otherwise.