MCPcopy Create free account
hub / github.com/hashintel/hash / run_impl

Function run_impl

libs/@local/hashql/eval/tests/orchestrator/execution.rs:114–156  ·  view source on GitHub ↗
(
    pipeline: &mut Pipeline<'heap>,

    runtime: &runtime::Runtime,
    client: &Client,

    inputs: &Inputs<'heap, &'heap Heap>,

    interner: hashql_mir::intern::Interner<'heap>,
    entry: Def

Source from the content-addressed store, hash-verified

112}
113
114fn run_impl<'heap>(
115 pipeline: &mut Pipeline<'heap>,
116
117 runtime: &runtime::Runtime,
118 client: &Client,
119
120 inputs: &Inputs<'heap, &'heap Heap>,
121
122 interner: hashql_mir::intern::Interner<'heap>,
123 entry: DefId,
124 bodies: &mut DefIdSlice<Body<'heap>>,
125) -> Result<(Value<'heap, &'heap Heap>, Vec<Event>), BoxedDiagnostic<'static, SpanId>> {
126 pipeline.transform(&interner, bodies)?;
127 let analysis = pipeline.prepare(&interner, bodies)?;
128
129 let interner = interner.into();
130 let mut context = CodeGenerationContext::new_in(
131 &pipeline.env,
132 &interner,
133 bodies,
134 &analysis,
135 pipeline.heap,
136 &mut pipeline.scratch,
137 );
138 let mut postgres = PostgresCompiler::new_in(&mut context, &mut pipeline.scratch);
139 let queries = postgres.compile();
140 pipeline.scratch.reset();
141
142 let diagnostics = mem::take(&mut context.diagnostics);
143 pipeline.diagnostics.append(&mut diagnostics.boxed());
144
145 let event_log = AppendEventLog::new();
146 let context = CodeExecutionContext::from(context);
147 let orchestrator =
148 Orchestrator::new(PostgresClient(client), &queries, &context).with_event_log(&event_log);
149
150 let value = runtime
151 .block_on(orchestrator.run_in(inputs, entry, [], pipeline.heap))
152 .map_err(Diagnostic::generalize)
153 .map_err(Diagnostic::boxed)?;
154
155 Ok((value, event_log.take()))
156}

Callers 2

runFunction · 0.85
executeFunction · 0.85

Calls 14

takeFunction · 0.85
PostgresClientClass · 0.85
OkInterface · 0.85
transformMethod · 0.80
with_event_logMethod · 0.80
map_errMethod · 0.80
resetMethod · 0.65
appendMethod · 0.65
fromFunction · 0.50
prepareMethod · 0.45
compileMethod · 0.45
boxedMethod · 0.45

Tested by

no test coverage detected