POST
/
v1
/
instances
/
{instance}
/
databases
/
{database}
:query
{
  "results": [
    {
      "columnNames": [
        "<string>"
      ],
      "columnTypeNames": [
        "<string>"
      ],
      "rows": [
        {
          "values": [
            {
              "nullValue": "NULL_VALUE",
              "boolValue": true,
              "bytesValue": "<string>",
              "doubleValue": 123,
              "floatValue": 123,
              "int32Value": 123,
              "int64Value": "<string>",
              "stringValue": "<string>",
              "uint32Value": 123,
              "uint64Value": "<string>",
              "valueValue": "<any>",
              "timestampValue": {
                "googleTimestamp": "2023-11-07T05:31:56Z",
                "accuracy": 123
              },
              "timestampTzValue": {
                "googleTimestamp": "2023-11-07T05:31:56Z",
                "zone": "<string>",
                "offset": 123,
                "accuracy": 123
              }
            }
          ]
        }
      ],
      "rowsCount": "<string>",
      "error": "<string>",
      "latency": "<string>",
      "statement": "<string>",
      "postgresError": {
        "severity": "<string>",
        "code": "<string>",
        "message": "<string>",
        "detail": "<string>",
        "hint": "<string>",
        "position": 123,
        "internalPosition": 123,
        "internalQuery": "<string>",
        "where": "<string>",
        "schemaName": "<string>",
        "tableName": "<string>",
        "columnName": "<string>",
        "dataTypeName": "<string>",
        "constraintName": "<string>",
        "file": "<string>",
        "line": 123,
        "routine": "<string>"
      },
      "allowExport": true,
      "messages": [
        {
          "level": "LEVEL_UNSPECIFIED",
          "content": "<string>"
        }
      ],
      "masked": [
        {
          "semanticTypeId": "<string>",
          "semanticTypeTitle": "<string>",
          "maskingRuleId": "<string>",
          "algorithm": "<string>",
          "context": "<string>",
          "classificationLevel": "<string>",
          "semanticTypeIcon": "<string>"
        }
      ]
    }
  ]
}

Path Parameters

instance
string
required

The instance id.

database
string
required

The database id.

Body

application/json
name
string
required

The name is the instance name to execute the query against. Format: instances/{instance}/databases/{databaseName}

dataSourceId
string
required

The id of data source. It is used for querying admin data source even if the instance has read-only data sources. Or it can be used to query a specific read-only data source.

statement
string

The SQL statement to execute.

limit
integer

The maximum number of rows to return.

explain
boolean

Explain the statement.

schema
string

The default schema to search objects. Equals to the current schema in Oracle and search path in Postgres.

queryOption
object
container
string

Container is the container name to execute the query against, used for CosmosDB only.

Response

OK

results
object[]

The query results.