Skip to content

Commit

Permalink
actually execute statement
Browse files Browse the repository at this point in the history
  • Loading branch information
jvansanten committed Feb 13, 2024
1 parent 2849f2b commit 9bd5396
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions migrations/02_add_archive_count.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,19 @@
]
)
.where(
Alert.c.avro_archive_id.in_(sa.select([Archive.c.avro_archive_id]).where(Archive.c.refcount == 0))
Alert.c.avro_archive_id.in_(
sa.select([Archive.c.avro_archive_id]).where(
Archive.c.refcount == 0
)
)
)
.group_by(Alert.c.avro_archive_id)
).alias("target")
statement = Archive.update().values(refcount=target.c.refcount).where(
Archive.c.avro_archive_id == target.c.avro_archive_id
connection.execute(
Archive.update()
.values(refcount=target.c.refcount)
.where(Archive.c.avro_archive_id == target.c.avro_archive_id)
)
print(statement.compile(engine, compile_kwargs={"literal_binds": True}))
assert False

if False:
for row in connection.execute(
Expand Down

0 comments on commit 9bd5396

Please sign in to comment.