(C)reate > POST database_name/table_name
(R)ead > GET database_name/table_name[/id]
(R)ead > GET database_name/table_name[/column/content]
(U)pdate > PUT database_name/table_name/id
(D)elete > DELETE database_name/table_name/id
-
Get all rows from the "users" table
-
Get a single row from the "users" table (where "12" is the ID)
-
Get all rows from the "users" table where the "first_name" field matches "Poornima" (
LIKE
) -
Get 5 rows from the "users" table
-
Get 50 rows from the "users" table ordered by the "date" field
-
GET http://api.example.com/test/users?limit=5&by=salary&order=desc
-
Create a new row in the "users" table where the POST data corresponds to the database fields
-
Update customer "12" in the "users" table where the PUT data corresponds to the database fields
-
Delete customer "12" from the "users" table
- Update customer "12" in the "users" table where the PUT data corresponds to the database fields
- PUT http://api.example.com/test/users/12/
If table does not have column id or user wants some other column to be considered as id attribute he can give key value in his payload as id_attribute : column name
- Delete customer "12" from the "users" table
- DELETE http://api.example.com/test/users/12/
If table does not have column id or user wants some other column to be considered as id attribute he can give key value in his payload as id_attribute : column name
We are following this convention as backbone also follows the same convention
- POST /database/ (create db) payload {'db_name':'value'}
- DELETE /:database/ (delete db)
- POST /:database/table payload {'table_name':'value', 'primary_key':'value', 'columns':{"column_name": "data_type"}} (create table)
- DELETE /:database/:table (delete table)