Skip to main content

export_csv

Function export_csv 

Source
async fn export_csv(
    source_sql: String,
    include_columns: bool,
) -> Result<(Body, &'static str, String), (StatusCode, String)>
Expand description

CSV 导出:用 COPY … TO STDOUT WITH CSV 流式(大表不 OOM)。

流式响应在函数返回后才消费完,无法在同一连接上以事务包住整个 COPY, 这里只依赖 parse_source 的 AST 只读校验。