Database sessions schema

service.db.sessions.graphqls

This API is available in Enterprise and AWS editions only.

To authenticate API requests, you’ll need an API token. Learn how to generate an access token.

See usage examples in the cloudbeaver-graphql-examples repository.

You can try queries in the built-in GraphQL console, available on your server at https://your-server-address/api/gql/console. This tool lets you test requests directly from your browser.

For a live example, see the demo GraphQL console.

API Endpoints
https://your-server-address/api/gql

Queries

asyncDbSmSessions

Description

Create an async task to retrieve database sessions for the specified connection.

Response

Returns an AsyncTaskInfo!

Arguments
Name Description
projectId - ID!
connectionId - ID!
limit - Int

Example

Query
query asyncDbSmSessions(
  $projectId: ID!,
  $connectionId: ID!,
  $limit: Int
) {
  asyncDbSmSessions(
    projectId: $projectId,
    connectionId: $connectionId,
    limit: $limit
  ) {
    id
    name
    running
    status
    error {
      ...ServerErrorFragment
    }
    taskResult
  }
}
Variables
{"projectId": "<id>", "connectionId": "<id>", "limit": "<int>"}
Response
{
  "data": {
    "asyncDbSmSessions": {
      "id": "<string>",
      "name": "<string>",
      "running": "<boolean>",
      "status": "<string>",
      "error": ServerError,
      "taskResult": "<object>"
    }
  }
}

asyncDbSmSessionsResult

Description

Retrieve the result of an async task that returns database sessions for the specified connection.

Response

Returns [DataSourceSessionInfo!]

Arguments
Name Description
taskId - ID!

Example

Query
query asyncDbSmSessionsResult($taskId: ID!) {
  asyncDbSmSessionsResult(taskId: $taskId) {
    activeQuery
    properties {
      ...ObjectPropertyInfoFragment
    }
    sessionId
  }
}
Variables
{"taskId": "<id>"}
Response
{
  "data": {
    "asyncDbSmSessionsResult": [
      {
        "activeQuery": "<string>",
        "properties": [ObjectPropertyInfo],
        "sessionId": "<string>"
      }
    ]
  }
}

dbSmTerminate

Description

Terminates database sessions for the specified connection.

Response

Returns a Boolean!

Arguments
Name Description
projectId - ID!
connectionId - ID!
sessionIds - [String!]!

Example

Query
query dbSmTerminate(
  $projectId: ID!,
  $connectionId: ID!,
  $sessionIds: [String!]!
) {
  dbSmTerminate(
    projectId: $projectId,
    connectionId: $connectionId,
    sessionIds: $sessionIds
  )
}
Variables
{"projectId": "<id>", "connectionId": "<id>", "sessionIds": "<string>"}
Response
{"data": {"dbSmTerminate": "<boolean>"}}

Types

AsyncTaskInfo

Description

Async types

Fields
Field Name Description
id - String! Task unique identifier
name - String Async task name
running - Boolean! Indicates if the task is currently running
status - String Current status of the async task
error - ServerError Error information if the task failed
taskResult - Object Task result. Can be some kind of identifier to obtain real result using another API function
Example
{
  "id": "<string>",
  "name": "<string>",
  "running": "<boolean>",
  "status": "<string>",
  "error": ServerError,
  "taskResult": "<object>"
}

Boolean

Description

The Boolean scalar type represents true or false.

Example
"<boolean>"

Condition

Description

Represents a dynamic condition for a property, such as visibility or read-only state

Fields
Field Name Description
expression - String! The logical expression that defines when the condition applies
conditionType - ConditionType! The type of condition (e.g., HIDE or READ_ONLY)
Example
{"expression": "<string>", "conditionType": "HIDE"}

ConditionType

Values
Enum Value Description

HIDE

hiding property condition

READ_ONLY

restriction for setting a property value
Example
"HIDE"

DataSourceSessionInfo

Fields
Field Name Description
activeQuery - String Active query for the session.
properties - [ObjectPropertyInfo!] Returns list of properties for the session that can be used in the UI.
sessionId - String! Identifier of the database session.
Example
{
  "activeQuery": "<string>",
  "properties": [ObjectPropertyInfo],
  "sessionId": "<string>"
}

ID

Description

The ID scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.

Example
"<id>"

Int

Description

The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.

Example
"<int>"

Object

Description

Any object (JSON)

Example
"<object>"

ObjectPropertyInfo

Description

Information about the object property used to generate its UI

Fields
Field Name Description
id - String Unique property identifier
displayName - String Human-readable name
description - String Property description
hint - String Usage hint for the property
category - String Property category (may be used if object has a lot of properties)
dataType - String Property data type (e.g., int, String)
value - Object Property value (can be resource-intensive for some properties, e.g., RowCount for tables)
validValues - [Object] List of allowed values (for enumerable properties)
defaultValue - Object Default property value
length - ObjectPropertyLength! Property value length
features - [String!]! List of supported features (e.g., system, hidden, inherited, foreign, expensive)
order - Int! Order position
supportedConfigurationTypes - [String!] Supported configuration types (for driver properties)
required - Boolean! Is the property required
scopes - [String!] List of preference scopes (e.g., global, user)
conditions - [Condition!] Dynamic conditions for the property (e.g., visibility or read-only)
Example
{
  "id": "<string>",
  "displayName": "<string>",
  "description": "<string>",
  "hint": "<string>",
  "category": "<string>",
  "dataType": "<string>",
  "value": "<object>",
  "validValues": ["<object>"],
  "defaultValue": "<object>",
  "length": "TINY",
  "features": ["<string>"],
  "order": "<int>",
  "supportedConfigurationTypes": ["<string>"],
  "required": "<boolean>",
  "scopes": ["<string>"],
  "conditions": [Condition]
}

ObjectPropertyLength

Values
Enum Value Description

TINY

1 character

SHORT

20 characters

MEDIUM

<= 64 characters

LONG

Full line length. The default

MULTILINE

Multi-line long text
Example
"TINY"

ServerError

Description

Various server errors descriptor

Fields
Field Name Description
message - String Error message text
errorCode - String Retrieves the vendor-specific error code
errorType - String Type/category of the error
stackTrace - String Stack trace for debugging
causedBy - ServerError Nested error that caused this error (recursive)
Example
{
  "message": "<string>",
  "errorCode": "<string>",
  "errorType": "<string>",
  "stackTrace": "<string>",
  "causedBy": ServerError
}

String

Description

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Example
"<string>"