Skip to content

Instantly share code, notes, and snippets.

@optik-aper
Created October 17, 2017 19:09
Show Gist options
  • Save optik-aper/58c132a82e8be575d4bda318fcdf1032 to your computer and use it in GitHub Desktop.
Save optik-aper/58c132a82e8be575d4bda318fcdf1032 to your computer and use it in GitHub Desktop.
db_postgres getValue() row number 0 is out of range 0..-1
proc getWikiDbId*(title: string): int =
let db = open(db_srv, db_usr, db_pas, db_nam)
let sql = sql("""
SELECT id
FROM page
WHERE title = ?
""")
let id = getValue(db, sql, title)
db.close()
@optik-aper
Copy link
Author

When getValue is called row number 0 is out of range 0..-1 is printed out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment