Skip to content

Basic RRM version 1

wmwragg edited this page Apr 17, 2011 · 1 revision

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}
  1. HEAD /{table}

  2. HEAD /{table}/_{id}

  3. 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})
  1. 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} 
  1. GET /{table}

  2. GET /{table}/{limit}

  3. GET /{table}/_{id}

  4. GET /{table}/{field1}/.../{fieldn}/[_sort|_reverse]

  5. GET /{table}/{field1}/.../{fieldn}/[_sort|_reverse]/{limit}

  6. GET /{table}/{field1}/.../{fieldn}/[_sort|_reverse]/_{id}

  7. 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}
  1. POST /{table}?field1=value1&...&fieldn=valuen

  2. 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}
  1. DELETE /{table}

  2. DELETE /{table}/_{id}

  3. DELETE /{table}?field1=value1&...&fieldn=valuen

{"count": ?}
Clone this wiki locally