prorm API Reference
    Preparing search index...

    Variable ViewRegistryConst

    ViewRegistry: {
        getSQL(
            target: Function,
            dialectOverride?: "mysql" | "mariadb" | "postgres" | "sqlite" | Dialect,
        ): string;
        createView(
            prorm: Prorm,
            target: Function,
            dialectOverride?: "mysql" | "mariadb" | "postgres" | "sqlite" | Dialect,
        ): Promise<void>;
        dropView(prorm: Prorm, target: Function, ifExists?: boolean): Promise<void>;
    } = ...

    Type Declaration

    • getSQL: function
      • Generate the CREATE VIEW SQL for a

        Parameters

        • target: Function
        • OptionaldialectOverride: "mysql" | "mariadb" | "postgres" | "sqlite" | Dialect

          Either a dialect name, or a live Dialect. A definition-based view needs the instance, since only a real dialect can compile the SELECT; a name alone is enough for query/queryFn.

        Returns string

        class.

    • createView: function
      • Execute the CREATE VIEW statement for a

        Parameters

        • prorm: Prorm
        • target: Function
        • OptionaldialectOverride: "mysql" | "mariadb" | "postgres" | "sqlite" | Dialect

        Returns Promise<void>

        model class.

        The dialect is taken from prorm, so a view declared with definition compiles for whichever database the instance is connected to.

    • dropView: function
      • Drop the view for a

        Parameters

        • prorm: Prorm
        • target: Function
        • ifExists: boolean = true

          Emit IF EXISTS (default: true)

        Returns Promise<void>

        class.