prorm API Reference
    Preparing search index...

    Variable ProcedureRegistryConst

    ProcedureRegistry: {
        getAll(target: Function): ProcedureMeta[];
        get(target: Function, methodKey: string): ProcedureMeta | undefined;
        getSQL(
            target: Function,
            methodKey: string,
            dialect?: "mysql" | "mariadb" | "postgres" | "sqlite",
        ): string;
        createAll(
            prorm: Prorm,
            target: Function,
            dialect?: "mysql" | "mariadb" | "postgres" | "sqlite",
        ): Promise<void>;
        call(
            prorm: Prorm,
            target: Function,
            methodKey: string,
            args?: any[],
        ): Promise<any>;
    } = ...

    Type Declaration

    • getAll: function
      • Get all registered procedures/functions on a class.

        Parameters

        • target: Function

        Returns ProcedureMeta[]

    • get: function
      • Get a single procedure/function meta by method name.

        Parameters

        • target: Function
        • methodKey: string

        Returns ProcedureMeta | undefined

    • getSQL: function
      • Generate the CREATE PROCEDURE / CREATE FUNCTION SQL for a registered method.

        Parameters

        • target: Function

          The class constructor

        • methodKey: string

          The method name

        • Optionaldialect: "mysql" | "mariadb" | "postgres" | "sqlite"

          Override the dialect stored in the decorator options

        Returns string

    • createAll: function
      • Generate DDL for every procedure/function on a class and execute them.

        Parameters

        • prorm: Prorm

          Prorm instance

        • target: Function

          The class constructor

        • Optionaldialect: "mysql" | "mariadb" | "postgres" | "sqlite"

          Override dialect

        Returns Promise<void>

    • call: function
      • Call a stored procedure.

        Parameters

        • prorm: Prorm

          Prorm instance

        • target: Function

          The class constructor that has the

        • methodKey: string

          The method name

        • args: any[] = []

          Arguments to pass (positional, matched to params order)

        Returns Promise<any>

        decorator