Skip to content

Commit

Permalink
quick fix
Browse files Browse the repository at this point in the history
  • Loading branch information
HarukaMa committed Dec 3, 2024
1 parent f45e5be commit 2c05b09
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions db/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,18 @@ def transform(d: dict[str, Any]):
await cur.execute(
psycopg.sql.Composed([
psycopg.sql.SQL(
"SELECT mv.id, mv.key_id, mv.key, mv.value"
"FROM mapping m"
"SELECT mv.id, mv.key_id, mv.key, mv.value "
"FROM mapping m "
"CROSS JOIN LATERAL ("
" SELECT id, key_id, key, value"
"FROM mapping_value"
"WHERE mapping_id = m.id"
" SELECT id, key_id, key, value "
" FROM mapping_value "
" WHERE mapping_id = m.id "
),
cursor_clause,
psycopg.sql.SQL(
"ORDER BY id"
"LIMIT %s"
") mv"
"WHERE m.program_id = %s AND m.mapping = %s"
" ORDER BY id LIMIT %s"
") mv "
"WHERE m.program_id = %s AND m.mapping = %s "
"ORDER BY mv.id"
)
]),
Expand Down

0 comments on commit 2c05b09

Please sign in to comment.