Skip to content

Instantly share code, notes, and snippets.

@BitPuffin
Created February 21, 2014 13:50
Show Gist options
  • Save BitPuffin/9134545 to your computer and use it in GitHub Desktop.
Save BitPuffin/9134545 to your computer and use it in GitHub Desktop.
proc createUserObjectFromQueryResult(queryResult: seq[TRow]): PUser =
if queryResult.len == 0:
return nil
let id = queryResult[0].parseInt
let email = queryResult[1]
let password = queryResult[2]
let firstname = queryResult[3]
let lastname = queryResult[4]
result = PUser(id: id, email: email, password: password, firstname: firstname, lastname: lastname)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment