internal Query(ConnectionsContext connectionsContext, ExecutionPlanByServer executionPlanByServer, int formatVersion) { _connectionsContext = connectionsContext; _executionPlanByServer = executionPlanByServer; FormatVersion = formatVersion; }
public static Query Load(string path) { if (!File.Exists(path)) { throw new FileNotFoundException(path); } int formatVersion; string description; HashSet <Connection> connections; Metadatas metadata; ExecutionPlanByServer executionPlanByServer; FastAccessList <object> referenceTracking; //using (var istream = new FileStream(path, FileMode.Open)) //using (var lzstream = new LZ4Stream(istream, CompressionMode.Decompress)) //using (var bstream = new BinaryReader(lzstream, Encoding.UTF8, true)) //{ // formatVersion = bstream.ReadInt32(); // description = bstream.ReadString(); // referenceTracking = DeserializeReferenceTracking(bstream); // connections = DeserializeConnections(bstream); // executionPlanByServer = ExecutionPlanByServer.Deserialize(bstream, referenceTracking); // metadata = AppMetadata.Deserialize(bstream, referenceTracking); //} using (var istream = new FileStream(path, FileMode.Open)) using (var bstream = new BinaryReader(istream, Encoding.UTF8, true)) { formatVersion = bstream.ReadInt32(); description = bstream.ReadString(); referenceTracking = DeserializeReferenceTracking(bstream); connections = DeserializeConnections(bstream); executionPlanByServer = ExecutionPlanByServer.Deserialize(bstream, referenceTracking); metadata = Metadatas.Deserialize(bstream, referenceTracking); } //Initialize a connection context with values used at the time of the creation of the clone. var connectionsContext = new ConnectionsContext(); connectionsContext.Initialize(connections.ToList(), metadata); return(new Query(connectionsContext, executionPlanByServer, formatVersion) { Description = description }); }
public ExecutionContext() { ConnectionsContext = new ConnectionsContext(); Map = new Dictionary <SehemaIdentifier, SehemaIdentifier>(); }
public static object[][] Select(this ConnectionsContext connectionsContext, RowIdentifier row) { var ctx = connectionsContext[row]; return(ctx.QueryProvider.Select(ctx.Connection, connectionsContext.Metadatas, row)); }