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

Function layer

packages/sql/mysql2/src/MysqlClient.ts:445–453  ·  view source on GitHub ↗
(
  config: MysqlClientConfig
)

Source from the content-addressed store, hash-verified

443 * @since 4.0.0
444 */
445export const layer = (
446 config: MysqlClientConfig
447): Layer.Layer<MysqlClient | Client.SqlClient, Config.ConfigError | SqlError> =>
448 Layer.effectContext(
449 Effect.map(make(config), (client) =>
450 Context.make(MysqlClient, client).pipe(
451 Context.add(Client.SqlClient, client)
452 ))
453 ).pipe(Layer.provide(Reactivity.layer))
454
455/**
456 * Creates the MySQL statement compiler, using `?` placeholders and backtick-escaped identifiers.

Callers

nothing calls this directly

Calls 6

makeFunction · 0.70
pipeMethod · 0.65
makeMethod · 0.65
addMethod · 0.65
mapMethod · 0.45
provideMethod · 0.45

Tested by

no test coverage detected