| 423 | * @since 4.0.0 |
| 424 | */ |
| 425 | export const layerConfig = ( |
| 426 | config: Config.Wrap<MysqlClientConfig> |
| 427 | ): Layer.Layer<MysqlClient | Client.SqlClient, Config.ConfigError | SqlError> => |
| 428 | Layer.effectContext( |
| 429 | Config.unwrap(config).pipe( |
| 430 | Effect.flatMap(make), |
| 431 | Effect.map((client) => |
| 432 | Context.make(MysqlClient, client).pipe( |
| 433 | Context.add(Client.SqlClient, client) |
| 434 | ) |
| 435 | ) |
| 436 | ) |
| 437 | ).pipe(Layer.provide(Reactivity.layer)) |
| 438 | |
| 439 | /** |
| 440 | * Creates a layer from a concrete MySQL client configuration, providing both `MysqlClient` and `SqlClient`. |