| 258 | * @since 4.0.0 |
| 259 | */ |
| 260 | export const layerConfig = ( |
| 261 | config: Config.Wrap<SqliteClientConfig> |
| 262 | ): Layer.Layer<SqliteClient | Client.SqlClient, Config.ConfigError> => |
| 263 | Layer.effectContext( |
| 264 | Config.unwrap(config).pipe( |
| 265 | Effect.flatMap(make), |
| 266 | Effect.map((client) => |
| 267 | Context.make(SqliteClient, client).pipe( |
| 268 | Context.add(Client.SqlClient, client) |
| 269 | ) |
| 270 | ) |
| 271 | ) |
| 272 | ).pipe(Layer.provide(Reactivity.layer)) |
| 273 | |
| 274 | /** |
| 275 | * Creates a layer from a concrete Bun SQLite client configuration, providing both `SqliteClient` and `SqlClient`. |