feature #6: Implement named parameters
This commit is contained in:
@@ -33,6 +33,19 @@ CREATE OR REPLACE FUNCTION test_function (name text default 'plop', IN hi text d
|
||||
AS
|
||||
$$
|
||||
BEGIN
|
||||
result = json_build_object('id', 3, 'name', 'test');
|
||||
result = json_build_object('id', 3, 'name', name);
|
||||
END;
|
||||
$$;
|
||||
|
||||
|
||||
CREATE OR REPLACE FUNCTION test_function_multiple (name text default 'plop', IN hi text default 'hello', out result json)
|
||||
LANGUAGE plpgsql
|
||||
AS
|
||||
$$
|
||||
BEGIN
|
||||
result = json_build_array(
|
||||
json_build_object('id', 3, 'name', name),
|
||||
json_build_object('id', 4, 'name', hi)
|
||||
);
|
||||
END;
|
||||
$$;
|
||||
Reference in New Issue
Block a user