| 499 | * @since 4.0.0 |
| 500 | */ |
| 501 | export const layerMemoryConfig = ( |
| 502 | config: Config.Wrap<SqliteClientMemoryConfig> |
| 503 | ): Layer.Layer<SqliteClient | Client.SqlClient, Config.ConfigError | SqlError> => |
| 504 | Layer.effectContext( |
| 505 | Config.unwrap(config).pipe( |
| 506 | Effect.flatMap(makeMemory), |
| 507 | Effect.map((client) => |
| 508 | Context.make(SqliteClient, client).pipe( |
| 509 | Context.add(Client.SqlClient, client) |
| 510 | ) |
| 511 | ) |
| 512 | ) |
| 513 | ).pipe(Layer.provide(Reactivity.layer)) |
| 514 | |
| 515 | /** |
| 516 | * Builds a layer from an in-memory SQLite WASM client configuration, providing both `SqliteClient` and the generic `SqlClient` service. |