Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/server/src/persistence/Layers/Sqlite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,20 @@ export const makeSqlitePersistenceLive = Effect.fn("makeSqlitePersistenceLive")(
yield* fs.makeDirectory(path.dirname(dbPath), { recursive: true });

return Layer.provideMerge(
setup,
makeRuntimeSqliteLayer({
filename: dbPath,
Comment on lines 45 to 47
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Pass setup as the dependent layer in provideMerge

In apps/server/src/persistence/Layers/Sqlite.ts, this call now uses the two-arg Layer.provideMerge overload with arguments reversed. In Effect, that overload is provideMerge(that, self), so putting makeRuntimeSqliteLayer(...) first feeds setup into the runtime layer instead of feeding the runtime SqlClient into setup. That leaves setup without SqlClient at build time and can reproduce the original Service not found: effect/sql/SqlClient startup failure (the same inversion is repeated in SqlitePersistenceMemory).

Useful? React with 👍 / 👎.

spanAttributes: {
"db.name": path.basename(dbPath),
"service.name": "t3-server",
},
}),
setup,
);
}, Layer.unwrap);

export const SqlitePersistenceMemory = Layer.provideMerge(
setup,
makeRuntimeSqliteLayer({ filename: ":memory:" }),
setup,
);

export const layerConfig = Layer.unwrap(
Expand Down