SeitaBV / timely-beliefs

Model data as beliefs (at a certain time) about events (at a certain time).
MIT License
33 stars 6 forks source link

feat: bulk save objects ignoring conflicts #185

Closed victorgarcia98 closed 2 months ago

victorgarcia98 commented 2 months ago

Previously, it wasn't possible to bulk save beliefs with the allow_overwrite = True. With the help of ON CONFLICT DO NOTHING, we can bulk save beliefs and ignore duplicated key conflicts.

victorgarcia98 commented 2 months ago

Was this option introduced recently in SQLAlchemy? If so, perhaps we should specify a minimum requirement, too.

Good point. This feature was introduced in SQLAlchemy 1.1 and the project requires SQLAlchemy >= 2.0 so we don't need to constraint it.

victorgarcia98 commented 2 months ago

Good idea! I've implemented the suggested changes and update the tests.