| 793 | * @since 4.0.0 |
| 794 | */ |
| 795 | export const layerFrom = <E, R>( |
| 796 | acquire: Effect.Effect<PgClient, E, R> |
| 797 | ): Layer.Layer<PgClient | Client.SqlClient, E, Exclude<R, Scope.Scope | Reactivity.Reactivity>> => |
| 798 | Layer.effectContext( |
| 799 | Effect.map(acquire, (client) => |
| 800 | Context.make(PgClient, client).pipe( |
| 801 | Context.add(Client.SqlClient, client) |
| 802 | )) |
| 803 | ).pipe(Layer.provide(Reactivity.layer)) as any |
| 804 | |
| 805 | /** |
| 806 | * Creates a layer from a `Config`-wrapped PostgreSQL pool configuration, providing both `PgClient` and `SqlClient`. |