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

Issue 17 sqlite #35

Merged
merged 2 commits into from
Mar 5, 2021
Merged

Issue 17 sqlite #35

merged 2 commits into from
Mar 5, 2021

Conversation

Nathanrs97
Copy link
Contributor

The SQLite database functionality is ready. Only inserting is currently being utilised in the server. Selecting will be used in future updates, but these are outside of this branch purpose.

…ule for the Server to utilise.

The wrapper consists of four API functions for initialising the database, setting up the sensor tables, inserting and selecting sensor data from the database. The selecting sensor data API allows for selecting data between two times (so a range of data can be retrieved). This will allow for the easy retrieve of sensor data when bulking up data for transmission.

Basic unit tests are provided in test_serverdatabase.py.
The helper function _save_sensor_data_to_database saves the sensor data passed (in bulk) and then commits the database to file to ensure the sensor data is saved. Not sure if this is the most optimal way to do it (as saving this frequently could be performance heavy (?)). Someone to look into if performance becomes an issue.
@Nathanrs97 Nathanrs97 self-assigned this Mar 5, 2021
@Nathanrs97 Nathanrs97 merged commit ecc7e20 into main Mar 5, 2021
@Nathanrs97 Nathanrs97 deleted the issue-17-sqlite branch March 5, 2021 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant