pub fn export_to_file(
engine: &Engine,
opts: &ExportOptions,
) -> Result<ExportResult, McpError>Expand description
Top-level export dispatcher. Resolves the source SQL, then delegates to the format-specific exporter.
§Errors
- Returns
ErrorCode::PermissionDeniedifopts.pathalready exists andopts.overwriteisfalse. - Returns
ErrorCode::SqlErrorwhen neitheropts.sqlnoropts.tableis provided (for row-oriented formats). - Returns
ErrorCode::UnsupportedFormatwhenopts.formatis not one ofhyper,csv,parquet,arrow_ipc, oriceberg. - Propagates any format-specific error from the delegated exporter (SQL execution, I/O, or format-option validation failures).