export_database_to_bytes_streaming

Function export_database_to_bytes_streaming 

Source
pub async fn export_database_to_bytes_streaming(
    storage: &mut BlockStorage,
    max_size_bytes: Option<u64>,
    chunk_size_bytes: Option<u64>,
    progress_callback: Option<ProgressCallback>,
) -> Result<Vec<u8>, DatabaseError>
Expand description

Streaming export with basic parameters (convenience wrapper)

Simplified interface for streaming export with progress callback. For full control, use export_database_with_options.

§Arguments

  • storage - Block storage containing the database
  • max_size_bytes - Maximum allowed size (None for default 2GB)
  • chunk_size_bytes - Chunk size for streaming (None for default 10MB)
  • progress_callback - Optional progress callback

§Example

use absurder_sql::storage::export::export_database_to_bytes_streaming;
use absurder_sql::storage::BlockStorage;

async fn export_example(mut storage: BlockStorage) -> Result<Vec<u8>, absurder_sql::types::DatabaseError> {
    let progress = Box::new(|exported: u64, total: u64| {
        println!("Exported {}/{} bytes", exported, total);
    });
     
    export_database_to_bytes_streaming(
        &mut storage,
        None,
        Some(10 * 1024 * 1024), // 10MB chunks
        Some(progress)
    ).await
}