fix(export): mark NULL as \N in CSV and TSV exports
This commit is contained in:
49 files changed
+1056
-130
No files matched your search
@@ -5466,6 +5466,8 @@ export interface TableImportParseOptions {
|
||||
lastDataRow?: number | null;
|
||||
trimValues?: boolean | null;
|
||||
emptyStringAsNull?: boolean | null;
|
||||
/** 分隔文本里代表 NULL 的字面量。缺省表示用后端默认值 `\N`;空串表示关闭字面量,退回「空字段即 NULL」。 */
|
||||
nullLiteral?: string | null;
|
||||
sheetName?: string | null;
|
||||
sheetIndex?: number | null;
|
||||
jsonShape?: TableImportJsonShape | null;
|
||||
@@ -5861,6 +5863,8 @@ export interface TableExportRequest {
|
||||
insertMode?: SqlInsertMode;
|
||||
insertDialect?: SqlInsertDialect;
|
||||
csvQuoteMode?: CsvQuoteMode;
|
||||
/** CSV 里 NULL 写成什么。缺省表示用后端默认值 `\N`;空串表示关闭字面量。 */
|
||||
nullLiteral?: string;
|
||||
columns?: string[];
|
||||
selectedColumns?: SqlExportColumnSelection[];
|
||||
columnTypes?: Array<string | null | undefined>;
|
||||
@@ -5891,6 +5895,8 @@ export interface TableCsvExportOptions {
|
||||
pageSize?: number;
|
||||
timeoutSecs?: number;
|
||||
csvQuoteMode?: CsvQuoteMode;
|
||||
/** CSV 里 NULL 写成什么。缺省表示用后端默认值 `\N`;空串表示关闭字面量。 */
|
||||
nullLiteral?: string;
|
||||
}
|
||||
|
||||
export interface TableExportProgress {
|
||||
@@ -5917,6 +5923,8 @@ export interface QueryResultExportRequest {
|
||||
format: "csv" | "xlsx" | "json" | "txt" | "sql";
|
||||
insertMode?: SqlInsertMode;
|
||||
csvQuoteMode?: CsvQuoteMode;
|
||||
/** CSV 里 NULL 写成什么。缺省表示用后端默认值 `\N`;空串表示关闭字面量。 */
|
||||
nullLiteral?: string;
|
||||
includeSqlSheet?: boolean;
|
||||
pageSize: number;
|
||||
rowLimit?: number | null;
|
||||
@@ -6074,13 +6082,14 @@ export async function recordDatabaseExportDestination(directory: string): Promis
|
||||
await invoke("record_database_export_destination", { directory });
|
||||
}
|
||||
|
||||
export async function exportQueryResultCsv(filePath: string, columns: string[], rows: readonly (readonly XlsxCellValue[])[], csvQuoteMode: CsvQuoteMode = "all"): Promise<void> {
|
||||
export async function exportQueryResultCsv(filePath: string, columns: string[], rows: readonly (readonly XlsxCellValue[])[], csvQuoteMode: CsvQuoteMode = "all", nullLiteral?: string): Promise<void> {
|
||||
return invoke("export_query_result_csv", {
|
||||
request: {
|
||||
filePath,
|
||||
columns,
|
||||
rows,
|
||||
csvQuoteMode,
|
||||
...(nullLiteral === undefined ? {} : { nullLiteral }),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user