"listIndexes" (JSON Action)
JSON DB "listIndexes" action returns indexes that the logged-in user is allowed to see
The "listIndexes" action lists indexes in the specified database table that the logged-in user is allowed to see. It retrieves all indexes associated with a specific table.
Request examples
Minimal
{
"api": "db",
"action": "listIndexes",
"params": {
"databaseName": "ctreeSQL",
"tableName": "athlete"
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}
{
"api": "db",
"apiVersion": "1.0",
"requestId": "2",
"action": "listIndexes",
"params": {
"databaseName": "ctreeSQL",
"ownerName": "admin",
"tableName": "athlete",
"skipRecords": 0,
"maxRecords": 20
},
"responseOptions": {
"binaryFormat": "hex",
"dataFormat": "objects",
"numberFormat": "string"
},
"debug": "max",
"authToken": "replaceWithAuthTokenFromCreateSession"
}
{
"result": {
"data": [
{
"collectStats": false,
"compression": "off",
"conditionalExpression": null,
"databaseName": "ctreeSQL",
"deferIndexing": false,
"fields": [
{
"caseInsensitive": false,
"name": "id",
"reverseCompare": false,
"sortDescending": false
}
],
"filename": "admin_athlete.idx",
"immutableKeys": false,
"indexName": "id_pk",
"indexNumber": 0,
"ownerName": "admin",
"tableName": "athlete",
"unique": true
},
{
"collectStats": true,
"compression": "off",
"conditionalExpression": null,
"databaseName": "ctreeSQL",
"deferIndexing": false,
"fields": [
{
"caseInsensitive": false,
"name": "ranking",
"reverseCompare": false,
"sortDescending": false
}
],
"filename": "admin_athlete.idx",
"immutableKeys": false,
"indexName": "ranking",
"indexNumber": 1,
"ownerName": "admin",
"tableName": "athlete",
"unique": false
},
{
"collectStats": true,
"compression": "off",
"conditionalExpression": null,
"databaseName": "ctreeSQL",
"deferIndexing": false,
"fields": [
{
"caseInsensitive": false,
"name": "earnings",
"reverseCompare": false,
"sortDescending": false
}
],
"filename": "admin_athlete.idx",
"immutableKeys": false,
"indexName": "earnings",
"indexNumber": 2,
"ownerName": "admin",
"tableName": "athlete",
"unique": false
},
{
"collectStats": true,
"compression": "on",
"conditionalExpression": "livedpast2000 == 1",
"databaseName": "ctreeSQL",
"deferIndexing": false,
"fields": [
{
"caseInsensitive": true,
"name": "name",
"reverseCompare": true,
"sortDescending": true
}
],
"filename": ".\\ctreeSQL.dbs\\admin_athlete_name_livedpast2000.idx",
"immutableKeys": false,
"indexName": "name_livedpast2000",
"indexNumber": 3,
"ownerName": "admin",
"tableName": "athlete",
"unique": false
}
]
},
"errorCode": 0,
"errorMessage": "",
"authToken": "replaceWithAuthTokenFromCreateSession"
}
{
"result": {
"data": [
{
"collectStats": false,
"compression": "off",
"conditionalExpression": null,
"databaseName": "ctreeSQL",
"deferIndexing": false,
"fields": [
{
"caseInsensitive": false,
"name": "id",
"reverseCompare": false,
"sortDescending": false
}
],
"filename": "admin_athlete.idx",
"immutableKeys": false,
"indexName": "id_pk",
"indexNumber": 0,
"ownerName": "admin",
"tableName": "athlete",
"unique": true
},
{
"collectStats": true,
"compression": "off",
"conditionalExpression": null,
"databaseName": "ctreeSQL",
"deferIndexing": false,
"fields": [
{
"caseInsensitive": false,
"name": "ranking",
"reverseCompare": false,
"sortDescending": false
}
],
"filename": "admin_athlete.idx",
"immutableKeys": false,
"indexName": "ranking",
"indexNumber": 1,
"ownerName": "admin",
"tableName": "athlete",
"unique": false
},
{
"collectStats": true,
"compression": "off",
"conditionalExpression": null,
"databaseName": "ctreeSQL",
"deferIndexing": false,
"fields": [
{
"caseInsensitive": false,
"name": "earnings",
"reverseCompare": false,
"sortDescending": false
}
],
"filename": "admin_athlete.idx",
"immutableKeys": false,
"indexName": "earnings",
"indexNumber": 2,
"ownerName": "admin",
"tableName": "athlete",
"unique": false
},
{
"collectStats": true,
"compression": "on",
"conditionalExpression": "livedpast2000 == 1",
"databaseName": "ctreeSQL",
"deferIndexing": false,
"fields": [
{
"caseInsensitive": true,
"name": "name",
"reverseCompare": true,
"sortDescending": true
}
],
"filename": ".\\ctreeSQL.dbs\\admin_athlete_name_livedpast2000.idx",
"immutableKeys": false,
"indexName": "name_livedpast2000",
"indexNumber": 3,
"ownerName": "admin",
"tableName": "athlete",
"unique": false
}
]
},
"requestId": "2",
"debugInfo": {
"request": {
"api": "db",
"action": "listIndexes",
"params": {
"databaseName": "ctreeSQL",
"ownerName": "admin",
"tableName": "athlete",
"skipRecords": 0,
"maxRecords": 20
},
"apiVersion": "1.0",
"requestId": "2",
"responseOptions": {
"binaryFormat": "hex",
"dataFormat": "objects",
"numberFormat": "string"
},
"debug": "max",
"authToken": "replaceWithAuthTokenFromCreateSession"
},
"serverSuppliedValues": {
"databaseName": "ctreeSQL",
"ownerName": "admin"
},
"errorData": {
"errorData": null
},
"warnings": []
},
"errorCode": 0,
"errorMessage": "",
"authToken": "replaceWithAuthTokenFromCreateSession"
}
Use the listIndexes API action to list indexes in the specified database table that the logged-in user is allowed to see
The "params" property is an object that contains an action's request parameters as defined by a set of properties. Each action defines its own required and optional properties. See System limits for a comprehensive overview of property requirements and limitations.
"params" property summariesProperty | Description | Default | Type | Limits (inclusive) |
|---|---|---|---|---|
(optional) specifies the name of a database. | Defaults to the | string | 1 to 64 bytes | |
(optional) specifies the maximum number of records to return from an action. |
| integer |
| |
(optional) specifies the unique name of a schema in a database. |
| string | 1 to 64 bytes | |
(optional) specifies the number of records to skip over in the results before returning records. |
| integer |
| |
specifies the name of a table | Required - No default value | string | 1 to 64 bytes |
The "databaseName" property is an optional string that specifies the database that contains the tables. It defaults to the database name supplied at login.
Note
In the API Explorer, "defaultDatabaseName" is set to "ctreeSQL" in the "createSession" action that happens at login.
A zero-length
"databaseName"is invalid.Its length limit is from 0 to 64 bytes.
If the
"databaseName"property is omitted or set tonull, the server will use the default database name specified at login.If no default database is specified during
"createSession","databaseName"will be set to the"defaultDatabaseName"value that is specified in theservices.jsonfile.
"params": {
"databaseName": "mainDatabase"
}
The "maxRecords" is an optional integer from -1 to 65535 that sets the maximum number of records to return from an action. It is used in query actions to paginate the query results when returning records directly. The default for most actions is to return 20 records.
Important
-1 returns all records and should be used very carefully because a large query can return so many records that it eventually times out and wastes server and client resources.
When present,
"maxRecords"works in conjunction with the"skipRecords"(and, when applicable,"reverseOrder") properties to paginate results."maxRecords"returns an error when"returnCursor"istrue.Note
This does not apply to the actions where
"returnCursor"is not present.When returning a cursor, retrieve records using the
"getRecordsFromCursor"action.A value of
0for"maxRecords"is not useful because it causes the action to return no records."maxRecords"is ignored by the"getRecordsByIds"action.
The "ownerName" property is an optional string from 1 to 64 bytes that identifies the user who owns an object (see Object owner). If it is omitted or set to "" or null, the server uses the default owner name supplied during the "createSession" action or uses the account's "username" as the owner name.
"params": {
"ownerName": "SuperUser"
}
The "skipRecords" property is an optional integer from 0 to 9223372036854775807. It is used in query actions to paginate the query results when returning records directly. It defaults to 0.
It specifies the number of records to skip over in the results before returning records.
It works with
"maxRecords"and"reverseOrder".It is ignored when
"returnCursor"istrue.Note
This does not apply to the actions where
"returnCursor"is not present.
The required "tableName" property is a string containing the name of a table.
See table name in System limits for the table naming requirements and limitations.
Example request
"params": {
"tableName": "ctreeTable"
}
"result" properties summaryProperty | Description | Type | Limits (inclusive) |
|---|---|---|---|
data | is an array of objects or arrays. Each item in the array describes a record. The array is empty if no results are available. | array | The action determines its contents. |