Skip to main content

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[DataSourceSummary]

List data sources with pagination and filtering.

Each data source is its summary; retrieve returns the full one.

Parameters

  • search (str | None, optional): Search by name, label, or description.
  • type (str | None, optional): Filter by data source type (e.g. "postgres", "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) -> DataSource

Create a new data source.

Parameters

  • name (str): Data source name.
  • label (str): Human-readable label.
  • type (str): Data source type, the vendor key (e.g. "postgres", not "postgresql"; "mysql", "duckdb"). Its category is set from the type.
  • credentials (Mapping[str, Any]): Exactly the type's connection fields, as its Create Data Source form names them (WorkflowNodes.datasource_fields); a field the type does not have is refused.
  • description (str | None, optional): Data source description.

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) -> 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) -> DataSourceCredentials

Get decrypted data source credentials.

list_objects​

list_objects(datasource_id: str, *, bucket: str | None = None, prefix: str | None = None) -> BucketListing

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 as exports/) to list under.

metadata​

metadata(datasource_id: str) -> DataSourceMetadata

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".

stats​

stats(*, search: str | None = None, type: str | None = None, category: str | None = None, status: str | None = None) -> DataSourceStats

Count the data sources list lists, with the same filters.

It counts them in all, by status, type and category, and how many times a workload launched with them.

Every data source the list holds for you with these filters is counted (not a page).

Parameters

  • search, type, category, status (optional): As list takes them.

Returns

  • DataSourceStats: total, by_status, by_type, by_category (most first) and usage_count (each launch counts each data source it uses once).

status​

status(datasource_id: str) -> DataSourceStatus

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) -> TableDetails

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 (public for PostgreSQL); the default when omitted.

test_connection​

test_connection(datasource_id: str) -> ConnectionTest

Test the connection for a data source.

time_series​

time_series(data_source_id: str, *, window: SeriesWindow | None = None, granularity: SeriesGranularity | None = None) -> DataSourceLaunchesSeries

Get a data source's launches over time, from its launch log.

Each time an app, workspace, job, workflow run or AutoML job is launched with it, one record says who it was launched for and which workload. Each point has launches and users (how many different people they were launched for). Whoever may read the data source may read it.

Every hour (24h) or UTC day (7d, 30d) of the window is a point, from the one its start falls in to the current one; a quiet point counts zero.

Parameters

  • data_source_id (str): The data source ID.
  • window ({"24h", "7d", "30d"} | None, optional): The window. The API's default is "30d".
  • granularity ({"hourly", "daily"} | None, optional): hourly for 24h, daily otherwise; the window's when left out (another is refused).