A microservice written in Clojure for talking to PostgreSQL instances.
- A RESTfull microservice;
- Define a JDBC datasource using POST method;
- Execute SELECT statement using POST method;
- Execute INSERT statement using POST method;
- Execute UPDATE statement using PUT method;
- Execute DELETE statement using DELETE method;
- Swagger UI.
Based on PleaseFoundation/PG
POST /v1/datasource/define DatasourceConfig:
{
"host": "127.0.0.1",
"port": 5432,
"database": "postgres",
"username": "postgres",
"password": "P@ssw0rd!"
}
POST /v1/statement/select
Table: pg_amop
Where:
{
"amopopr": 522
}
PUT /v1/statement/update
Table: pg_amop
Clause:
{
"columns": {"amoplefttype": 44,
"amoppurpose": "j"},
"where": {"amopfamily": "46"}
}
INSERT /v1/statement/insert
Table: pg_amop
Data:
{
"amopfamily": "46",
"amoplefttype": "234",
"amoprighttype": "4565",
"amopstrategy": "222",
"amoppurpose": "s",
"amopopr": "98",
"amopmethod": "44",
"amopsortfamily": "99"
}
DELETE /v1/statement/delete
Table: pg_amop
Where:
{
"amoplefttype": 33
}
You will need Leiningen 2.0.0 or above installed.
To start a web server for the application, run:
lein ring server
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.