docs: writes on every table after the methods table
This commit is contained in:
+7
-7
@@ -16,6 +16,13 @@ procedures: {
|
|||||||
|
|
||||||
`write: true` allows create, update and delete of every visible column. A list allows only the columns named. Generated and identity columns are never writable, and neither is a key on update.
|
`write: true` allows create, update and delete of every visible column. A list allows only the columns named. Generated and identity columns are never writable, and neither is a key on update.
|
||||||
|
|
||||||
|
| Method | Path | Does | Answers |
|
||||||
|
|---|---|---|---|
|
||||||
|
| POST | `/tags` | creates one row, or an array of rows | 201 |
|
||||||
|
| PATCH | `/tags/4` | updates one row | 204, or 200 with the row |
|
||||||
|
| DELETE | `/tags/4` | deletes one row | 204, or 200 with the row |
|
||||||
|
| PATCH, DELETE | `/steps?priority=lt.3` | by filter, only where `bulk: true` | 204, or 200 with the rows |
|
||||||
|
|
||||||
## Writes on every table
|
## Writes on every table
|
||||||
|
|
||||||
For an API that writes everywhere, set `write` once, beside `expose`:
|
For an API that writes everywhere, set `write` once, beside `expose`:
|
||||||
@@ -36,13 +43,6 @@ It applies to every exposed table; views stay read-only until their resource all
|
|||||||
|
|
||||||
What is never writable stays so: hidden and sensitive columns, generated columns, and keys on update; a bulk request still needs a filter. Who may write is decided by your `authorize` hook, which receives every write with its action: see [Security](./security.md#hooks).
|
What is never writable stays so: hidden and sensitive columns, generated columns, and keys on update; a bulk request still needs a filter. Who may write is decided by your `authorize` hook, which receives every write with its action: see [Security](./security.md#hooks).
|
||||||
|
|
||||||
| Method | Path | Does | Answers |
|
|
||||||
|---|---|---|---|
|
|
||||||
| POST | `/tags` | creates one row, or an array of rows | 201 |
|
|
||||||
| PATCH | `/tags/4` | updates one row | 204, or 200 with the row |
|
|
||||||
| DELETE | `/tags/4` | deletes one row | 204, or 200 with the row |
|
|
||||||
| PATCH, DELETE | `/steps?priority=lt.3` | by filter, only where `bulk: true` | 204, or 200 with the rows |
|
|
||||||
|
|
||||||
## Getting the rows back
|
## Getting the rows back
|
||||||
|
|
||||||
Without a `Prefer` header a write answers with no body. `Prefer: return=representation` answers the written rows, read back with the request's `select`, so embeds work too.
|
Without a `Prefer` header a write answers with no body. `Prefer: return=representation` answers the written rows, read back with the request's `select`, so embeds work too.
|
||||||
|
|||||||
Reference in New Issue
Block a user