feat: Inventory PhysicalHost persistence with sqlx and local sqlite db #125
No reviewers
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: NationTech/harmony#125
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "feat/inventory_persistence"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
fa4332afe1to35fe324f5e35fe324f5etocb4382fbb5@ -0,0 +21,4 @@#[async_trait]pub trait InventoryRepository: Send + Sync + 'static {async fn save(&self, host: &PhysicalHost) -> Result<(), RepoError>;async fn get_latest_by_id(&self, host_id: &str) -> Result<Option<PhysicalHost>, RepoError>;should we use the
Idtype instead of a str here?@ -0,0 +31,4 @@#[async_trait]impl InventoryRepository for SqliteInventoryRepository {async fn save(&self, host: &PhysicalHost) -> Result<(), RepoError> {let data = serde_json::to_vec(host).map_err(|e| RepoError::Serialization(e.to_string()))?;Could this struct evolve in time and that at some point we update an existing physical host instead of just saving a new one every time?
@ -0,0 +57,4 @@).fetch_optional(&self.pool).await?;todo!()Do we still need this?