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)

# Create
created = client.datasources.create(
name="...",
label="...",
type="...",
credentials={...},
)
print(created.id)

# Read it back
fetched = client.datasources.retrieve(created.id)

# Delete (returns None; raises on failure)
client.datasources.delete(created.id)

Methods

Core

list

list(*, search: Optional[str] = None, type: Optional[str] = None, category: Optional[str] = None, status: Optional[str] = None, limit: Optional[int] = None) -> SyncPaginator[DataSource]

List data sources with pagination and filtering.

Args: search: Search by name, label, or description. type: Filter by data source type (e.g. "postgresql", "mysql"). category: Filter by category (e.g. "database", "file"). status: Filter by connection status. limit: Maximum number of items to return (default: all matching items).

create

create(*, name: str, label: str, type: str, credentials: Mapping[str, Any], description: Optional[str] = None, category: Optional[str] = None, metadata: Optional[Mapping[str, Any]] = None) -> DataSource

Create a new data source.

Args: name: Data source name. label: Human-readable label. type: Data source type (e.g. "postgresql", "mysql"). credentials: Connection credentials as a name -> value mapping. description: Data source description. category: Data source category (e.g. "database", "file"). metadata: 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: Optional[str] = None, label: Optional[str] = None, description: Optional[str] = None, credentials: Optional[Mapping[str, Any]] = None, metadata: Optional[Mapping[str, Any]] = None) -> DataSource

Update a data source.

delete

delete(datasource_id: str) -> None

Delete a data source.

Sharing & scope

update_permissions

update_permissions(datasource_id: str, *, allow_all_users: bool, allowed_users: Sequence[str]) -> Dict[str, Any]

Update data source sharing/permissions.

Args: allow_all_users: Whether the data source is shared with all users. allowed_users: User ids granted access when not shared with all.

Other

credentials

credentials(datasource_id: str) -> Dict[str, Any]

Get decrypted data source credentials.

metadata

metadata(datasource_id: str) -> Dict[str, Any]

Get data source metadata (tables, schemas, etc.).

test_connection

test_connection(datasource_id: str) -> Dict[str, Any]

Test the connection for a data source.