SWIRLS_
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:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringNo
postgresstringYes

Output:

FieldTypeDescription
tablesobject[]

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:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringNo
postgresstringYes
tablestringYes
limitnumberYes
offsetnumberYes
orderByobjectNo
filtersobject[]No
searchstringNo
idsstring[]No

Output:

FieldTypeDescription
columnsobject[]
rowsobject[]
totalCountnumber

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:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringNo
postgresstringYes
tablestringYes
fieldsobjectYes

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:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringNo
postgresstringYes
tablestringYes
idstringYes
fieldsobjectYes

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:

ParameterTypeRequiredDescription
projectIdstringYes
appNamestringNo
postgresstringYes
tablestringYes
idstringYes

Output:

FieldTypeDescription
idstring

On this page