Commit Graph

7 Commits

Author SHA1 Message Date
Fabio Manganiello 3fcc9957d1
A dirty fix to prevent DetachedInstanceError when accessing the parent entity. 2023-03-10 11:45:44 +01:00
Fabio Manganiello d8c429f4a8
Major improvements on the entities engine.
- Better logic to recursively link parent/children entities, so partial
  updates won't get lost.

- Removed `EntitiesCache` - it was too much to maintain while keeping
  consistent with the ORM, and it was a perennial fight against
  SQLAlchemy's own cache.

- Removed `EntityNotifier` - with no need to merge cached entities, the
  `notify` method has become much simpler and it's simply been merged
  in the `EntitiesRepository`.
2023-02-22 02:53:45 +01:00
Fabio Manganiello 340fd08064
Removed some old `type: ignore` comments. 2023-02-22 01:29:51 +01:00
Fabio Manganiello 72a9a9dfcf
LINT/type fixes 2023-02-19 22:56:45 +01:00
Fabio Manganiello 38438230d7
The batch of entities currently being processed should have no duplicate keys 2023-01-11 01:22:56 +01:00
Fabio Manganiello 5763c5e0ba
Don't use the entities cache when upserting entities.
This may make things a bit less optimal, but it's probably the only
possible solution that preserves my sanity.

Managing upserts of cached instances that were previously made transient
and expunged from the session is far from easy, and the management of
recursive parent/children relationships only add one more layer of
complexity (and that management is already complex enough in its current
implementation).
2022-12-18 15:13:21 +01:00
Fabio Manganiello b0464219d3
Large refactor of the entities engine. 2022-12-17 21:41:23 +01:00