The "listDatabases" action retrieves databases on the server. You can optionally filter which databases are returned by specifying a complete or partial database name. By default, the results are sorted in ascending order.
Request examples
Minimal
{
"action": "listDatabases",
"authToken": "replaceWithAuthTokenFromCreateSession"
}Maximal
{
"api": "db",
"action": "listDatabases",
"params": {
"partialDatabaseName": "ctr",
"skipRecords": 0,
"maxRecords": 20,
"transactionId": null
},
"responseOptions": {
"binaryFormat": "hex",
"dataFormat": "objects",
"numberFormat": "string"
},
"authToken": "replaceWithAuthTokenFromCreateSession",
"apiVersion": "1.0",
"requestId": "00000010",
"debug": "max"
}
Response examples
Minimal
{
"result": {
"dataFormat": "objects",
"fields": [
{
"name": "databaseName",
"type": "varchar",
"length": 8192,
"scale": null,
"defaultValue": null,
"nullable": false,
"primaryKey": 0,
"autoValue": "none"
},
{
"name": "path",
"type": "varchar",
"length": 8192,
"scale": null,
"defaultValue": null,
"nullable": false,
"primaryKey": 0,
"autoValue": "none"
},
{
"name": "uid",
"type": "bigint",
"length": null,
"scale": null,
"defaultValue": null,
"nullable": false,
"primaryKey": 0,
"autoValue": "none"
}
],
"data": [
{
"databaseName": "ctreeSQL",
"path": ".\\ctreeSQL.dbs\\SQL_SYS",
"uid": 999
},
{
"databaseName": "faircom",
"path": ".\\faircom.dbs\\SQL_SYS",
"uid": 1001
}
]
},
"requestId": "1",
"debugInfo": {
"request": {
"action": "listDatabases",
"requestId": "1",
"debug": "max",
"authToken": "replaceWithAuthTokenFromCreateSession"
},
"serverSuppliedValues": {
"databaseName": null,
"ownerName": null
},
"errorData": {
"errorData": null
},
"warnings": []
},
"errorCode": 0,
"errorMessage": "",
"authToken": "replaceWithAuthTokenFromCreateSession"
}Maximal
{
"authToken": "replaceWithAuthTokenFromCreateSession",
"result": {
"dataFormat": "objects",
"fields": [
{
"name": "databaseName",
"type": "varchar",
"length": 8192,
"scale": null,
"defaultValue": null,
"nullable": false,
"primaryKey": 0,
"autoValue": "none"
},
{
"name": "path",
"type": "varchar",
"length": 8192,
"scale": null,
"defaultValue": null,
"nullable": false,
"primaryKey": 0,
"autoValue": "none"
},
{
"name": "uid",
"type": "bigint",
"length": null,
"scale": null,
"defaultValue": null,
"nullable": false,
"primaryKey": 0,
"autoValue": "none"
}
],
"data": [
{
"databaseName": "ctreeSQL",
"path": ".\\ctreeSQL.dbs\\SQL_SYS",
"uid": 999
}
]
},
"requestId": "00000010",
"debugInfo": {
"request": {
"authToken": "replaceWithAuthTokenFromCreateSession",
"api": "db",
"action": "listDatabases",
"params": {
"partialDatabaseName": "ctr",
"skipRecords": 0,
"maxRecords": 20,
"transactionId": null
},
"apiVersion": "1.0",
"requestId": "00000010",
"responseOptions": {
"binaryFormat": "hex",
"dataFormat": "objects",
"numberFormat": "string"
},
"debug": "max"
},
"serverSuppliedValues": {
"databaseName": null,
"ownerName": null
},
"errorData": {
"errorData": null
},
"warnings": []
},
"errorCode": 0,
"errorMessage": ""
}
Request properties ("params")
| Property | Description | Default | Type | Limits (inclusive) |
maxRecords |
The "maxRecords" property specifies the maximum number of records to be returned. It is used with "skipRecords" to paginate the results. If the value is not null or omitted, the server returns the maximum number of results specified by "maxRecords". |
Optional with default of 20
|
integer |
-1 to 65535
|
partialDatabaseName |
The
|
Optional with default of ""
|
string | 0 to 64 bytes |
skipRecords |
The "skipRecords" property specifies the number of records to skip over when paginating the results. It is used with "maxRecords" to paginate the results. If the value is not null or omitted, the server returns results from the beginning. If it is > 0, the server skips over the specified number of records and returns results starting from that point up until it returns the maximum number of results as defined by "maxRecords". |
Optional with default of 0
|
integer |
0 to 9223372036854775807
|
transactionId |
The "transactionId" property identifies a transaction in which the specified action will be included. |
Optional with default of ""
|
string | 0 to 255 bytes |
Response properties ("result")
| Property | Description | Type | Limits (inclusive) |
data |
The "data" property specifies an array or object that the server returns, such as records returned by a query. It is an empty array when no results are available. |
array | Its contents are determined by the action |
dataFormat |
The
|
string |
"autoDetect""arrays""objects"
|
fields |
The "fields" property specifies an array of objects set by the server, where each object is the definition of a field in a table defining the details of each field returned by a query. |
array |
|
|
fields .autoValue |
The "autoValue" property specifies when and how the server automatically sets the field value. See for more details. |
string |
"none""incrementOnInsert""timestampOnInser""timestampOnUpdate""timestampOnUpdateAndInsert""changeid"
|
|
fields .defaultValue |
The "defaultValue" property specifies the default value of a field. It is used when a record is inserted without specifying a value for the field. The server coerces the string value into the proper field type. |
string | 0 to 65,500 bytes |
|
fields .length |
The "length" property specifies the length of a field's value in a record. |
integer |
1 to 65500
|
|
fields .name |
The "name" property specifies the new name of the field. |
string | 0 to 64 bytes |
|
fields .nullable |
The "nullable" property allows a field to contain a NULL value when true. |
Boolean |
truefalse
|
|
fields .primaryKey |
The "primaryKey" property adds a field to the specified ordinal position of the table's primary key when > 0. |
integer |
0 to 32
|
|
fields .scale |
The "scale" property specifies the number of places to the right of the decimal point for "number" and "money" type fields. |
integer |
0 to 32
|
|
fields .type |
Identifies the type of the field. See Data types. | string |
"bit""tinyint""smallint""integer""bigint""real""float""number""money""date""time""timestamp""char""varchar""lvarchar""binary""varbinary""lvarbinary""json"
|