perf(export): stream table CSV from Rust
This commit is contained in:
1 parent
413261a476
commit
30cd447e4f
11 files changed
+444
-167
No files matched your search
@@ -781,6 +781,27 @@ async function exportData(row: ObjectBrowserRow, format: "csv" | "json" | "sql")
|
||||
(column) => column.name,
|
||||
)
|
||||
: undefined;
|
||||
|
||||
if (format === "csv" && isTauriRuntime()) {
|
||||
const { save } = await import("@tauri-apps/plugin-dialog");
|
||||
const outputPath = await save({
|
||||
defaultPath: `${row.name}.csv`,
|
||||
filters: [{ name: "CSV", extensions: ["csv"] }],
|
||||
});
|
||||
if (!outputPath) return;
|
||||
await api.exportTableDataCsv({
|
||||
filePath: outputPath as string,
|
||||
connectionId: props.connection.id,
|
||||
database: props.database,
|
||||
schema,
|
||||
tableName: row.name,
|
||||
columns: queryColumns,
|
||||
timeoutSecs: queryTimeoutSecsForConnection(props.connection),
|
||||
});
|
||||
toast(t("grid.exported"));
|
||||
return;
|
||||
}
|
||||
|
||||
const result = await fetchTableDataForExport({
|
||||
databaseType: props.connection.db_type,
|
||||
schema,
|
||||
|
||||
Reference in new issue
Block a user