Data Sources
Data Sources are connections to external databases and stores. Use this resource to register a connection (name, label, type, credentials), test it, read metadata, and manage sharing.
Access it as client.datasources on a Strongly client, or the same path on AsyncStrongly with await. All methods exist on both with identical signatures.
Quick start
from strongly import Strongly
client = Strongly()
# List (auto-paginates as you iterate) # filters: search, type, category, status
for data in client.datasources.list():
print(data.id)
Methods
Core
list
list(*, search: str | None = None, type: str | None = None, category: str | None = None, status: str | None = None, limit: int | None = None) -> SyncPaginator[DataSource]
List data sources with pagination and filtering.
Parameters
search(str | None, optional): Search by name, label, or description.type(str | None, optional): Filter by data source type (e.g."postgresql","mysql").category(str | None, optional): Filter by category (e.g."database","file").status(str | None, optional): Filter by connection status.limit(int | None, optional): Maximum number of items to return (default: all matching items).
create
create(*, name: str, label: str, type: str, credentials: Mapping[str, Any], description: str | None = None, category: str | None = None, metadata: Mapping[str, Any] | None = None) -> DataSource
Create a new data source.
Parameters
name(str): Data source name.label(str): Human-readable label.type(str): Data source type (e.g."postgresql","mysql").credentials(Mapping[str, Any]): Connection credentials as a name -> value mapping.description(str | None, optional): Data source description.category(str | None, optional): Data source category (e.g."database","file").metadata(Mapping[str, Any] | None, optional): Arbitrary metadata for the data source.
retrieve
retrieve(datasource_id: str) -> DataSource
Get a single data source by ID.
update
update(datasource_id: str, *, name: str | None = None, label: str | None = None, description: str | None = None, credentials: Mapping[str, Any] | None = None, metadata: Mapping[str, Any] | None = None) -> DataSource
Update a data source.
delete
delete(datasource_id: str) -> None
Delete a data source.
Other
add_member
add_member(resource_id: str, *, user_id: str, role: str) -> Permissions
Share the resource with a user.
Parameters
resource_id(str): The resource's id.user_id(str): The user to share it with.role(str):"editor"(use and change it) or"user"(use it only; types without a use-only tier, such as knowledge bases, take"editor"only).
credentials
credentials(datasource_id: str) -> dict[str, Any]
Get decrypted data source credentials.
list_objects
list_objects(datasource_id: str, *, bucket: str | None = None, prefix: str | None = None) -> dict[str, Any]
List the files and folders in an object-storage data source (S3, MinIO, GCS, Azure Blob).
Parameters
datasource_id(str): The data source's ID.bucket(str | None, optional): The bucket to list; the data source's own bucket when omitted.prefix(str | None, optional): A key prefix (a folder path such asexports/) to list under.
metadata
metadata(datasource_id: str) -> dict[str, Any]
Get data source metadata (tables, schemas, etc.).
permissions
permissions(resource_id: str) -> Permissions
Return who can reach the resource: its owner, members and their roles, and visibility.
Parameters
resource_id(str): The resource's id.
remove_member
remove_member(resource_id: str, user_id: str) -> None
Stop sharing the resource with a user.
Parameters
resource_id(str): The resource's id.user_id(str): The user to stop sharing it with.
set_visibility
set_visibility(resource_id: str, visibility: str) -> Permissions
Make the resource public (every user can find and use it) or private.
Parameters
resource_id(str): The resource's id.visibility(str):"public"or"private".
status
status(datasource_id: str) -> dict[str, Any]
Get a data source's connection health as its last test recorded it.
Parameters
datasource_id(str): The data source's ID.
table_columns
table_columns(datasource_id: str, table: str, *, schema: str | None = None) -> dict[str, Any]
Describe one table of a data source: its columns, row count and size.
Parameters
datasource_id(str): The data source's ID.table(str): The table (or collection, index, topic...) to describe.schema(str | None, optional): Its schema or namespace (publicfor PostgreSQL); the default when omitted.
test_connection
test_connection(datasource_id: str) -> dict[str, Any]
Test the connection for a data source.