Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(server): stop creating a SQLite temp file for every orchestration command #14403

Closedhaseeb-asad(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/14403/headopened View on GitHub

Showing 3 changed files with 79 additions and 20 deletions.

x
0 of 3 viewed, 3 left
55 additions and 0 deletionsapps/server/src/orchestration/Layers/ProjectionPipeline.test.tsModified
View file
@@ -115,6 +115,61 @@
​
+it.layer(Layer.fresh(makeProjectionPipelinePrefixedTestLayer("t3-projection-transaction-")))(
+ "OrchestrationProjectionPipeline caller transaction",
+ (it) => {
+ it.effect("projects inside the caller's transaction without nesting another", () =>
+ Effect.gen(function* () {
+ const projectionPipeline = yield* OrchestrationProjectionPipeline;
+ const eventStore = yield* OrchestrationEventStore;
+ const sql = yield* SqlClient.SqlClient;
+ let transactions = 0;
+ const tracer = Tracer.make({
+ span: (options) => {
+ if (options.name === "sql.transaction") transactions += 1;
+ return new Tracer.NativeSpan(options);
+ },
+ });
+ const createdAt = "2026-01-01T00:00:00.000Z";
+ const projectId = ProjectId.make("project-caller-transaction");
+​
+ const event = yield* eventStore.append({
+ type: "project.created",
+ eventId: EventId.make("evt-caller-transaction-project"),
+ aggregateKind: "project",
+ aggregateId: projectId,
+ occurredAt: createdAt,
+ commandId: CommandId.make("cmd-caller-transaction-project"),
+ causationEventId: null,