import type { Knex } from "knex"; import type InformationSchemaRoutine from "../information_schema/InformationSchemaRoutine.ts"; import type PgType from "./PgType.ts"; import { CanonicalType as CanonicalType } from "./query-parts/canonicaliseTypes.ts"; declare const parameterModeMap: { readonly i: "IN"; readonly o: "OUT"; readonly b: "INOUT"; readonly v: "VARIADIC"; readonly t: "TABLE"; }; type ParameterMode = (typeof parameterModeMap)[keyof typeof parameterModeMap]; export type FunctionParameter = { name: string; type: CanonicalType; mode: ParameterMode; hasDefault: boolean; ordinalPosition: number; }; declare const volatilityMap: { readonly i: "IMMUTABLE"; readonly s: "STABLE"; readonly v: "VOLATILE"; }; type FunctionVolatility = (typeof volatilityMap)[keyof typeof volatilityMap]; declare const parallelSafetyMap: { readonly s: "SAFE"; readonly r: "RESTRICTED"; readonly u: "UNSAFE"; }; type FunctionParallelSafety = (typeof parallelSafetyMap)[keyof typeof parallelSafetyMap]; export declare enum FunctionReturnTypeKind { Table = "table", Regular = "regular" } type FunctionReturnType = { kind: FunctionReturnTypeKind.Table; columns: { name: string; type: CanonicalType; }[]; isSet: boolean; } | { kind: FunctionReturnTypeKind.Regular; type: CanonicalType; isSet: boolean; }; export interface FunctionDetails extends PgType<"function"> { parameters: FunctionParameter[]; returnType: FunctionReturnType; language: string; definition: string; isStrict: boolean; isSecurityDefiner: boolean; isLeakProof: boolean; volatility: FunctionVolatility; parallelSafety: FunctionParallelSafety; estimatedCost: number; estimatedRows: number | null; comment: string | null; informationSchemaValue: InformationSchemaRoutine; } declare function extractFunction(db: Knex, pgType: PgType<"function">): Promise; export default extractFunction;