bhmj / pg-api Goto Github PK
View Code? Open in Web Editor NEWPostgres API constructor
License: MIT License
Postgres API constructor
License: MIT License
Hi.
why first parameter in function is always 0??
Ubuntu 20.04
Postgres 12
function hello (have on first input parameter USER_ID
-- FUNCTION: api.hello_get(integer, json)
-- DROP FUNCTION IF EXISTS api.hello_get(integer, json);
CREATE OR REPLACE FUNCTION api.hello_get(
user_id integer,
_data json)
RETURNS json
LANGUAGE 'plpgsql'
COST 100
VOLATILE PARALLEL UNSAFE
AS
declare
_str text;
begin
_str := 'Hello there, '||coalesce(_data->>'name', 'stranger')||'!';
return json_build_object('greeting', _str);
end
ALTER FUNCTION api.hello_get(integer, json)
OWNER TO postgres;
call function from chrome
http://localhost:8088/api/v1/hello/1?name=mike
LOG: {"L":"INFO","T":"2022-05-23T13:13:32.168+0300","C":"service/query.go:61","M":"select * from api.hello_get (0, 1, '{"name":"mike"}')"}
RESPONSE:
pq: function api.hello_get(integer, integer, unknown) does not exist
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.