feat: add postgres support

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2023-10-05 22:41:14 +02:00
parent 4a88d2fecd
commit 4d150febc7
3 changed files with 164 additions and 16 deletions

View File

@@ -141,6 +141,23 @@ FOR UPDATE;
}
}
async fn update_published(&self, event_id: &str) -> Result<(), PersistenceError> {
todo!()
sqlx::query(
r#"
UPDATE outbox
SET state = 'handled'
WHERE id = $1;
"#,
)
.bind(
Uuid::parse_str(event_id)
.map_err(|e| anyhow::anyhow!(e))
.map_err(PersistenceError::UpdatePublished)?,
)
.execute(&self.pool)
.await
.map_err(|e| anyhow::anyhow!(e))
.map_err(PersistenceError::UpdatePublished)?;
Ok(())
}
}