Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import macros, db_sqlite, jester
- var db: DbConn
- iterator all*(T: typedesc): T =
- for row in db.fastRows sql "blah":
- let obj = T()
- for val in obj[].fields:
- when val is Ordinal:
- val = typeof(val) parseInt row[i] ## this is the line that causes error... in the full example
- yield obj
- type Foo = ref object
- routes:
- get "/":
- for x in all Foo: discard
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement