use sea_orm::Database;

#[tokio::main]
async fn main() {
    let db = Database::connect("sqlite:book-manager_development.sqlite")
        .await
        .expect("Failed to connect to database");

    let result: Vec<serde_json::Value> = sea_orm::DatabaseConnection::query_all(
        &db,
        sea_orm::Statement::from_string(
            sea_orm::DatabaseBackend::Sqlite,
            "SELECT COUNT(*) as count FROM books".to_string(),
        ),
    )
    .await
    .expect("Failed to query");

    println!("Books count: {:?}", result);
}
