Araq / ormin

Ormin -- An ORM for Nim.
MIT License
153 stars 18 forks source link

produce json got <typeof(nil)> #27

Closed huaxk closed 4 years ago

huaxk commented 4 years ago

When i test produce json in select statement:

  test "produce json":
    let users = query:
      select users(id, name, password)
      produce json
    echo users

I got an exception:

/mnt/c/sources/ormin/tests/tpostgres.nim(62, 7) template/generic instantiation of `bindResultJson` from here
/mnt/c/sources/ormin/ormin/ormin_postgre.nim(121, 28) Error: type mismatch: got <typeof(nil)>
but expected one of: 
proc newJString(s: string): JsonNode
  first type mismatch at position: 1
  required type for s: string
  but expression 'nil' is of type: typeof(nil)

expression: newJString(nil)