Skip to main content

sql_client_layer

Function sql_client_layer 

Source
pub fn sql_client_layer<E>(client: impl SqlClient) -> Layer<SqlClientEnv, E>
where E: From<SqlError> + Send + 'static,
Expand description

The scoped client Layer (Effect.ts Layer.scoped): building it runs SqlClient::connect (a failure fails the build with E::from(err)), and the build’s scope closing runs SqlClient::close, after the effect a provide_layer runs, however it ends.