reafctor: all code without stream

This commit is contained in:
2026-06-02 18:30:39 +02:00
parent 974be437af
commit 28352d8bdb
90 changed files with 3581 additions and 2434 deletions
@@ -0,0 +1 @@
pub mod queries;
@@ -0,0 +1,21 @@
use crate::databases::errors::DbError;
use sqlx::PgPool;
use uuid::Uuid;
pub async fn upsert_user_activity(pool: &PgPool, user_id: &Uuid) -> Result<(), DbError> {
sqlx::query!(
r#"
INSERT INTO auth.app_user (id, last_seen_at)
VALUES ($1, now())
ON CONFLICT (id)
DO UPDATE SET last_seen_at = now()
"#,
user_id
)
.execute(pool)
.await
.map_err(DbError::Connection)?;
Ok(())
}