Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for MongoDB (or any other database) for property read-write #9

Open
5 tasks
VigneshVSV opened this issue Jul 18, 2024 · 0 comments
Open
5 tasks
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@VigneshVSV
Copy link
Owner

VigneshVSV commented Jul 18, 2024

There are certain settings in hardware which are helpful to be backed up to databases as the hardware "forgets" the setting when power cycled and goes to a default setting.

Since settings are generally modelled as properties, after the property write, the value can be stored to the database.

Currently SQLite and MySQL/postgres is supported.

It's useful to have a JSON driven DB as the default seriliazer is JSON for all operations. It also helps the package end-developer to stick to JSON data types.

Involved tasks -

  • subclass ThingDB for mongo
  • implement all operations which are imported for SQLite or other databases
  • support auto-setup in case use_default_db is set to True at Thing.init
  • verify working at Property._post_value_set
  • write tests or add it to the tests in test_property.py

If interested, do the same for another database binding

There is also a JSON file writer in labthings-fastapi, it would be useful to integrate that for that layman novice user who neither wants mongo, nor SQLite.

@VigneshVSV VigneshVSV added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Jul 18, 2024
@VigneshVSV VigneshVSV changed the title Add support for MongoDB for property read-write Add support for MongoDB (or any other database) for property read-write Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant