Manati
REST API for PostgreSQL. Forget ORM!
Warning
This is still in heavy development and some functionality might change. Be careful when you do an update.
Usage
# Add sql utils function, and a user you can use to connect to the database psql < sql/utils.sql # Add sql authentication tables and schema (used by the authentication plugin) psql < sql/authentication.sql
var manati = ;var app = ; // Manati uses KoaJS, if you want to extend it to your needs you can use (see http://koajs.com/ for more info)appkoa; // add authentication routes to the listapp); // add authentication middleware for all routes in the data router (route starting with /data)app 'data'); // this will execute the setup script on every start up, you can chooseapp;
Check our wiki for more information!
Example
Get some users data
GET /data/users?limit=2&name=like::J*
Count some users data
GET /data/count/users/name?name=like::J*
Update some users data
PATCH /data/users?name=eq::Jessie
Content-Type application/json
{
"age": 23
}
Create some new data
POST /data/users
Content-Type application/json
{
"name": "Joe",
"age": 21
}
Delete some users data
GET /data/users?name=eq::John