#[cfg(test)]
mod tests {
    use crate::db;
    use crate::tests::common::test_helpers::create_temp_db;

    #[test]
    fn test_database_connection() {
        // Create a temporary database
        let (_temp_dir, _conn, db_path) = create_temp_db();

        // Try to open the database
        let result = db::open(db_path);

        // Should succeed in creating a new database
        assert!(result.is_ok());
    }

    #[test]
    fn test_database_item_queries() {
        // Create a temporary database
        let (_temp_dir, conn, _db_path) = create_temp_db();

        // Try to query all items (should be empty in new DB)
        let items = db::query_all_items(&conn);
        assert!(items.is_ok());

        // Should start with no items
        assert_eq!(items.unwrap().len(), 0);
    }
}
