Skip to content

Commit

Permalink
Add support for environments running psycopg3 to the migration executor
Browse files Browse the repository at this point in the history
  • Loading branch information
fmorenodesigns committed Apr 24, 2024
1 parent c610453 commit db6e68e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion migration_checker/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ def __call__(
context: dict[str, Any],
) -> Any:
cursor = context["cursor"]
rendered_sql = cursor.mogrify(sql, params).decode()
mogrify_result = cursor.mogrify(sql, params)
rendered_sql: str = (
mogrify_result
if isinstance(mogrify_result, str)
else mogrify_result.decode()
)
self.queries.append(rendered_sql)

return execute(sql, params, many, context)
Expand Down

0 comments on commit db6e68e

Please sign in to comment.