public void QueryDispatcher_GetQueryHelper_CalledWithRowIdentifierReturnData() { var row = Make.Row("color", "id", 1); var result = _queryDispatcher.GetQueryHelper(row).Select(row); _queryDispatcher.Received().GetQueryHelper(row); _queryHelper.Received().Select(row); Assert.Equal(Make.Obj(1, "orange"), result); }
public ResultSet Execute() { //_dispatcher[riSource].EnforceIntegrityCheck(EnforceIntegrity); PlugIn.DataBuilder.ClearBuildersCache(); ResetExecutionPlan(_executionPlanByServer); Parallel.ForEach(_executionPlanByServer, a => { var qh = _dispatcher.GetQueryHelper(a.Key); qh.QueryCommmiting += Commiting; qh.Execute(a.Value); qh.QueryCommmiting -= Commiting; }); return(new ResultSet(_executionPlanByServer)); }
private static void FetchMetadata(IQueryDispatcher dispatcher, ref MetadataContainer container) { dispatcher.InitProviders(container.Metadatas, container.ConnectionStrings); foreach (var cs in container.ConnectionStrings) { var provider = dispatcher.GetQueryHelper(cs.Id); foreach (var database in provider.GetDatabasesName()) { provider.GetColumns(container.Metadatas.LoadColumns, cs.Id, database); provider.GetForeignKeys(container.Metadatas.LoadForeignKeys, cs.Id, database); provider.GetUniqueKeys(container.Metadatas.LoadUniqueKeys, cs.Id, database); } } }
//public static void Insert(this IQueryDispatcher dispatcher, TableIdentifier table, object[] row) //{ // dispatcher.GetQueryHelper(table).Insert(table, row); //} public static object[][] Select(this IQueryDispatcher dispatcher, RowIdentifier row) { return(dispatcher.GetQueryHelper(row).Select(row)); }