Closed dnswrsrx closed 4 years ago
I got the same issue for postgres, and the solution was also the same, list(bind_params) fixed it.
Similar issue here with Postgres. As above, either cast OrderedDict
to list
or, the solution that I went with, set the param_style
to pyformat
:
j = JinjaSql(param_style='pyformat')
I just pushed a fix for this issue - see https://github.com/hashedin/jinjasql/commit/543810a44e257573b6b6eacdf993a16e01505118
I will push a new release 0.1.8 later today.
Again, might just be an issue pertaining to sqlite3?
When preparing the query, the bind parameter is type ordered_dict. Executing the query and this bind parameter in sqlite3 raises a
ValueError: parameters are of unsupported type
exception. However, when we turn the bind parameter into a list (list(bind_parameter)
), sqlite3 will execute the query just fine.I wrote a gist to reproduce this bug.