( config: PgClientConfig )
| 572 | * @since 1.0.0 |
| 573 | */ |
| 574 | export const layer = ( |
| 575 | config: PgClientConfig |
| 576 | ): Layer.Layer<PgClient | Client.SqlClient, SqlError> => |
| 577 | Layer.scopedContext( |
| 578 | Effect.map(make(config), (client) => |
| 579 | Context.make(PgClient, client).pipe( |
| 580 | Context.add(Client.SqlClient, client) |
| 581 | )) |
| 582 | ).pipe(Layer.provide(Reactivity.layer)) |
| 583 | |
| 584 | /** |
| 585 | * @category layers |