fix: remove old db.rs and format db/ submodules

The db.rs → db/ split left the old file tracked, causing
"module found at both db.rs and db/mod.rs" on CI. Also
fixes import ordering flagged by cargo fmt.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-13 16:16:48 -04:00
parent e50ca64e80
commit f511f1c084
8 changed files with 8 additions and 3451 deletions

3443
src/db.rs

File diff suppressed because it is too large Load Diff

View File

@@ -3,8 +3,8 @@ use sqlx::Row;
use std::collections::HashMap;
use std::path::{Path, PathBuf};
use super::types::*;
use super::Db;
use super::types::*;
impl Db {
pub async fn get_watch_dirs(&self) -> Result<Vec<WatchDir>> {

View File

@@ -1,7 +1,7 @@
use crate::error::Result;
use super::types::*;
use super::Db;
use super::types::*;
impl Db {
pub async fn create_conversion_job(

View File

@@ -48,7 +48,7 @@ pub enum SystemEvent {
}
pub struct EventChannels {
pub jobs: tokio::sync::broadcast::Sender<JobEvent>, // 1000 capacity - high volume
pub jobs: tokio::sync::broadcast::Sender<JobEvent>, // 1000 capacity - high volume
pub config: tokio::sync::broadcast::Sender<ConfigEvent>, // 50 capacity - rare
pub system: tokio::sync::broadcast::Sender<SystemEvent>, // 100 capacity - medium
}

View File

@@ -7,9 +7,9 @@ use sqlx::Row;
use std::collections::HashMap;
use std::path::Path;
use super::Db;
use super::timed_query;
use super::types::*;
use super::Db;
impl Db {
pub async fn reset_interrupted_jobs(&self) -> Result<u64> {

View File

@@ -11,8 +11,8 @@ pub use types::*;
use crate::error::{AlchemistError, Result};
use sha2::{Digest, Sha256};
use sqlx::sqlite::{SqliteConnectOptions, SqliteJournalMode};
use sqlx::SqlitePool;
use sqlx::sqlite::{SqliteConnectOptions, SqliteJournalMode};
use std::time::Duration;
use tokio::time::timeout;
use tracing::info;

View File

@@ -1,9 +1,9 @@
use crate::error::Result;
use sqlx::Row;
use super::Db;
use super::timed_query;
use super::types::*;
use super::Db;
impl Db {
pub async fn get_stats(&self) -> Result<serde_json::Value> {

View File

@@ -1,10 +1,10 @@
use chrono::{DateTime, Utc};
use crate::error::Result;
use chrono::{DateTime, Utc};
use sqlx::Row;
use super::timed_query;
use super::types::*;
use super::{hash_api_token, hash_session_token, Db};
use super::{Db, hash_api_token, hash_session_token};
impl Db {
pub async fn clear_completed_jobs(&self) -> Result<u64> {