Skip to main content
POST
Query Database View data

Authorizations

Authorization
string
header
required

Bearer JWT token or API Key (sk-*).

Path Parameters

databaseViewId
string
required

Body

application/json

Structured database read request. The server supplies the base from relation, so do not send from. All fields are optional. Input must be JSON-serializable and at most 8388608 UTF-8 bytes. Nested expression/filter validation depends on the selected database schema and cannot be fully represented by static OpenAPI. For view joins, provide a non-empty definition for every joined relation.

fields
(string | object)[]

Selected fields and computed expressions. Each entry is a field string or a structured SelectItem (for example { field, as, castAs, distinct }, { fn, args, as }, { jsonValue, as }, { cast, asType, as }, { coalesce, as }, or { case, as }). Field and expression validity is checked against the selected database at runtime.

Example:
joins
object[]

Join clauses and ON predicates. Provide table and on. For a direct database read, the server resolves the joined database definition and checks access; client-supplied definition is ignored. For a view read, a non-empty definition is required in each join. Predicates accept a left/op/right comparison, an array of comparisons, or nested and/or/not groups.

Example:
filter

Structured FilterNode predicate or nested and/or/not tree. A field predicate can use { field, op, value }, { field, op, values }, or shorthand operators. Field names and operation/value combinations are validated against the database at runtime. Application guards: 16 levels and 8388608 UTF-8 input bytes. Managed database queries: no separate node or array-value count limit; at most 65535 bind parameters per compiled statement. Analytics-backed queries retain 1000 nodes, 100000 array values and 10000 bind parameters.

Example:
sort

Sort by field name. Use an object mapping field names to ASC/DESC (case-insensitive) or an array of field names, prefixing descending fields with "-"; field names and aliases are validated at runtime.

Example:
groupBy
string[]

Field references or selected aliases used for grouping; validated against the query projection.

Example:
cast
object

Per-field database type overrides. Keys are field references; values are DatabaseDefinitionType constants.

Example:
take
integer

Maximum returned rows. Non-negative integer; zero or omission means no SQL LIMIT, not a default page size.

Required range: x >= 0
Example:

100

skip
integer

Number of rows to skip. Non-negative integer.

Required range: x >= 0
Example:

0

count
boolean

Include a count with query results. With take=0, the query may use count-only mode.

Example:

false

debug
boolean

Request query debug information when available to the caller.

Example:

false

with
object[]

Common table expressions. Each entry needs a name and a full query with its own from definition; nested CTE references and query fields are validated at runtime.

rawWhere
object[]

Advanced raw SQL WHERE fragments. Each fragment requires SQL text; {0}, {1}, etc. bind values from params. The SQL text itself is not structurally validated by the SelectInput DSL validator; use only trusted SQL and never interpolate untrusted values.

dialect
enum<string>

Query dialect supported by the selected backend; the runtime determines whether the requested dialect is available.

Available options:
postgres,
bigquery

Response

201