Commit graph libervia-backend/libervia/backend/memory/sqla.py
Author SHA1 Message Date
Goffi
68da01a043 Dates update. 2026-03-31 12:57:17 +02:00
Goffi
a405d6c8f7 memory (storage): add get_profile_by_name method 2026-03-17 17:55:03 +01:00
Goffi
82e2c6efac apply black to the whole codebase. 2026-03-09 09:22:04 +01:00
Goffi
e4e879d871 core (memory/sqla): Improve file_update by using raw value:
ORM was used, resulting in deserialisation/reserialisation of value checked for race
condition during update. In addition to the overhead, this could lead to modification even
if the value didn't change (e.g., because of JSON key order changed).

The raw value is not used to check if the row has not change between `select` and
`update`, making the method more robust.
2025-10-10 17:44:04 +02:00
Goffi
96bf3af324 Global reformatting with black. 2025-09-13 10:46:10 +02:00
Goffi
edb649eff7 memory (sqla): update set_pubsub_node and get_pubsub_nodes to handle pubsub relationships:
- `parent_node` and `linked_node` can now be specified in `set_pubsub_node`.
- `get_pubsub_nodes` has been rewritten to recursively traverse a tree and retrieve nodes
  matching criteria and their linking nodes/children/items.

rel 463
2025-08-29 18:52:58 +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
328e0ce775 memory (sqla): Add a filter for origin in history_get:
rel 459
2025-06-08 17:16:58 +02:00
Goffi
660dd6d538 memory (sqla): Add filter for keyword:
A `keyword` filter can now be used to retrieve messages matching given keyword.

rel 458
2025-06-04 17:52:18 +02:00
Goffi
7642c7b1db storage: Add a add_thread method:
This method is used to add a thread on an existing History record.

rel 457
2025-05-06 00:34:01 +02:00
Goffi
b2e64a9f03 storage: Add a thread_id filter to history_get:
rel 457
2025-05-06 00:34:01 +02:00
Goffi
931052f40c plugin XEP-0444, storage: move get_history_from_xmpp_id to storage as it is generally useful. 2025-05-06 00:33:57 +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
191d06126e core (memory/sqla): add id filter in history_get 2023-11-28 17:26:45 +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
1cd7d44e2e core (memory/sqla): fix row to dict conversion in get_files 2023-06-09 12:25:51 +02:00
Goffi
d2685ba11b refactoring: renamed sat package to libervia.backend 2023-06-02 11:49:51 +02:00
Renamed from sat/memory/sqla.py (Browse further)