fix: harden exception handling, break ARC cycles, sync license/client
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
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
Replace bare except: with CatchableError across storage, query, Raft, backup, and protocol code so Defects are not swallowed. Break uncollectable ARC cycles in server shard/gossip callbacks via Server-owned refs and cursor locals. Align package license with LICENSE (BSD-3-Clause), sync README version, and point test_all at the canonical clients/nim baradb client (parseConnectionString + aliases).
This commit is contained in:
@@ -217,4 +217,4 @@ See `examples/ormin_basic.nim` for a full sample.
|
||||
|
||||
## License
|
||||
|
||||
Apache-2.0
|
||||
BSD-3-Clause
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
version = "1.2.0"
|
||||
author = "BaraDB Team"
|
||||
description = "Official Nim client for BaraDB — async binary protocol client"
|
||||
license = "Apache-2.0"
|
||||
license = "BSD-3-Clause"
|
||||
srcDir = "src"
|
||||
|
||||
# Dependencies — only Nim stdlib, no server code
|
||||
|
||||
@@ -92,6 +92,26 @@ proc newClient*(config: ClientConfig = defaultConfig()): BaraClient =
|
||||
sendLock: initAsyncLock(),
|
||||
)
|
||||
|
||||
# Aliases for older call sites / server test suite
|
||||
proc defaultClientConfig*(): ClientConfig {.inline.} = defaultConfig()
|
||||
proc newBaraClient*(config: ClientConfig = defaultConfig()): BaraClient {.inline.} =
|
||||
newClient(config)
|
||||
|
||||
proc parseConnectionString*(connStr: string): ClientConfig =
|
||||
## Parse space-separated key=value pairs (libpq-style subset).
|
||||
result = defaultConfig()
|
||||
for part in connStr.split(" "):
|
||||
let kv = part.split("=", 1)
|
||||
if kv.len == 2:
|
||||
case kv[0].toLowerAscii()
|
||||
of "host": result.host = kv[1]
|
||||
of "port": result.port = parseInt(kv[1])
|
||||
of "database", "dbname": result.database = kv[1]
|
||||
of "user", "username": result.username = kv[1]
|
||||
of "password", "pass": result.password = kv[1]
|
||||
of "connect_timeout", "timeout": result.timeoutMs = parseInt(kv[1])
|
||||
else: discard
|
||||
|
||||
proc nextId*(client: BaraClient): uint32 =
|
||||
inc client.requestId
|
||||
client.requestId
|
||||
|
||||
Reference in New Issue
Block a user