MCPcopy Create free account
hub / github.com/Effect-TS/effect / MysqlContainer

Class MysqlContainer

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

Source from the content-addressed store, hash-verified

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

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