use layer / layerConfig convention for sql-* packages (#3852)

This commit is contained in:
Milan Suk
2024-10-29 11:46:33 +13:00
committed by GitHub
parent 68e7aa2450
commit 70dd4d7cd2
25 changed files with 228 additions and 65 deletions
+15 -1
View File
@@ -254,7 +254,7 @@ export const make = (
* @category layers
* @since 1.0.0
*/
export const layer = (
export const layerConfig = (
config: Config.Config.Wrap<SqliteClientConfig>
): Layer.Layer<SqliteClient | Client.SqlClient, ConfigError> =>
Layer.scopedContext(
@@ -267,3 +267,17 @@ export const layer = (
)
)
)
/**
* @category layers
* @since 1.0.0
*/
export const layer = (
config: SqliteClientConfig
): Layer.Layer<SqliteClient | Client.SqlClient, ConfigError> =>
Layer.scopedContext(
Effect.map(make(config), (client) =>
Context.make(SqliteClient, client).pipe(
Context.add(Client.SqlClient, client)
))
)