nim-lang / db_connector

Unified db connector in Nim
MIT License
20 stars 6 forks source link

An unhandled postgres error #15

Open dawkot opened 4 years ago

dawkot commented 4 years ago

Example

Consider db to be a valid connection and table to be a valid table

echo "a"
discard db.get_value sql "SELECT 1 FROM table WHERE false"
echo "b"

Current Output

a
row number 0 is out of range 0..-1
b

Expected Output

a

Possible Solution

Additional Information

The above error happens if a program calls PQgetvalue(), PQgetlength(), or PQgetisnull() with a row number of -1 and if there were no rows in the result. https://www.postgresql.org/message-id/014c01c57be2$60b97780$3202a8c0@pi

$ nim -v
Nim Compiler Version 1.0.99 [Windows: amd64]
Araq commented 4 years ago

In what universe is dumping stuff to the terminal a viable error reporting strategy? I thought Postge is a piece of quality... :-(