IDataSourcesService
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Service to work with data sources
export interface IDataSourcesService
Methods
Method | Description |
|---|---|
(ALPHA) Creates a data source. | |
(ALPHA) Deletes a data source. | |
(ALPHA) Returns service that can be used to manage files of data sources that keep their data in files. | |
(ALPHA) Generates a logical data model from the physical data model of a data source. | |
(ALPHA) Returns a data source with its connection details. | |
(ALPHA) Returns the identifier of one data source, with the permissions of the current user. | |
(ALPHA) Returns data source identifiers | |
(ALPHA) Returns all data sources that the current user can see, sorted by name. | |
(ALPHA) Returns names of the schemata available in a data source. | |
(ALPHA) Checks if the current user can see at least one data source. | |
(ALPHA) Changes some properties of a data source. | |
(ALPHA) Registers an upload notification for a data source. The backend then computes the reports again with the new data and drops the cached results of the data source. | |
(ALPHA) Reads the physical data model of a data source. | |
(ALPHA) Reads the columns of the result of an SQL statement and the first rows of the result. | |
(ALPHA) Tests a connection to a data source. | |
(ALPHA) Replaces a data source with a new definition. |
Method details
IDataSourcesService.createDataSource()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Creates a data source.
createDataSource(definition: IDataSourceDefinition): Promise<IDataSourceDescriptor>;
Parameters
Parameter | Type | Description |
|---|---|---|
definition | definition of the data source |
Returns
Promise<IDataSourceDescriptor>
IDataSourcesService.deleteDataSource()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Deletes a data source.
deleteDataSource(id: string): Promise<void>;
Parameters
Parameter | Type | Description |
|---|---|---|
id | string | identifier of the data source |
Returns
Promise<void>
IDataSourcesService.files()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Returns service that can be used to manage files of data sources that keep their data in files.
files(): IDataSourceFilesService;
Returns
IDataSourcesService.generateLogicalModel()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Generates a logical data model from the physical data model of a data source.
generateLogicalModel(dataSourceId: string, request: IGenerateLogicalModelRequest): Promise<IDeclarativeLogicalModel>;
Parameters
Parameter | Type | Description |
|---|---|---|
dataSourceId | string | identifier of the data source |
request | options of the generation |
Returns
Promise<IDeclarativeLogicalModel>
IDataSourcesService.getDataSource()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Returns a data source with its connection details.
getDataSource(id: string): Promise<IDataSourceDescriptor>;
Parameters
Parameter | Type | Description |
|---|---|---|
id | string | identifier of the data source |
Returns
Promise<IDataSourceDescriptor>
IDataSourcesService.getDataSourceIdentifier()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Returns the identifier of one data source, with the permissions of the current user.
getDataSourceIdentifier(id: string): Promise<IDataSourceDescriptor>;
Parameters
Parameter | Type | Description |
|---|---|---|
id | string | identifier of the data source |
Returns
Promise<IDataSourceDescriptor>
Remarks
Unlike IDataSourcesService.getDataSource(), this needs only the permission to use the data source. The result has no connection details.
IDataSourcesService.getDataSourceIdentifiers()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Returns data source identifiers
getDataSourceIdentifiers(): Promise<IDataSourceIdentifierDescriptor[]>;
Returns
Promise<IDataSourceIdentifierDescriptor[]>
IDataSourcesService.getDataSources()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Returns all data sources that the current user can see, sorted by name.
getDataSources(): Promise<IDataSourceDescriptor[]>;
Returns
Promise<IDataSourceDescriptor[]>
Remarks
The result contains the permissions of the current user, but not the connection details.
IDataSourcesService.getSchemata()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Returns names of the schemata available in a data source.
getSchemata(dataSourceId: string): Promise<string[]>;
Parameters
Parameter | Type | Description |
|---|---|---|
dataSourceId | string | identifier of the data source |
Returns
Promise<string[]>
IDataSourcesService.hasDataSources()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Checks if the current user can see at least one data source.
hasDataSources(): Promise<boolean>;
Returns
Promise<boolean>
false also when the backend refuses the request
IDataSourcesService.patchDataSource()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Changes some properties of a data source.
patchDataSource(id: string, patch: IDataSourcePatch): Promise<IDataSourceDescriptor>;
Parameters
Parameter | Type | Description |
|---|---|---|
id | string | identifier of the data source |
patch | properties to change |
Returns
Promise<IDataSourceDescriptor>
IDataSourcesService.registerUploadNotification()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Registers an upload notification for a data source. The backend then computes the reports again with the new data and drops the cached results of the data source.
registerUploadNotification(dataSourceId: string): Promise<void>;
Parameters
Parameter | Type | Description |
|---|---|---|
dataSourceId | string | identifier of the data source |
Returns
Promise<void>
IDataSourcesService.scan()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Reads the physical data model of a data source.
scan(dataSourceId: string, request: IDataSourceScanRequest): Promise<IDataSourceScanResult>;
Parameters
Parameter | Type | Description |
|---|---|---|
dataSourceId | string | identifier of the data source |
request | options of the scan |
Returns
Promise<IDataSourceScanResult>
IDataSourcesService.scanSql()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Reads the columns of the result of an SQL statement and the first rows of the result.
scanSql(dataSourceId: string, sql: string): Promise<ISqlScanResult>;
Parameters
Parameter | Type | Description |
|---|---|---|
dataSourceId | string | identifier of the data source |
sql | string | the SQL statement |
Returns
Promise<ISqlScanResult>
IDataSourcesService.testConnection()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Tests a connection to a data source.
testConnection(connection: IDataSourceConnectionTest, dataSourceId?: string): Promise<IDataSourceConnectionTestResult>;
Parameters
Parameter | Type | Description |
|---|---|---|
connection | connection details to test | |
dataSourceId | string | (Optional) identifier of a saved data source; when set, the backend uses its stored secrets for the details that the connection does not specify |
Returns
Promise<IDataSourceConnectionTestResult>
promise that does not reject when the test fails; the result has the reason instead
IDataSourcesService.updateDataSource()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Replaces a data source with a new definition.
updateDataSource(id: string, definition: IDataSourceDefinition): Promise<IDataSourceDescriptor>;
Parameters
Parameter | Type | Description |
|---|---|---|
id | string | identifier of the data source |
definition | new definition of the data source |
Returns
Promise<IDataSourceDescriptor>