add create function scripts
This commit is contained in:
parent
dc973690cb
commit
d51a327868
15
functions/srce_edit.pgsql
Normal file
15
functions/srce_edit.pgsql
Normal file
@ -0,0 +1,15 @@
|
||||
|
||||
CREATE OR REPLACE FUNCTION tps.srce_set(_name text, _defn jsonb) RETURNS jsonb
|
||||
AS $f$
|
||||
BEGIN
|
||||
|
||||
/*
|
||||
1. determine if insert or update
|
||||
2. if update, determine if conflicts exists
|
||||
3. do merge
|
||||
*/
|
||||
|
||||
|
||||
END;
|
||||
$f$
|
||||
LANGUAGE plpgsql
|
@ -1,6 +1,6 @@
|
||||
\timing
|
||||
|
||||
CREATE OR REPLACE FUNCTION tps.srce_edit(_path text, _srce text) RETURNS text
|
||||
DROP FUNCTION tps.srce_import(_path text, _srce text);
|
||||
CREATE OR REPLACE FUNCTION tps.srce_import(_path text, _srce text) RETURNS jsonb
|
||||
|
||||
/*--------------------------------------------------------
|
||||
0. load target import to temp table
|
||||
@ -11,6 +11,10 @@ CREATE OR REPLACE FUNCTION tps.srce_edit(_path text, _srce text) RETURNS text
|
||||
5. insert summary to log table
|
||||
*/---------------------------------------------------------
|
||||
|
||||
--to-do
|
||||
--return infomation to a client via json or composite type
|
||||
|
||||
|
||||
AS $f$
|
||||
DECLARE _t text;
|
||||
DECLARE _c text;
|
Loading…
Reference in New Issue
Block a user