Skip to content

Commit

Permalink
Fix json when selecting migration description.
Browse files Browse the repository at this point in the history
  • Loading branch information
dnwpark committed Mar 15, 2024
1 parent 9593b23 commit 459995b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion edb/server/compiler/ddl.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,8 +725,12 @@ def _describe_current_migration(
.decode('utf-8')
)

# json dumps already produces escaped json text
# need to additionally escape single quotes
desc = "'{}'".format(desc.replace("'", "\\'"))

desc_ql = edgeql.parse_query(
f'SELECT to_json({qlquote.quote_literal(desc)})'
f'SELECT to_json({desc})'
)
return compiler._compile_ql_query(
ctx,
Expand Down

0 comments on commit 459995b

Please sign in to comment.