aboutsummaryrefslogtreecommitdiffstats
path: root/crates/pseudonyms/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/pseudonyms/src/lib.rs')
-rw-r--r--crates/pseudonyms/src/lib.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/crates/pseudonyms/src/lib.rs b/crates/pseudonyms/src/lib.rs
new file mode 100644
index 0000000..9d76245
--- /dev/null
+++ b/crates/pseudonyms/src/lib.rs
@@ -0,0 +1,23 @@
+pub mod server;
+pub mod state;
+
+use std::sync::Arc;
+
+use serde::Deserialize;
+use state::AppHandle;
+use tracing::{debug, trace};
+
+#[derive(Deserialize, Clone)]
+pub struct AppConfig {
+ pub something: Arc<str>,
+}
+
+pub async fn run(state: AppHandle, tx: tokio::sync::oneshot::Sender<u16>) -> anyhow::Result<()> {
+ trace!("running migrations");
+ sqlx::migrate!("./migrations")
+ .run(&state.services.postgres)
+ .await?;
+ debug!("ran migrations");
+
+ server::serve(state, tx).await
+}