Move PG types back to util::database
Some checks failed
Push Workflows / rustfmt (push) Successful in 6s
Push Workflows / mdbook (push) Successful in 8s
Push Workflows / docs (push) Successful in 45s
Push Workflows / clippy (push) Successful in 50s
Push Workflows / mdbook-server (push) Successful in 1m18s
Push Workflows / leptos-test (push) Successful in 1m35s
Push Workflows / test (push) Successful in 1m48s
Push Workflows / build (push) Successful in 2m40s
Push Workflows / docker-build (push) Successful in 4m26s
Push Workflows / nix-build (push) Has been cancelled

This commit is contained in:
2025-06-28 00:44:14 +00:00
parent 36de234630
commit 83b56b9110
4 changed files with 9 additions and 7 deletions

View File

@ -11,7 +11,8 @@ cfg_if::cfg_if! {
};
use crate::models::backend::NewUser;
use crate::util::backend_state::{BackendState, PgPooledConn};
use crate::util::backend_state::BackendState;
use crate::util::database::PgPooledConn;
}
}

View File

@ -7,7 +7,7 @@ use cfg_if::cfg_if;
cfg_if! {
if #[cfg(feature = "ssr")] {
use diesel::prelude::*;
use crate::util::backend_state::PgPooledConn;
use crate::util::database::PgPooledConn;
use crate::models::backend::{Song, HistoryEntry};
use crate::util::error::*;
}

View File

@ -1,7 +1,8 @@
use crate::util::config::Config;
use crate::util::database::{PgPool, PgPooledConn};
use crate::util::error::*;
use axum::extract::FromRequestParts;
use diesel::{pg::PgConnection, r2d2::ConnectionManager, r2d2::Pool, r2d2::PooledConnection};
use diesel::{pg::PgConnection, r2d2::ConnectionManager};
use http::{request::Parts, StatusCode};
use leptos_axum::extract;
use std::ops::Deref;
@ -11,9 +12,6 @@ use tower_sessions_redis_store::fred::clients::Pool as RedisPool;
use tower_sessions_redis_store::fred::prelude::*;
use tower_sessions_redis_store::fred::types::config::Config as RedisConfig;
type PgPool = Pool<ConnectionManager<PgConnection>>;
pub type PgPooledConn = PooledConnection<ConnectionManager<PgConnection>>;
/// Shared state of the backend. Contains the global server configuration,
/// a connection pool to the `PostgreSQL` database, and a connection pool to Redis.
#[derive(Clone)]

View File

@ -1,6 +1,9 @@
use crate::util::backend_state::PgPooledConn;
use diesel::{pg::PgConnection, r2d2::ConnectionManager, r2d2::Pool, r2d2::PooledConnection};
use diesel_migrations::{embed_migrations, EmbeddedMigrations, MigrationHarness};
pub type PgPool = Pool<ConnectionManager<PgConnection>>;
pub type PgPooledConn = PooledConnection<ConnectionManager<PgConnection>>;
/// Embedded database migrations into the binary
const DB_MIGRATIONS: EmbeddedMigrations = embed_migrations!();