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

Class MssqlContainer

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

Source from the content-addressed store, hash-verified

32}
33
34export class MssqlContainer extends Context.Tag("test/MssqlContainer")<
35 MssqlContainer,
36 StartedMSSQLServerContainer
37>() {
38 static Live = Layer.scoped(
39 this,
40 Effect.acquireRelease(
41 Effect.promise(() => new MSSQLServerContainer().acceptLicense().start()),
42 (container) => Effect.promise(() => container.stop())
43 )
44 )
45
46 static ClientLive = Layer.unwrapEffect(
47 Effect.gen(function*() {
48 const container = yield* MssqlContainer
49 return Mssql.MssqlClient.layer({
50 server: container.getHost(),
51 port: container.getPort(),
52 username: container.getUsername(),
53 password: Redacted.make(container.getPassword()),
54 database: container.getDatabase()
55 })
56 })
57 ).pipe(Layer.provide(this.Live))
58}
59
60export class MysqlContainer extends Context.Tag("test/MysqlContainer")<
61 MysqlContainer,

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…