-
Notifications
You must be signed in to change notification settings - Fork 34
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
feat: add DB initialization module #556
Commits on Feb 7, 2024
-
feat(data-formats): move StoredItem from rendezvous
The `StoredItem` struct is no longer needed just in the rendezvous server, we are making it public and moving it to the data-formats lib so that it can be easily included in other modules. Signed-off-by: Irene Diez <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b18f84a - Browse repository at this point
Copy the full SHA b18f84aView commit details -
feat: add DB initialization module
This provides an interface defining the methods that we expect to be used for OV handling operations. Added an implementation for sqlite and postgress. Added db creation files and tests. Signed-off-by: Irene Diez <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0bdb995 - Browse repository at this point
Copy the full SHA 0bdb995View commit details -
Adds new dependencies and creates a sqlite database to be used in the tests. Signed-off-by: Irene Diez <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 299592f - Browse repository at this point
Copy the full SHA 299592fView commit details -
feat: add the Manufacturer DB store
This adds the store interface methods for the SqliteManufacturerStore. Signed-off-by: Irene Diez <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8f37826 - Browse repository at this point
Copy the full SHA 8f37826View commit details -
feat: don't allow db settings in per-device config
Signed-off-by: Irene Diez <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ed65dfe - Browse repository at this point
Copy the full SHA ed65dfeView commit details -
feat: add the Owner DB store configuration
This adds the store trait for the Sqlite Owner DB. Signed-off-by: Irene Diez <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 55189de - Browse repository at this point
Copy the full SHA 55189deView commit details -
feat: add the Rendezvous DB store configuration
This implements the store trait for the Sqlite Rendezvous DB. Signed-off-by: Irene Diez <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e4f9de1 - Browse repository at this point
Copy the full SHA e4f9de1View commit details -
feat(store): change store initializations based on DB type
When selecting to use the DB as the store type in the configuration files, this requires to select the DB type (sqlite or postgres) and the server type. Signed-off-by: Irene Diez <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 202edc0 - Browse repository at this point
Copy the full SHA 202edc0View commit details -
fix(data-formats): error when trying to parse an empty slice
When we are trying to parse raw data to make an ownership voucher we did not check whether the slice was empty or not, causing a panic in such case. This change explicitly checks if the slice is empty or not, and in the former case returns an error. Signed-off-by: Irene Diez <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4982d09 - Browse repository at this point
Copy the full SHA 4982d09View commit details -
feat(owner-tool): add an option to export OVs from the Manufacturer DB
This adds the `export_manufacturer_vouchers` option to the Owner CLI, which allows to export OVs from the Manufacturer Server's DB to a directory. The options are to export a single OV by GUID or all of them. Updated the DB trait to add the `select *` query that yields all the OVs in the Manufacturer. Signed-off-by: Irene Diez <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1eeea64 - Browse repository at this point
Copy the full SHA 1eeea64View commit details -
feat(owner-tool): add an option to import OVs to the Owner DB
Signed-off-by: Irene Diez <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4da0a49 - Browse repository at this point
Copy the full SHA 4da0a49View commit details -
fix(db): do not bail on non-critical errors
We are going to propagate the errors unless those are related to getting a connection to the DB. Signed-off-by: Irene Diez <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 35369a9 - Browse repository at this point
Copy the full SHA 35369a9View commit details -
fix(db): remove dotenv handling
Signed-off-by: Irene Diez <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1ddbe3a - Browse repository at this point
Copy the full SHA 1ddbe3aView commit details -
feat(store): add query_ovs_db method to store trait
The `query_data` method makes no sense when using databases since it uses different types of lists to query the required data, when that's a single query in a database; thereby we are adding the `query_ovs_db` method which explicitly queries the required data from the database. We are also adding a new error type `StoreError::MethodNotAvailable` that will be yielded when we call `query_data` from a database store implementation, or when we call the new `query_ovs_db` method from a directory store implementation. Signed-off-by: Irene Diez <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1e430f5 - Browse repository at this point
Copy the full SHA 1e430f5View commit details -
feat(owner-server): add DB handling to report_to_rendezvous
When the Owner server needs to report OVs to the Rendezvous server, check whether we have the old `query_data` method available or the new `query_ovs_db` method to choose the most effective one. Signed-off-by: Irene Diez <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6df89ca - Browse repository at this point
Copy the full SHA 6df89caView commit details -
feat(store): add Database error type
Replace all the `StoreError::Unspecified` errors with the new `StoreError::Database` when there is an internal database error. Signed-off-by: Irene Diez <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1a9d368 - Browse repository at this point
Copy the full SHA 1a9d368View commit details -
fix(db): change select_ov_to2_performed_and_ov_to0_less_than query
This changes the filters so that they correctly take into account NULL values. In order to set a NULL value we need to use None in rust, but for filtering instead of using None we need to filter by `is_null()`. Signed-off-by: Irene Diez <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e219eea - Browse repository at this point
Copy the full SHA e219eeaView commit details -
fix(store): expect StoredItem in rendezvous store
This changes the `store_data` method so that it expects a Value of type `StoredItem` for the serialization and deserialization of data. Signed-off-by: Irene Diez <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4c9598a - Browse repository at this point
Copy the full SHA 4c9598aView commit details -
chore(containers): update DB dependencies
Signed-off-by: Irene Diez <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8af3381 - Browse repository at this point
Copy the full SHA 8af3381View commit details -
feat(store): add postgresql store variant
Signed-off-by: Irene Diez <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 55d85d3 - Browse repository at this point
Copy the full SHA 55d85d3View commit details -
docs: add database usage and configuration
Signed-off-by: Irene Diez <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 48d8abd - Browse repository at this point
Copy the full SHA 48d8abdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3fcef6b - Browse repository at this point
Copy the full SHA 3fcef6bView commit details -
chore: update spec to add sql files and unify migrations
Since the migrations are unified in a single folder the tests have been updated accordingly. Signed-off-by: Irene Diez <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 442ac2c - Browse repository at this point
Copy the full SHA 442ac2cView commit details -
fix: adds necessary crates and scripts to dev container
Adds sqlite and libpq crates to devcontainer creation for successful building and testing in dev container. Also adds diesel scripts to dev container build to enable successful dev container integration testing. Signed-off-by: djach7 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8b65567 - Browse repository at this point
Copy the full SHA 8b65567View commit details -
Signed-off-by: Irene Diez <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 530fef0 - Browse repository at this point
Copy the full SHA 530fef0View commit details