1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! Multi-database backend module.
//!
//! This module provides a unified interface for multiple database backends:
//! - SQLite (for lightweight deployments)
//! - MySQL/MariaDB (for production deployments)
//! - PostgreSQL (for production deployments)
//!
//! # Architecture
//!
//! The database layer uses a trait-based design:
//! - `DatabaseBackend` trait defines the interface
//! - Each database has its own connector implementation
//! - `DatabaseConnector` provides unified access
//!
//! # Features
//!
//! - Customizable table and column names
//! - Connection pooling via SQLx
//! - Automatic table creation
//! - Batch operations for efficiency
//! - Query builder for dynamic queries
//!
//! # Supported Operations
//!
//! - Torrent CRUD (insert, update, delete, select)
//! - Whitelist management
//! - Blacklist management
//! - API key management
//! - User account management
//!
//! # Example
//!
//! ```rust,ignore
//! use torrust_actix::database::structs::database_connector::DatabaseConnector;
//!
//! let connector = DatabaseConnector::new(config, true).await;
//! let torrents = connector.load_torrents().await;
//! ```
/// Database driver enumeration (sqlite3, mysql, pgsql).
/// Helper functions for SQL query generation.
/// Implementation blocks for database connectors.
/// Dynamic SQL query builder.
/// Data structures for database connections.
/// Database backend trait definitions.