public async Task <IEnumerable <EntitySchema> > FetchAllEntitiesFromDatabase(string databaseId) { var database = await _databaseServiceProvider.GetOneDatabaseConnectionAsync(databaseId); var foundAnalyzeDatabase = _analyzeDatabases.First(a => a.ConnectionType == database.GetConnectionType()); return(await foundAnalyzeDatabase.FetchAllEntitiesFromDatabase(database)); }
public async Task <DynamicListResponseDataModel> FetchData(DynamicList dynamicList, DynamicListFetchDataModel fetchDataModel) { var databaseConnection = await _databaseServiceProvider.GetOneDatabaseConnectionAsync(dynamicList.ListDatasource.DatabaseConnectionOptions.DatabaseConnectionId); var foundDynamicListQuery = _dynamicListQueryDatabases.First(a => a.ConnectionType == databaseConnection.GetConnectionType()); return(await foundDynamicListQuery.Query(databaseConnection, dynamicList, fetchDataModel)); }
public async Task <ExecutionChartResponseModel> Execute(Chart chart, ExecutionChartRequestModel model) { var databaseConnection = await _databaseServiceProvider.GetOneDatabaseConnectionAsync(chart.DatabaseOptions.DatabaseConnectionId); var foundExecution = _executionChartReports.First(a => a.ConnectionType == databaseConnection.GetConnectionType()); return(await foundExecution.Execute(new ExecutionChartReportModel { DatabaseConnection = databaseConnection, FilterValues = model.ChartFilterValues, Parameters = model.ChartParameterValues, FormattedString = chart.DatabaseOptions.Query, MappingProjection = chart.Definitions.MappingProjection, IsRealTime = model.IsRealTime, LastComparedDate = model.LastRealTimeComparedDate, ComparedRealTimeField = model.RealTimeField })); }
public async Task <DynamicListResponseDataModel> FetchData(DynamicList dynamicList, DynamicListFetchDataModel fetchDataModel) { if (!string.IsNullOrEmpty(fetchDataModel.TextSearch)) { fetchDataModel.TextSearch = fetchDataModel.TextSearch.Trim(); } var databaseConnection = await _databaseServiceProvider.GetOneDatabaseConnectionAsync(dynamicList.ListDatasource.DatabaseConnectionOptions.DatabaseConnectionId); var foundDynamicListQuery = _dynamicListQueryDatabases.First(a => a.ConnectionType == databaseConnection.GetConnectionType()); return(await foundDynamicListQuery.Query(databaseConnection, dynamicList, fetchDataModel)); }
public async Task <ExecutedDataSourceModel> GetDatasourceService(Datasource datasource) { var datasourceModels = new List <DatasourceModel>(); if (datasource.DatasourceType == DatasourceType.Static) { datasourceModels = ConvertUtil.DeserializeObject <List <DatasourceModel> >(datasource.Query); } else { var database = await _databaseServiceProvider.GetOneDatabaseConnectionAsync(datasource.DatabaseId); var foundExtractionDatasource = _extractionDatasources.First(a => a.ConnectionType == database.GetConnectionType()); datasourceModels = await foundExtractionDatasource.ExtractionDatasource(database, datasource.Query, datasource.OutputProjection); } return(new ExecutedDataSourceModel { DatasourceModels = datasourceModels, CanCache = datasource.CanCache }); }