get_data_sources
Returns the data sources of the open project — name, provider, connection string — as objects.
On this page
Signature
cat.get_data_sources()
Parameters
None.
What it does
Returns the data sources CAT loaded when the project was opened — from the project file and from every data-source list the project points to. Nothing is connected; this is what the project defines.
Returns
A .NET collection of DataSourceDefinition objects: Name, ProviderTypeAndVersion (for example SqlServer@2), ConnectionString (with environment variables already expanded), Settings, DataSourceListID, DataSourceID, and the *Raw twins with the values as written in the file.
Raises
The license key and plan check (first call of the process) raises the CatPortalError family listed on the Introduction page. With no open project: RuntimeError: There is no open project. Open a CAT project file first.
Examples
cat.open_project("D:/Testing/DwhTests.cat.yaml")
for ds in cat.get_data_sources():
print(ds.Name, ds.ProviderTypeAndVersion)
names = [ds.Name for ds in cat.get_data_sources()] # the names invoke_command accepts
Related
- Introduction — session model, logging, .NET objects, exceptions, plans and the license key.
- Data sources — the properties.
get_data_source_lists·invoke_command.