-
Notifications
You must be signed in to change notification settings - Fork 0
Basic RRM version 1
HEAD (Meta-data)
PUT (Create)
GET (Read)
POST (Update)
DELETE (Delete)
1. select * from {table} - limited to 0 rows
select count(*) from {table}
2. select * from {table} where id={id} - limited to 0 rows
select count(*) from {table}
3. select * from {table} where {field1}={value1} and ... and {fieldn}={valuen} - limited to 0 rows
select count(*) from {table}
-
HEAD /{table}
-
HEAD /{table}/_{id}
-
HEAD /{table}?field1=value1&...&fieldn=valuen
{
"total rows": ?,
"columns": [
"field1",
"field2",
...
"fieldn"
],
"types": [
"TYPE1",
"TYPE2",
...
"TYPEN"
]
}
1. insert into {table} ({field1},{field2},...,{fieldn}) values ({value1},{value2},...,{valuen})
PUT /{table}?field1=value1&field2=value2&...&fieldn=valuen
{"count": ?, "keys": [?,...,?]}
1. select * from {table}
2. Same as 1. but limit to top {limit} rows
3. select * from {table} where id={id}
4. select * from {table} order by [asc/desc] {field1},..., {field2}
5. Same as 4. but limit to top {limit} rows
6. select * from {table} where id={id} order by [asc/desc] {field1},..., {field2}
7. All but 3. and 6. can have the following where clause attached:
...where {field1}={value1} and ... and {fieldn}={valuen}
-
GET /{table}
-
GET /{table}/{limit}
-
GET /{table}/_{id}
-
GET /{table}/{field1}/.../{fieldn}/[_sort|_reverse]
-
GET /{table}/{field1}/.../{fieldn}/[_sort|_reverse]/{limit}
-
GET /{table}/{field1}/.../{fieldn}/[_sort|_reverse]/_{id}
-
All but 3. and 6. can have the following URL Paramaters
?field1=value1&...&fieldn=valuen
{
"limit": ?,
"more rows": <true/false>,
"name": {
"field1": <column1 int>,
"field2": <column2 int>,
...
"fieldn": <columnn int>
},
"type": {
"field1": "SQL TYPE1",
"field2": "SQL TYPE2",
...
"fieldn": "SQL TYPEN"
},
"rows": [[
value1,
value2,
...
valuen
],
...
[
value1,
value2,
...
valuen
]]
}
The "name"
attribute is there so that you can retrieve the column you want from the row using the columns database name e.g. if the returned JSON is stored in an object called db
, and the second column in the database is called info
, then you can get the second column from the third row by either db.rows[2][1]
, db.rows[2][db.name["info"]]
or db.rows[2][db.name.info]
in javaScript.
1. update {table} set {field1}={value1},...,{fieldn}={valuen}
2. update {table} set {field1}={value1},...,{fieldn}={valuen} where id={id}
-
POST /{table}?field1=value1&...&fieldn=valuen
-
POST /{table}/_{id}?field1=value1&...&fieldn=valuen
{"count": ?}
1. delete from {table}
2. delete from {table} where id={id}
3. delete from {table} where {field1}={value1} and ... and {fieldn}={valuen}
-
DELETE /{table}
-
DELETE /{table}/_{id}
-
DELETE /{table}?field1=value1&...&fieldn=valuen
{"count": ?}