Skip to content

Commit

Permalink
feat: optimization on db commit
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickAlphaC committed Nov 22, 2024
1 parent 3de8312 commit a97f028
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion boa/deployments.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def __init__(self, path=":memory:"):
self.db.execute(_CREATE_CMD)

# Migration for legacy DB without filename column
# We can/should remove this after some time (all 4 users migrate)
self._apply_filename_migration()

def __del__(self):
Expand All @@ -138,7 +139,6 @@ def _apply_filename_migration(self) -> None:
if is_in_db:
return
self.db.execute("ALTER TABLE deployments ADD COLUMN filename text;")
self.db.commit()

def _get_deployments_from_sql(self, sql_query: str, parameters=(), /):
cur = self.db.execute(sql_query, parameters)
Expand Down

0 comments on commit a97f028

Please sign in to comment.