Skip to content

Instantly share code, notes, and snippets.

@BitPuffin
Created December 9, 2013 21:08
Show Gist options
  • Save BitPuffin/55d18b9a5a31bb5f833b to your computer and use it in GitHub Desktop.
Save BitPuffin/55d18b9a5a31bb5f833b to your computer and use it in GitHub Desktop.
proc getFromWhere*(id, row, table: string): TRow =
db.getRow(sql"select 1 from ? where ? = ?", table, row, id)
template getFrom*(id, table: string): expr =
#db.getRow(sql"select 1 from ? where id = ?)", table, id)
getFromWhere(id, "id", table)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment