Newer
Older
TelosDB / src / backend / tests / test_minimal.rs
@楽曲作りまくりおじさん 楽曲作りまくりおじさん 9 hours ago 1 KB refactor(journals): mask absolute paths and update environment docs
fn main() {
    println!("Minimum sanity check starting...");
    println!("If you see this, basic entrypoint is OK.");
}

#[tokio::test]
async fn test_minimal() {
    println!("--- DB Entrypoint Test ---");
    
    println!("Testing rusqlite...");
    let conn = rusqlite::Connection::open_in_memory().unwrap();
    let version: String = conn.query_row("SELECT sqlite_version()", [], |row| row.get(0)).unwrap();
    println!("rusqlite OK: {}", version);

    println!("Testing sqlx (sqlite)...");
    use sqlx::sqlite::SqliteConnectOptions;
    use sqlx::ConnectOptions;
    let mut opts = SqliteConnectOptions::new().filename(":memory:").create_if_missing(true);
    let _conn = opts.connect().await.expect("sqlx FAILED");
    println!("sqlx OK");

    println!("Testing Sea-ORM...");
    use sea_orm::{Database, ConnectOptions as SeaConnectOptions};
    let mut opt = SeaConnectOptions::new("sqlite::memory:".to_owned());
    opt.max_connections(1);
    let _db = Database::connect(opt).await.expect("Sea-ORM FAILED");
    println!("Sea-ORM OK");
    
    println!("--- ALL DB LOGIC PASSED WITHOUT 0xc0000139 ---");
}