Select - 11039850/monalisa-service GitHub Wiki
URI
/{Database}/{Table}
HEAD: get the meta info of the Table
/{Database}
GET: get all tables of the Database
/{Database}/{Table}
GET: get records of the Table
POST: insert records to the Table
/{Database}/{Table}/{SinglePk}
GET: get a record by single primary key
PUT/POST: update a record by single primary key
DELETE: delete a record by single primary key
/{Database}/{Table}/{C1=V1},{C2=V2},{...}
GET: get a record by multiple primary keys
PUT/POST: update a record by multiple primary keys
DELETE: delete a record by multiple primary keys
/{Database}/{Table1},{Table2},{...}
POST: insert records to the Table1 and Table2 ...
/{Database}/{Table1},{Table2},{Table3}/{Table1.id=Table2.id},{Table2.id=Table3.id}
GET: get records by multiple tables' join
Query parameter
- method
GET/POST/PUT/DELETE/HEAD: replace HTTP request's method.
- column
column=c1,c2,c3... means: include column(c1,c2,c3)
-column=c1,c2 means: exclude column(c1,c2)
- order
order=+c1,-c2 means: ORDER BY c1 ASC, c2 DESC
- limit
limit=30
- offset
offset=0
- paging
paging=true, response header: 'X-Total-Count' & 'X-Total-Page' indicate the total number of records & pages.
-
Other query parameters are considered as filter conditions
For example:
c1=a&c2=(1,2,3)&c3>=10&c4<10&c5~p*&c6!=7&c7=[1,10]
SQL like this:
WHERE c1='a' AND c2 in (1,2,3) AND c3 >= 10 AND c4 < 10
AND c5 like 'p%' AND c6 != 7 AND c7 BETWEEN 1 AND 10