MCPcopy
hub / github.com/Effect-TS/effect / MysqlContainer

Class MysqlContainer

packages/sql-kysely/test/utils.ts:60–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60export class MysqlContainer extends Context.Tag("test/MysqlContainer")<
61 MysqlContainer,
62 StartedMySqlContainer
63>() {
64 static Live = Layer.scoped(
65 this,
66 Effect.acquireRelease(
67 Effect.promise(() => new MySqlContainer("mysql:lts").start()),
68 (container) => Effect.promise(() => container.stop())
69 )
70 )
71
72 static ClientLive = Layer.unwrapEffect(
73 Effect.gen(function*() {
74 const container = yield* MysqlContainer
75 return Mysql.MysqlClient.layer({
76 url: Redacted.make(container.getConnectionUri())
77 })
78 })
79 ).pipe(Layer.provide(this.Live))
80}

Callers

nothing calls this directly

Calls 4

startMethod · 0.80
pipeMethod · 0.65
makeMethod · 0.65
provideMethod · 0.65

Tested by

no test coverage detected