| 343 | * @since 4.0.0 |
| 344 | */ |
| 345 | export const layerConfig = ( |
| 346 | config: Config.Wrap<SqliteClientConfig> |
| 347 | ): Layer.Layer<SqliteClient | Client.SqlClient, Config.ConfigError> => |
| 348 | Layer.effectContext( |
| 349 | Config.unwrap(config).pipe( |
| 350 | Effect.flatMap(make), |
| 351 | Effect.map((client) => |
| 352 | Context.make(SqliteClient, client).pipe( |
| 353 | Context.add(Client.SqlClient, client) |
| 354 | ) |
| 355 | ) |
| 356 | ) |
| 357 | ).pipe(Layer.provide(Reactivity.layer)) |
| 358 | |
| 359 | /** |
| 360 | * Builds a layer from a node SQLite client configuration, providing both `SqliteClient` and the generic `SqlClient` service. |