| 346 | * @since 4.0.0 |
| 347 | */ |
| 348 | export const layerFrom = <E, R>( |
| 349 | acquire: Effect.Effect<PgliteClient, E, R> |
| 350 | ): Layer.Layer<PgliteClient | Client.SqlClient, E, Exclude<R, Scope.Scope | Reactivity.Reactivity>> => |
| 351 | Layer.effectContext( |
| 352 | Effect.map(acquire, (client) => |
| 353 | Context.make(PgliteClient, client).pipe( |
| 354 | Context.add(Client.SqlClient, client) |
| 355 | )) |
| 356 | ).pipe(Layer.provide(Reactivity.layer)) as any |
| 357 | |
| 358 | /** |
| 359 | * Creates a layer from a `Config`-wrapped PGlite client configuration, providing both `PgliteClient` and `SqlClient`. |