Mercurial > libervia-backend
comparison doc/developer.rst @ 4077:d6837db456fd
refactoring: fix names in doc following modules hierarchy refactoring
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 02 Jun 2023 17:38:37 +0200 |
parents | 524856bd7b19 |
children | 00852dd54695 |
comparison
equal
deleted
inserted
replaced
4076:b620a8e882e1 | 4077:d6837db456fd |
---|---|
15 migrations. | 15 migrations. |
16 | 16 |
17 SQLite_ is currently the only supported database, but it is planned to add support for | 17 SQLite_ is currently the only supported database, but it is planned to add support for |
18 other ones (notably PostgreSQL), probably during the development of 0.9 version. | 18 other ones (notably PostgreSQL), probably during the development of 0.9 version. |
19 | 19 |
20 The mapping is done in ``sat.memory.sqla_mapping`` and working with database is done | 20 The mapping is done in ``libervia.backend.memory.sqla_mapping`` and working with database is done |
21 through high level methods found in ``sat.memory.sqla``. | 21 through high level methods found in ``libervia.backend.memory.sqla``. |
22 | 22 |
23 Before the move to SQLAlchemy, there was a strict separation between database | 23 Before the move to SQLAlchemy, there was a strict separation between database |
24 implementation and the rest of the code. With 0.9, objects mapping to database can be used | 24 implementation and the rest of the code. With 0.9, objects mapping to database can be used |
25 and manipulated directly outside of ``sat.memory.sqla`` to take profit of SQLAlchemy | 25 and manipulated directly outside of ``libervia.backend.memory.sqla`` to take profit of SQLAlchemy |
26 possibilities. | 26 possibilities. |
27 | 27 |
28 Database state is detected when the backend starts, and the database will be created or | 28 Database state is detected when the backend starts, and the database will be created or |
29 migrated automatically if necessary. | 29 migrated automatically if necessary. |
30 | 30 |
31 To create a new migration script, ``Alembic`` may be used directly. To do so, be sure to | 31 To create a new migration script, ``Alembic`` may be used directly. To do so, be sure to |
32 have an up-to-date database (and a backup in case of troubles), then activate the virtual | 32 have an up-to-date database (and a backup in case of troubles), then activate the virtual |
33 environment where Libervia is installed (Alembic needs to access ORM mapping), go to | 33 environment where Libervia is installed (Alembic needs to access ORM mapping), go to |
34 ``sat/memory/migration`` directory, and enter the following command:: | 34 ``libervia/backend/memory/migration`` directory, and enter the following command:: |
35 | 35 |
36 alembic revision --autogenerate -m "some revision message" | 36 alembic revision --autogenerate -m "some revision message" |
37 | 37 |
38 This will create a base migration file in ``versions`` directory. Adapt it to your needs, | 38 This will create a base migration file in ``versions`` directory. Adapt it to your needs, |
39 try to create both ``upgrade`` and ``downgrade`` method whenever possible, and be sure to | 39 try to create both ``upgrade`` and ``downgrade`` method whenever possible, and be sure to |
60 analysers are checked, and the first one matching is used to determine if the node must be | 60 analysers are checked, and the first one matching is used to determine if the node must be |
61 synchronised or not. | 61 synchronised or not. |
62 | 62 |
63 Analysers can be registered by any plugins using ``register_analyser`` method: | 63 Analysers can be registered by any plugins using ``register_analyser`` method: |
64 | 64 |
65 .. automethod:: sat.plugins.plugin_pubsub_cache.PubsubCache.register_analyser | 65 .. automethod:: libervia.backend.plugins.plugin_pubsub_cache.PubsubCache.register_analyser |
66 | 66 |
67 If no analyser is found, ``to_sync`` is false, or an error happens during the caching, | 67 If no analyser is found, ``to_sync`` is false, or an error happens during the caching, |
68 the node won't be synchronised and the pubsub service will always be requested. | 68 the node won't be synchronised and the pubsub service will always be requested. |
69 | 69 |
70 Specifying an optional **parser** will store parsed data in addition to the raw XML of the | 70 Specifying an optional **parser** will store parsed data in addition to the raw XML of the |