aa4ab11210
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
- Extract wire protocol into clients/nim/src/baradb/wire.nim - Add BaraError exception hierarchy - Refactor BaraClient/SyncClient with typedRows, AsyncLock request queue, timeouts, TLS config - Add BaraPool and optional HTTP fallback - Add mock-server wire and pool unit tests - Bump baradb nimble package to 1.2.0 - Make nim-allographer depend on canonical baradb client - Use typed rows in allographer toJson - Deprecate src/barabadb/client/client.nim - Update docs/en/clients.md and clients/nim/README.md
20 lines
601 B
Nim
20 lines
601 B
Nim
import std/unittest
|
|
import std/asyncdispatch
|
|
import baradb/client
|
|
import baradb/pool
|
|
|
|
suite "BaraPool":
|
|
test "pool stats with one acquired connection":
|
|
proc run() {.async.} =
|
|
let cfg = ClientConfig(host: "127.0.0.1", port: 9472, timeoutMs: 100)
|
|
let pool = newBaraPool(cfg, minConnections = 0, maxConnections = 2)
|
|
# Without a server, acquire should fail cleanly (timeout or connection refused)
|
|
var failedCleanly = false
|
|
try:
|
|
withClient(pool):
|
|
discard
|
|
except BaraError:
|
|
failedCleanly = true
|
|
check failedCleanly
|
|
waitFor run()
|