Database Queries

Query database with SELECT (REST API)

Changed on

Query your database using a simple REST API - no SQL required!

Authentication: Requires auth user access token (from signup/signin)

Row-Level Security: Automatically enforced - you see only data you have access to

Use Cases:

  • Query from browser/mobile apps
  • Simple data retrieval
  • Filtered searches with sorting and pagination

Note: For complex queries (JOINs, CTEs), use functions with direct SQL

post/databases/{databaseName}/query/select

Request

  • Base URL
    https://api.volcano.dev
  • Auth
    HTTP bearer

Path parameters

databaseName, string required

Database name (unique within project, lowercase letters, numbers, and underscores only)

Request body

DatabaseSelectRequest required
table, string required

Table name to query

select, string[]

Columns to select (omit for *)

filters, DatabaseQueryFilter[]

WHERE conditions (combined with AND)

order, DatabaseQueryOrder[]

ORDER BY clauses

limit, integer

Maximum rows to return

offset, integer

Number of rows to skip (for pagination)

Example request

{
  "table": "posts",
  "select": [
    "id",
    "title",
    "content",
    "created_at"
  ],
  "filters": [
    {
      "column": "status",
      "operator": "eq",
      "value": "published"
    },
    {
      "column": "views",
      "operator": "gt",
      "value": 100
    }
  ],
  "order": [
    {
      "column": "created_at",
      "ascending": false
    }
  ],
  "limit": 10
}

Response

Query successful

DatabaseQueryResult required

Rows returned by a data API request. RLS-filtered unless the request was made with a service key.

data, object[]

Result rows

count, integer

Number of rows returned

Changes

    • breaking

      added the new path request parameter databaseName

    • breaking

      added the new required request property table

    • breaking

      the request's body type changed from no type to object

    23 more changes in this revision