( config: ClickhouseClientConfig )
| 346 | * @since 1.0.0 |
| 347 | */ |
| 348 | export const layer = ( |
| 349 | config: ClickhouseClientConfig |
| 350 | ): Layer.Layer<ClickhouseClient | Client.SqlClient, ConfigError | SqlError> => |
| 351 | Layer.scopedContext( |
| 352 | Effect.map(make(config), (client) => |
| 353 | Context.make(ClickhouseClient, client).pipe( |
| 354 | Context.add(Client.SqlClient, client) |
| 355 | )) |
| 356 | ).pipe(Layer.provide(Reactivity.layer)) |
| 357 | |
| 358 | const typeFromUnknown = (value: unknown): string => { |
| 359 | if (Statement.isFragment(value)) { |