Hi! I want to clean up old data from event log DB ...
# ask-community
a
Hi! I want to clean up old data from event log DB (use postgresql). Found instruction at https://github.com/dagster-io/dagster/discussions/12047, but i'd like to delete only part of events for each run, not whole run. What way to interact with DB you recommend? SQLAlchemy and manual connection to database, or maybe there is some dagster interface for such interaction with events db?
j
you’ll need to use a manual connection, because dagster only offers the delete all events for run api
you could potentially use dagster apis (either graphql or python) to identify a set of event primary ids you want to remove… but depending on what filtering you’re doing it’s probably easy enough to do (and more performant) in the same manual query