-
Notifications
You must be signed in to change notification settings - Fork 216
Open
Description
Enhancement
Add support to generate CREATE OR REPLACE FUNCTION sql scripts using dbml markdown.
Syntax
Function increment {
schema public
returns integer
args [len_from: integer, len_from: integer]
body `
DECLARE
film_count INTEGER;
BEGIN
SELECT COUNT(*)
INTO film_count
FROM film
WHERE length BETWEEN len_from AND len_to;
RETURN film_count;
END;
`
language plpgsql
behavior volatile
security invoker
}
schema defaults to public. Can be specified inline with the function name such as Function public.increment { ... }
returns accepts any valid return type (see list below).
args accepts a list of arguments with declared types. Any return type is valid, excluding void, record, and trigger.
body accepts an expression or a multi-line expression.
language defaults to plpgsql. Can be sql, c, or internal.
behavior defaults to volatile. Can be immutable or stable.
security defaults to invoker. Can be definer.
Return types:
voidrecordtriggerintegerboolbyteadatedouble_precisionfloat4float8int2int4int8jsonjsonbnumerictexttimetimestamptimestamptztimetzuuidvarcharvector
Gaps
Does not implement configuration parameters.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels