Getting External Database Collections
Function: external_database_list()
Purpose
This function retrieves a list of external database collections configured for a given Exsited instance. It returns all available collections along with metadata such as whether CSV upload is allowed, whether new tables can be added, and a set of dropdown actions applicable to each collection. This API is typically used to display an external database list in the UI, validate availability before performing operations, or automate processes related to external data management.
Parameters
| Parameter | Type | Description |
|---|---|---|
| limit | integer | Optional number of records to return. |
| offset | integer | Optional number of records to skip for pagination. |
Use Case
This function is used to retrieve the list of external database collections to display them in a UI, determine which collections are available for data operations, or automate workflows that depend on collection availability, CSV uploads, or adding new tables. For example, before allowing a user to import a CSV file, the system must check if the selected external database supports CSV uploads. Similarly, if an automated scheduled job needs to populate data into an external collection, it must verify that the collection exists. Using the SDK function for this endpoint eliminates the need to manually call the API and allows consistent integration with authentication, error handling, and token management.
def external_database_list():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "PATH_TO_SHARED_TOKEN_FILE.json"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
response = exsited_sdk.external_database.external_database_list(
instance_code="PLACEHOLDER_INSTANCE_CODE",
limit=PLACEHOLDER_LIMIT,
offset=PLACEHOLDER_OFFSET
)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
Response
The response returns the success status of the request, a message describing the result, the list of database collections if available, and flags indicating whether CSV upload and table creation are allowed. Additionally, it includes a list of dropdown action items representing operations the user can perform on each collection, such as editing or deleting. If no collections exist, the response still contains metadata for allowed actions.
{
"success": true,
"message": "PLACEHOLDER_MESSAGE_TEXT",
"collections": [
{
"collectionName": "PLACEHOLDER_COLLECTION_NAME",
"records": PLACEHOLDER_RECORD_COUNT,
"createdAt": "PLACEHOLDER_CREATED_TIMESTAMP",
"updatedAt": "PLACEHOLDER_UPDATED_TIMESTAMP"
}
],
"canUploadCSV": true,
"canAddTable": true,
"dotDropdownItems": [
{
"label": "PLACEHOLDER_LABEL_1",
"value": "PLACEHOLDER_VALUE_1"
},
{
"label": "PLACEHOLDER_LABEL_2",
"value": "PLACEHOLDER_VALUE_2"
}
],
"code": PLACEHOLDER_STATUS_CODE
}
Getting External Database Details
Function: external_database_details()
Purpose
This function retrieves detailed information for a specific external database identified by its database name. It returns a list of tables or sheets contained within the selected external database along with metadata such as count, limit, offset, and status code. This is used when an application needs to display or process the detailed structure of a particular external database before performing operations like data import, synchronization, or UI rendering.
Parameters
| Parameter | Type | Description |
|---|---|---|
| database_name | string | Required name of the external database to retrieve details from. |
| limit | integer | Optional number of table records to return. |
| offset | integer | Optional number of records to skip for pagination. |
Use Case
This function is used to fetch the list of tables inside a specific external database to make decisions such as determining which sheet to import, validating table existence before running automated jobs, or dynamically rendering available sheets in a user interface. For example, if an automated workflow needs to read data from a database named "industry", the system must first confirm that the database exists and then identify the correct sheet. Using this SDK method ensures consistent authentication, error handling, and pagination support without writing raw API requests.
def external_database_details():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "PATH_TO_SHARED_TOKEN_FILE.json"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
response = exsited_sdk.external_database.external_database_details(
db_name="PLACEHOLDER_DATABASE_NAME",
limit=PLACEHOLDER_LIMIT,
offset=PLACEHOLDER_OFFSET
)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
Response
The response returns the success status, total number of tables available in the specified database, pagination details, and a list containing all table or sheet names under the database. This information is useful for validating existence, choosing which sheet to process, or presenting available sheets to the user.
{
"success": true,
"count": PLACEHOLDER_COUNT,
"limit": PLACEHOLDER_LIMIT,
"offset": PLACEHOLDER_OFFSET,
"list": {
"PLACEHOLDER_DATABASE_NAME": [
{
"id": PLACEHOLDER_TABLE_ID,
"name": "PLACEHOLDER_TABLE_NAME"
}
]
},
"code": PLACEHOLDER_STATUS_CODE
}
Getting External Database Table Details
Function: external_database_table_details()
Purpose
This function retrieves the column structure of a specific table within an external database. By providing the database name and table name, the system returns metadata about the table’s columns, such as their identifiers and names. This helps applications understand the schema of the external data source before performing actions like importing rows, validating data, mapping fields, or generating dynamic forms.
Parameters
| Parameter | Type | Description |
|---|---|---|
| database_name | string | Required name of the external database containing the target table. |
| table_name | string | Required name of the table whose column details need to be fetched. |
Use Case
A typical scenario involves an application or automation script that needs to prepare for data import or field mapping by first verifying the structure of an external database table. For example, before syncing data from an external sheet named "PLACEHOLDER_TABLE_NAME" in a database called "PLACEHOLDER_DATABASE_NAME", the system must know the available columns. This SDK method allows developers to retrieve that structure instantly without manually inspecting the database. It ensures consistent authentication, standardized handling of the response, and reduces complexity for the QA team when validating table structures.
def external_database_table_details():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "PATH_TO_SHARED_TOKEN_FILE.json"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
response = exsited_sdk.external_database.external_database_table_details(
db_name="PLACEHOLDER_DATABASE_NAME",
table_name="PLACEHOLDER_TABLE_NAME"
)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
Response
The response provides the status of the request, a message describing the result, and a list containing the columns found in the specified table. Each column includes an identifier and a column name. This is essential for validating that the table structure matches what the system expects before initiating data operations.
{
"status": "success",
"message": "Column for table PLACEHOLDER_TABLE_NAME fetched successfully",
"data": [
{
"id": PLACEHOLDER_COLUMN_ID,
"name": "PLACEHOLDER_COLUMN_NAME"
}
],
"code": PLACEHOLDER_STATUS_CODE
}