I am trying to use Tusker to compare schema versions and check the current database is consistent.
My schema file contains raw SQL for database definitions, including plpgsql functions, in one of which is the line:
json = '{ "type": "Category", "data": {"empty":0} }';
This schema file is designed for direct import into psql, and works fine as is.
However, I'm now trying to deal with the schema-management tool using tusker and SQLAlchemy barfs, when it tries to run:
sql = sqlalchemy.text(sql)
cursor.execute(sql)
complaining:
Error executing SQL file schema_functions.sql: (sqlalchemy.exc.InvalidRequestError) A value is required for bind parameter '0'
I can't modify the schema file (otherwise this would be trivial to add an escape character, but then it will break in psql); So, is there any way to tell sqlalchemy to "not interpret integers as bind parameters"?
For more see: https://github.com/bikeshedder/tusker/issues/18
Thanks for your help.