feat: add user in db

This commit is contained in:
2026-05-06 15:22:49 +02:00
parent 7f77bfef4e
commit d7ddc087a6
11 changed files with 901 additions and 35 deletions
+17
View File
@@ -0,0 +1,17 @@
use sqlx::PgPool;
use uuid::Uuid;
pub async fn ensure_user_exists(pool: &PgPool, user_id: Uuid) -> Result<(), sqlx::Error> {
sqlx::query!(
r#"
INSERT INTO auth.user (id)
VALUES ($1)
ON CONFLICT (id) DO NOTHING
"#,
user_id
)
.execute(pool)
.await?;
Ok(())
}