Commit graph libervia-backend/libervia/backend/memory/sqla_mapping.py
Author SHA1 Message Date
Goffi
96bf3af324 Global reformatting with black. 2025-09-13 10:46:10 +02:00
Goffi
e593f32f09 memory (sqla): add "parent_node_id" and "linked_mode_id" to PubsubNode:
This is to prepare for the implementation of XEP-0496 and XEP-0499.

rel 463
2025-08-29 17:59:12 +02:00
Goffi
26002870a8 memory (sqla): Add columns and tables to handles permissions:
Add columns to handle `access_model` and `publish_model` and a table for `affiliations`.
With those new data, components handling pubsub can now manage permissions correctly.

rel 462
2025-08-03 23:45:45 +02:00
Goffi
f2075750ed storage (mapping): Fix nullable for thread ID, and add a is_retroactive field:
`is_retroactive` is used to link a thread in a parent message when it didn't have the
thread initially.

rel 457
2025-05-06 00:21:24 +02:00
Goffi
53fdaa9d09 Reformatted code base using black. 2024-06-19 18:44:57 +02:00
Goffi
a8348576ae core: get rid of pickle:
Use of `pickle` to serialise data was a technical legacy that was causing trouble to store
in database, to update (if a class was serialised, a change could break update), and to
security (pickle can lead to code execution).

This patch remove all use of Pickle in favour in JSON, notably:
- for caching data, a Pydantic model is now used instead
- for SQLAlchemy model, the LegacyPickle is replaced by JSON serialisation
- in XEP-0373 a class `PublicKeyMetadata` was serialised. New method `from_dict` and
  `to_dict` method have been implemented to do serialisation.
- new methods to (de)serialise data can now be specified with Identity data types. It is
  notably used to (de)serialise `path` of avatars.

A migration script has been created to convert data (for upgrade or downgrade), with
special care for XEP-0373 case. Depending of size of database, this migration script can
be long to run.

rel 443
2024-02-23 13:31:04 +01:00
Goffi
445d5c088e core (memory/sqla_mapping): delete-orphan in History:
add `cascade=delete-orphan` to History's `messages`, `subjects` and `thread`, to make
modification of those attributes easier.
2023-11-28 17:35:20 +01:00
Goffi
5bb47c69e4 core (memory/sqla_mapping): add a version_id column to detect race conditions. 2023-11-22 14:52:00 +01:00
Goffi
b74f55d73d core: notifications implementation, first draft:
add a new table for notifications, and methods/bridge methods to manipulate them.
2023-10-16 17:29:31 +02:00
Goffi
bf9db70bee core (memory/sqla_mapping): fix legacy pickled values:
folloing packages refactoring, legacy pickled values could not be unpickled (due to use of
old classes). This temporary workaround fix it, but the right thing to do will be to move
from pickle to JSON at some point.
2023-06-12 14:57:27 +02:00
Goffi
d2685ba11b refactoring: renamed sat package to libervia.backend 2023-06-02 11:49:51 +02:00
Renamed from sat/memory/sqla_mapping.py (Browse further)