Commit Graph

33 Commits

Author SHA1 Message Date
Fabio Manganiello 59c693d6a0
[#394] All `manifest.yaml` converted to `manifest.json`.
YAML isn't part of the Python standard library, while JSON is.

If we want `setup.py` to dynamically parse the available integration
manifest files in order to populate the extra dependencies, then it's
better to rely on a JSON format for manifest files - the parser is part
of the standard library and it doesn't require the user to install
`pyyaml` before `platypush`.
2024-05-17 02:21:57 +02:00
Fabio Manganiello 966a6ce29e
httplib2 should be an explicit dependency for Google integrations.
Plus, some misc LINT/Black chores.
2023-10-01 00:52:59 +02:00
Fabio Manganiello 10d587efd0
FIX: Possible assert evaluation error.
Some versions/configurations of Python may throw `Boolean value of this
clause is not defined` here.
2023-04-26 02:25:28 +02:00
Fabio Manganiello e1cd22121a
Removed `connection.begin()` pattern from the `db` plugin.
SQLAlchemy should automatically begin a transaction on
connection/session creation. Plus, `.begin()` messes up things with
SQLAlchemy 2, which has `autobegin` enabled with no easy way of
disabling it.
2023-04-25 10:31:49 +02:00
Fabio Manganiello 37722d12cd
No need for `session.begin` in `db.create_all`. 2023-04-24 23:55:50 +02:00
Fabio Manganiello 6fa179e769
LINT fixes 2023-04-24 23:49:31 +02:00
Fabio Manganiello 87889142e0
Fixed compatibility with SQLAlchemy >= 2.0 in the `db` plugin. 2023-04-24 22:52:17 +02:00
Fabio Manganiello c4f649a0d5
`autoflush` should be passed as an option to `db.get_session`. 2022-12-10 16:20:14 +01:00
Fabio Manganiello 69e097707d
Don't lock read session from the main database 2022-11-12 16:10:57 +01:00
Fabio Manganiello 86edd70d93
Fixed session/concurrency management on the main SQLite db
- The `declarative_base` instance should be shared
- Database `session_locks` should be stored at module, not instance
  level
- Better isolation of scoped sessions
- Enclapsulated `get_session` method in `UserManager`
2022-11-12 15:36:17 +01:00
Fabio Manganiello 6b7933cd33
Using a different SQLite database for entities
This prevents multiprocessing/concurrency issues when modifying the same
database file both from the main process and from the web server process
2022-11-12 02:00:55 +01:00
Fabio Manganiello deb25196d2
Merge branch 'master' into 191-support-for-general-entities-backend-and-plugin 2022-09-28 02:17:10 +02:00
Fabio Manganiello a9ebb4805a
Fixed doc warnings 2022-09-17 06:25:28 +02:00
Fabio Manganiello 4682fb4210
Throw an assertion error when on_duplicate_update is specified on db.insert with no key_columns 2022-09-04 16:02:37 +02:00
Fabio Manganiello 0143dac216
Improved support for bulk database statements
- Wrapped insert/update/delete operations in transactions
- Proper (and much more efficient) bulk logic
- Better upsert logic
- Return inserted/updated records if the engine supports it
2022-09-04 13:30:35 +02:00
Fabio Manganiello 1ea53a6f50
Support for query placeholders in `db.select` 2022-09-04 00:28:08 +02:00
Fabio Manganiello 4ee7e4db29
Basic support for entities on the local db and implemented support for switch entities on the tplink plugin 2022-04-04 16:50:17 +02:00
Fabio Manganiello e9f6d9a8bc
Refactored RSS integration into its own `rss` plugin [closes #199] 2022-01-06 00:46:05 +01:00
Fabio Manganiello 3bfc5b83ef Moved to manifest files for describing plugins and backends and their dependencies 2021-09-16 17:53:40 +02:00
Fabio Manganiello 2a78f81a7b Major LINT fixes 2021-04-05 00:58:44 +02:00
Fabio Manganiello 0ced46058a Always set check_same_thread=False in case of SQLite engines.
Platypush is heavily multi-threaded, and it can happen that some
transactions are handled in different threads - and consistency
is managed by the application itself.
2020-06-08 00:27:41 +02:00
Fabio Manganiello 4e8235a649 More robust logic to handle temporary database connection errors through retry mechanism 2019-07-16 16:40:56 +02:00
Fabio Manganiello 1c1ecc18df Support for multi-users and authentication for HTTP pages 2019-07-15 14:12:00 +02:00
Fabio Manganiello 674c164fc1 Fixed pylint warnings 2019-07-13 22:36:45 +02:00
Fabio Manganiello cba40744fb No need to commit without opening a transaction first 2018-07-15 20:33:09 +02:00
Fabio Manganiello 2fda066e39 - Support for Platypush main configuration db, where plugins and backends can store their data
- Support for permanent cross-process storage of session variables through SQLite db
- Support for db.select with table+filter instead of raw SQL query
2018-07-15 20:12:23 +02:00
Fabio Manganiello 7114d8bcaa Implemented update and delete method for the db plugin and ON DUPLICATE UPDATE logic for insert 2018-07-15 19:31:11 +02:00
Fabio Manganiello 6cf0f39a03 Added call to parent constructor in db plugin 2018-07-06 03:03:09 +02:00
Fabio Manganiello 66d78c8615 [#61] Plugins actions refactoring
- Using `@action` annotation to indicate methods that are allowed to be
executed as actions

- The output and errors of an action are automatically wrapped into a
`Response` object without any response build required on the plugin side
2018-07-06 02:08:38 +02:00
Fabio Manganiello 54dcb2cba3 Documentation v0.1 2018-06-23 01:00:43 +02:00
Fabio Manganiello 4da74b1096 Refactored logging submodule 2018-06-06 20:09:23 +02:00
Fabio Manganiello 3c13625e63 Better logic for db inserts 2018-01-07 01:35:27 +00:00
Fabio Manganiello 32dcb0c829 Added database plugin, #43 2018-01-06 22:52:24 +01:00