-
-
Save BitPuffin/3f02d0488c67d169124c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| template getFromWhere*(id, row, table: string): expr = | |
| db.getRow(sql"select 1 from ? where ? = ?", table, row, id) | |
| template getFrom*(id, table: string): expr = | |
| getFromWhere(id, "id", table) | |
| proc getUser*(id: string): TRow = | |
| result = id.getFrom("users") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment