Files
chat-api/src/databases/postgres/user_repository.rs
T
LucasDLTG 2e81132f2d
CI / Rust CI (push) Failing after 1m12s
Publish & Deploy / Build and Push to Registry (push) Failing after 1m48s
Publish & Deploy / Deploy via SSH (push) Has been skipped
fix: use nex table name
2026-05-07 19:07:14 +02:00

18 lines
331 B
Rust

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.app_user (id)
VALUES ($1)
ON CONFLICT (id) DO NOTHING
"#,
user_id
)
.execute(pool)
.await?;
Ok(())
}