fix(nim-allographer/baradb): critical client fixes and bug audit
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

- Export hidden symbols in baradb_client.nim (socket, nextId, readQueryResponse, toString, toBytes)
- Add missing imports in baradb_exec.nim (asyncnet, enums, baradb_query)
- Rewrite toJson() to use wire protocol columnTypes instead of guessing types from strings
- Fix aggregate functions (count, avg, sum) to handle JInt/JFloat/JString correctly
- Fix paginate/fastPaginate discard issues
- Add placeholder arguments for whereIn/whereNotIn/whereBetween/whereNotBetween
- Add placeholder count validation in formatSql()
- Fix getRowPlain() to avoid IndexDefect on empty results
- Harden transactionStart/transactionEnd against server crashes
- Reset placeHolder in insertSql() to avoid stale values
- Fix test_query.nim to use backtick quoting for BaraDB compatibility

Known server bugs documented in BARADB_CLIENT_BUGS.md
This commit is contained in:
2026-05-21 22:01:55 +03:00
parent bb843b9a03
commit 837b4d56fc
6 changed files with 202 additions and 31 deletions
@@ -16,11 +16,11 @@ let rdb = baradb
suite("Baradb query"):
test("create table raw"):
let sql = """
CREATE TABLE IF NOT EXISTS "users" (
"id" SERIAL PRIMARY KEY,
"name" VARCHAR(255),
"email" VARCHAR(255),
"age" INTEGER
CREATE TABLE IF NOT EXISTS `users` (
`id` SERIAL PRIMARY KEY,
`name` VARCHAR(255),
`email` VARCHAR(255),
`age` INTEGER
)
"""
waitFor rdb.raw(sql).exec()