It starts with the boss's request. If there are suggestions for the priority section, please make an issues
Name | type | description |
---|---|---|
sql | string |
Do your magic query |
type | read | write |
Just Read or Write |
bindings | array | object |
data binding from query |
connection | name |
connection name that has been set |
curl --location --request POST 'http://localhost:8000/api/query' \
--header 'Content-Type: application/json' \
--data-raw '{
"sql": "SELECT id, nama FROM public.users where id = ?",
"bindings": [1],
"type":"read"
}'
curl --location --request POST 'http://localhost:8000/api/query' \
--header 'Content-Type: application/json' \
--data-raw '{
"sql": "INSERT INTO public.users (name) VALUES (:name)",
"bindings": {"name": "Abang binsar"},
"type":"write"
}'
curl --location --request POST 'http://localhost:8000/api/query' \
--header 'Content-Type: application/json' \
--data-raw '{
"sql": "SELECT * FROM public.users where id = :id",
"bindings": {"id": 1},
"type":"read",
"connection": "pgsql"
}'