(
options: PgClientConfig<R> & {
/**
* Opens a separate connection for each stream and listener when enabled.
*/
readonly acquireForStream?: boolean | undefined
}
)
| 299 | * @since 4.0.0 |
| 300 | */ |
| 301 | export const makeClient = <R = never>( |
| 302 | options: PgClientConfig<R> & { |
| 303 | /** |
| 304 | * Opens a separate connection for each stream and listener when enabled. |
| 305 | */ |
| 306 | readonly acquireForStream?: boolean | undefined |
| 307 | } |
| 308 | ): Effect.Effect<PgClient & Client.SqlClient, SqlError, Scope.Scope | Reactivity.Reactivity | R> => |
| 309 | Effect.flatMap(PgConnection.make(options), (connection) => |
| 310 | makeImpl({ |
| 311 | acquirer: Effect.succeed(makeConnection( |
| 312 | connection, |
| 313 | options.acquireForStream ? PgConnection.make(options) : undefined |
| 314 | )), |
| 315 | transactionAcquirer: Effect.map(connection.pin, makeConnection), |
| 316 | listenAcquirer: options.acquireForStream ? PgConnection.make(options) : connection.pin, |
| 317 | config: options, |
| 318 | // The one session is leased for the client's lifetime. |
| 319 | poolStats: Effect.succeed({ idle: 0, used: 1, acquiring: 0, pending: 0, min: 1, max: 1 }) |
| 320 | })) |
| 321 | |
| 322 | /** |
| 323 | * Builds the shared SQL facade around native connection acquirers. |
nothing calls this directly
no test coverage detected