fix: issue #9 reserved keyword 'key' + issue #10 empty string treated as NULL
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

Issue 9: Add backtick-quoted identifier support in lexer.nim
- Users can now write `key` to use reserved keywords as column/table names

Issue 10: Use \N as internal NULL marker instead of empty string
- isNull() now checks for \N instead of value.len == 0
- Empty strings can now be stored in NOT NULL columns
- NULL values properly distinguished from empty strings in storage, wire protocol, and HTTP JSON responses
This commit is contained in:
2026-05-17 01:59:25 +03:00
parent 58b7598155
commit 073ec41652
6 changed files with 111 additions and 45 deletions
+4 -3
View File
@@ -164,9 +164,10 @@ proc queryHandler(server: HttpServer): RequestHandler =
var jsonRow = newJObject()
for col in res.columns:
let key = col
var val = ""
if key in row: val = row[key]
jsonRow[key] = %val
if key in row and not isNull(row[key]):
jsonRow[key] = %row[key]
else:
jsonRow[key] = newJNull()
jsonRows.add(jsonRow)
var jsonCols = newJArray()
for c in res.columns: