add target table to sql table, and change path of curl json request

This commit is contained in:
Paul Trowbridge 2022-05-12 22:59:37 -04:00
parent 04f774027d
commit 4ae9a5becd
5 changed files with 10 additions and 5 deletions

View File

@ -70,7 +70,12 @@ CREATE TABLE IF NOT EXISTS fc.log (
COMMENT ON TABLE fc.log IS 'forecast change log';
CREATE TABLE IF NOT EXISTS fc.sql(cmd text PRIMARY KEY, t text );
CREATE TABLE IF NOT EXISTS fc.sql(
target text
,cmd text
,t text
,PRIMARY KEY (target, cmd)
);
CREATE TABLE fc.perd (
comp numeric(2,0),

View File

@ -270,7 +270,7 @@ INTO
RAISE NOTICE E'_sql ---------> \n%',_sql;
INSERT INTO fc.sql SELECT 'baseline', _sql ON CONFLICT ON CONSTRAINT sql_pkey DO UPDATE SET t = EXCLUDED.t;
INSERT INTO fc.sql SELECT _target_table, 'baseline', _sql ON CONFLICT ON CONSTRAINT sql_pkey DO UPDATE SET t = EXCLUDED.t;
END
$func$;

View File

@ -267,7 +267,7 @@ INTO
RAISE NOTICE '%', _sql;
INSERT INTO fc.sql SELECT 'scale', _sql ON CONFLICT (cmd) DO UPDATE SET t = EXCLUDED.t;
INSERT INTO fc.sql SELECT _target_table, 'scale', _sql ON CONFLICT ON CONSTRAINT sql_pkey DO UPDATE SET t = EXCLUDED.t;
END
$func$;

2
test/baseline/curl.sh Normal file → Executable file
View File

@ -1 +1 @@
curl -H "Content-Type: application/json" -X GET -d@./routes/baseline/req.json http://localhost:8082/baseline
curl -H "Content-Type: application/json" -X GET -d@./test/baseline/req.json http://localhost:8082/baseline

2
test/scale/curl_route.sh Normal file → Executable file
View File

@ -1 +1 @@
curl -H "Content-Type: application/json" -X GET -d@./routes/scale/req_dcard.json http://localhost:8082/scale
curl -H "Content-Type: application/json" -X GET -d@./test/scale/req_dcard.json http://localhost:8082/scale