Skip to main content

Dynamic Query Builder Properties

Introduction

The Dynamic Query Builder allows you to construct SQL queries using JSON syntax. This documentation provides an overview of the JSON structure and its corresponding SQL query clauses.

PropertyTypeRequiredNullable
witharrayOptionalcannot be null
selectarrayOptionalcannot be null
aliasstringOptionalcannot be null
wherearrayOptionalcannot be null
joinarrayOptionalcannot be null
data_point_idstringOptionalcannot be null
tablestringOptionalcannot be null
grouparrayOptionalcannot be null
orderarrayOptionalcannot be null
limitintegerOptionalcannot be null
offsetintegerOptionalcannot be null

with

Define a WITH SQL query clause.

with

  • is optional

  • Type: object[]

  • cannot be null

with Type

object[]

select

Array of SELECT parameters.

select

  • is optional

  • Type: object[]

  • cannot be null

select Type

object[]

alias

An alias to refer this query in other parts of the JSON.

alias

  • is optional

  • Type: string

  • cannot be null

alias Type

string

alias Constraints

pattern: the string must match the following regular expression:

^[a-zA-Z_]+$

try pattern

where

An of objects to apply conditions on the query. All the top level objects inside this array are AND'd and every condition inside an object is OR'd.

where

  • is optional

  • Type: object[]

  • cannot be null

where Type

object[]

join

Define multiple joins in an array of objects.

join

  • is optional

  • Type: object[]

  • cannot be null

join Type

object[]

data_point_id

A valid data_point_id from the current Golain project.

data_point_id

  • is optional

  • Type: string

  • cannot be null

data_point_id Type

string

data_point_id Constraints

UUID: the string must be a UUID, according to RFC 4122

table

An alias of a query defined in this JSON.

table

  • is optional

  • Type: string

  • cannot be null

table Type

string

group

Array of columns to group by.

group

  • is optional

  • Type: string[]

  • cannot be null

group Type

string[]

order

Array of objects to specify multiple columns in order by.

order

  • is optional

  • Type: object[]

  • cannot be null

order Type

object[]

limit

limit

  • is optional

  • Type: integer

  • cannot be null

limit Type

integer

limit Constraints

maximum: the value of this number must smaller than or equal to: 50

limit Default Value

The default value is:

50

offset

offset

  • is optional

  • Type: integer

  • cannot be null

offset Type

integer