prorm API Reference
    Preparing search index...

    Interface SqlFunctionOptions

    interface SqlFunctionOptions {
        name?: string;
        body?: string;
        dialect?: "mysql" | "mariadb" | "postgres" | "sqlite";
        schema?: string;
        replace?: boolean;
        params?: Omit<ProcedureParam, "mode">[];
        returns: string;
        language?: string;
        volatility?: string;
    }

    Hierarchy

    Index
    name?: string

    The name of the stored procedure in the database. Defaults to the method name if not provided.

    body?: string

    The SQL body of the procedure (everything inside BEGIN...END or $$...$$). If omitted, the generated DDL will have an empty body placeholder.

    dialect?: "mysql" | "mariadb" | "postgres" | "sqlite"

    Target dialect. Controls the DDL syntax that is generated. One of: 'mysql' | 'mariadb' | 'postgres' | 'sqlite' Defaults to 'mysql'.

    schema?: string

    Optional schema prefix, e.g. 'public'

    replace?: boolean

    If true, generates CREATE OR REPLACE PROCEDURE (Postgres) or DROP PROCEDURE IF EXISTS + CREATE PROCEDURE (MySQL). Default: false.

    params?: Omit<ProcedureParam, "mode">[]

    Input parameters (functions never have OUT params)

    returns: string

    SQL return type, e.g. 'TEXT', 'INTEGER', 'TABLE(id INT, name TEXT)'. Required for functions.

    language?: string

    Procedural language. Default: 'plpgsql' for postgres, 'SQL' for simple expressions.

    volatility?: string

    Set DETERMINISTIC / IMMUTABLE / STABLE / VOLATILE hint. MySQL: 'DETERMINISTIC' | 'NOT DETERMINISTIC' Postgres: 'IMMUTABLE' | 'STABLE' | 'VOLATILE'