convert map definintion set to take only a json

This commit is contained in:
Paul Trowbridge 2018-05-24 17:01:03 -04:00
parent 6de5ece3d0
commit ad2a7ed68d
2 changed files with 9 additions and 7 deletions

View File

@ -1,4 +1,4 @@
CREATE OR REPLACE FUNCTION tps.srce_map_def_set(_srce text, _map text, _defn jsonb, _seq int) RETURNS jsonb CREATE OR REPLACE FUNCTION tps.srce_map_def_set(_defn jsonb) RETURNS jsonb
AS AS
$f$ $f$
@ -15,15 +15,15 @@ BEGIN
INSERT INTO INSERT INTO
tps.map_rm tps.map_rm
SELECT SELECT
_srce _defn->>'srce'
,_map ,_defn->>'name'
,_defn ,_defn
,_seq ,_defn->>'sequence'
ON CONFLICT ON CONSTRAINT map_rm_pk DO UPDATE SET ON CONFLICT ON CONSTRAINT map_rm_pk DO UPDATE SET
srce = _srce srce = _defn->>'srce'
,target = _map ,target = _defn->>'name'
,regex = _defn ,regex = _defn
,seq = _seq; ,seq = _defn->>'sequence';
EXCEPTION WHEN OTHERS THEN EXCEPTION WHEN OTHERS THEN

View File

@ -1,4 +1,6 @@
{ {
"srce":"dcard",
"sequence":1,
"defn": [ "defn": [
{ {
"key": "{Description}", "key": "{Description}",