SQL scripts fail with "TypeError: dict is not a sequence"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
sqlalchemy-migrate |
New
|
Undecided
|
Unassigned |
Bug Description
When using SQL scripts if the script has a "%" in it then it will fail to execute with the error "TypeError: dict is not a sequence". This seems to be due to sqlalchemy passing through Python % string formatting before executing it. The correct solution appears to be to escape any characters that offend sqlalchemy using `sqlalchemy.text`. For example the following statement runs in `psql` but fails when run with `migrate`.
do
$$
begin
execute format('select text(''%I'')', current_
end
$$;
Perhaps the right place to make the change is in migrate/
Workaround: Double the "%" as this escapes the character for Python's formatting.
Tested with Version: 0.13.0-0ubuntu1 from
http://
description: | updated |
description: | updated |