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