columnconstconst column: (tableName: string, columnName: string) => RefA reference to a column of a table, as governance names them.
Routines (commons data 0009-sql-features FR-011 to FR-013): a function or procedure with typed parameters and a body that is text and typed references. A reference to a table, a column of a table or a parameter is written by the case style as the name that table, column or parameter has, so a body never holds a name by hand that the case style could write differently.
columnconstconst column: (tableName: string, columnName: string) => RefA reference to a column of a table, as governance names them.
columnNameconstconst columnName: (tableName: string, columnName_: string) => RefA reference to the name of a column alone, where SQL does not take it qualified (the target of SET).
paramconstconst param: (name: string) => RefA reference to a parameter of the routine, written with the routine's name before it.
routinesSourcefunctionfunction routinesSource(definitions: readonly RoutineDefinition[]): StatementSourceThe source of routines.
| Parameter | What it is |
|---|---|
definitions | the routines, in the order they are made |
Returns: a statement source
tableconstconst table: (name: string) => RefA reference to a table, as governance names it.
Paraminterfaceno test imports itinterface ParamA parameter.
| Member | Type | What it is |
|---|---|---|
name | string | |
type | LogicalType |
Reftypeno test imports ittype Ref =
| { readonly ref: "table"; readonly table: string }
| { readonly ref: "column"; readonly table: string; r… (701 characters)type Ref =
| { readonly ref: "table"; readonly table: string }
| { readonly ref: "column"; readonly table: string; readonly column: string }
| { readonly ref: "columnName"; readonly table: string; readonly column: string }
| { readonly ref: "param"; readonly param: string }
/** A variable of a block, by its name as governance writes names (0050-sql-plpgsql). */
| { readonly ref: "var"; readonly name: string }
/** A type, written for the dialect. */
| { readonly ref: "type"; readonly type: LogicalType }
/** A column of a record a loop gives, by the table it is a row of. */
| { readonly ref: "field"; readonly record: string; readonly table: string; readonly column: string };A reference in a body.
Returnstypeno test imports ittype Returns =
| { readonly type: LogicalType }
| { readonly setOf: string }
| { readonly columns: readonly { readonly name: string; readonly type: LogicalType }[] };What a function returns: a type, the rows of a table, or rows of columns.
RoutineDefinitioninterfaceinterface RoutineDefinitionA routine.
| Member | Type | What it is |
|---|---|---|
kind | "function" | "procedure" | |
name | string | Its name as governance writes names, lower camel case. |
description | string | |
params? | readonly Param[] | |
returns? | Returns | What a function returns; a procedure returns nothing. |
language | "plpgsql" | "sql" | |
volatility? | "immutable" | "stable" | "volatile" | |
body | readonly (string | Ref)[] |