( config: ClickhouseClientConfig )
| 474 | * @since 4.0.0 |
| 475 | */ |
| 476 | export const layer = ( |
| 477 | config: ClickhouseClientConfig |
| 478 | ): Layer.Layer<ClickhouseClient | Client.SqlClient, Config.ConfigError | SqlError> => |
| 479 | Layer.effectContext( |
| 480 | Effect.map(make(config), (client) => |
| 481 | Context.make(ClickhouseClient, client).pipe( |
| 482 | Context.add(Client.SqlClient, client) |
| 483 | )) |
| 484 | ).pipe(Layer.provide(Reactivity.layer)) |
| 485 | |
| 486 | const typeFromUnknown = (value: unknown): string => { |
| 487 | if (Statement.isFragment(value)) { |