ReferenceSDKClient
postgresDatabases
SDK reference for postgresdatabases —
schema
Full table + column schema of one postgres block (JSON Schema allowlist)
GET
Usage:
const result = await swirls.client.postgresDatabases.schema({
projectId: '...',
postgres: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | |
appName | string | No | |
postgres | string | Yes |
Output:
| Field | Type | Description |
|---|---|---|
tables | object[] |
listRows
Read a page of rows from one table of an external postgres block
GET
Usage:
const result = await swirls.client.postgresDatabases.listRows({
projectId: '...',
postgres: '...',
table: '...',
limit: 1,
offset: 1,
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | |
appName | string | No | |
postgres | string | Yes | |
table | string | Yes | |
limit | number | Yes | |
offset | number | Yes | |
orderBy | object | No | |
filters | object[] | No | |
search | string | No | |
ids | string[] | No |
Output:
| Field | Type | Description |
|---|---|---|
columns | object[] | |
rows | object[] | |
totalCount | number |
insertRow
Insert one row into a postgres block table (JSON Schema allowlist)
POST
Usage:
const result = await swirls.client.postgresDatabases.insertRow({
projectId: '...',
postgres: '...',
table: '...',
fields: {},
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | |
appName | string | No | |
postgres | string | Yes | |
table | string | Yes | |
fields | object | Yes |
updateRow
Patch one row in a postgres block table. Primary-key mutation is refused.
POST
Usage:
const result = await swirls.client.postgresDatabases.updateRow({
projectId: '...',
postgres: '...',
table: '...',
id: '...',
fields: {},
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | |
appName | string | No | |
postgres | string | Yes | |
table | string | Yes | |
id | string | Yes | |
fields | object | Yes |
deleteRow
Delete one row from a postgres block table by primary key
POST
Usage:
const result = await swirls.client.postgresDatabases.deleteRow({
projectId: '...',
postgres: '...',
table: '...',
id: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | |
appName | string | No | |
postgres | string | Yes | |
table | string | Yes | |
id | string | Yes |
Output:
| Field | Type | Description |
|---|---|---|
id | string |