Data API
The Data API allows you to connect, manage, and query external data sources within your workspaces.Connect Data Source
Connect an external database to a workspace.- Python SDK
- REST API
| Parameter | Type | Required | Description |
|---|---|---|---|
database_payload | Database | Yes | The database connection configuration |
compute_row_count | bool | No | Whether to compute row counts for tables. Defaults to False |
Response
List Data Sources
List all connected data sources in a workspace.- Python SDK
- REST API
Cleanup Data Sources
Remove data sources from a workspace.- Python SDK
- REST API
| Parameter | Type | Required | Description |
|---|---|---|---|
source_ids | list | No | List of specific source IDs to clean up. If None, cleans up all sources |
Infer Schema
Infer schema from a database configuration.- Python SDK
- REST API
| Parameter | Type | Required | Description |
|---|---|---|---|
database | Database or dict | Yes | The database connection configuration |
add_bind | bool | No | Whether to add bind metadata. Defaults to True |
add_model | bool | No | Whether to add model metadata. Defaults to False |
Database Class
The Python SDK provides aDatabase class for structured database configuration.
Constructor Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
database_type | str | Yes | Database type (e.g., ‘postgresql’, ‘mysql’, ‘csv’, ‘snowflake’) |
username | str | No | Database username |
password | str | No | Database password |
host | str | No | Database host address |
port | int | No | Database port number |
database_name | str | No | Name of the database |
tables | list | No | List of specific tables to include |
schema | str | No | Database schema name |
catalog | str | No | Database catalog name |
query | str | No | Custom SQL query |
options | dict | No | Additional database-specific options |
selected_columns | list | No | Specific columns to include |
ignore_columns | list | No | Columns to exclude |
ignore_tables | list | No | Tables to exclude |
url | str | No | Direct connection URL |
Methods
to_dict(): Converts the Database object to a dictionary format suitable for API callsfrom_dict(data): Class method to create a Database object from a dictionary
Complete Workflow Example
- Python SDK
- REST API

