merge: fix HTTP randomUUID export fallback
This commit is contained in:
commit
43c38bc5bc
5 files changed
+45
-4
No files matched your search
@@ -10,6 +10,7 @@ import DatabaseIcon from "@/components/icons/DatabaseIcon.vue";
|
||||
import * as api from "@/lib/api";
|
||||
import type { ExportProgress } from "@/lib/api";
|
||||
import { isSchemaAware } from "@/lib/databaseCapabilities";
|
||||
import { generateDatabaseExportId } from "@/lib/databaseExport";
|
||||
import { buildSelectedTablesPayload } from "@/lib/databaseExportSelection";
|
||||
import { isTauriRuntime } from "@/lib/tauriRuntime";
|
||||
import { useToast } from "@/composables/useToast";
|
||||
@@ -161,7 +162,7 @@ async function startExport() {
|
||||
exportCancelled.value = false;
|
||||
exportProgress.value = null;
|
||||
|
||||
exportId.value = crypto.randomUUID();
|
||||
exportId.value = generateDatabaseExportId();
|
||||
|
||||
let filePath = "";
|
||||
|
||||
|
||||
@@ -77,6 +77,7 @@ import {
|
||||
normalizeWhereInput,
|
||||
quoteTableIdentifier,
|
||||
} from "@/lib/tableSelectSql";
|
||||
import { uuid } from "@/lib/utils";
|
||||
import {
|
||||
canEditExistingTableRows,
|
||||
hiveTablePropertiesIndicateTransactional,
|
||||
@@ -586,8 +587,7 @@ function selectCustomFormatter(value: string) {
|
||||
}
|
||||
|
||||
function createCustomFormatterId(): string {
|
||||
if (typeof crypto !== "undefined" && "randomUUID" in crypto) return `fmt_${crypto.randomUUID()}`;
|
||||
return `fmt_${Date.now().toString(36)}_${Math.random().toString(36).slice(2)}`;
|
||||
return `fmt_${uuid()}`;
|
||||
}
|
||||
|
||||
function formatterPreviewRows(columnIndex: number) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { DatabaseType, QueryResult } from "../types/database.ts";
|
||||
import { buildTableSelectSql } from "./tableSelectSql.ts";
|
||||
import { uuid } from "./utils.ts";
|
||||
|
||||
type SqlValue = QueryResult["rows"][number][number];
|
||||
|
||||
@@ -72,6 +73,10 @@ export function buildExportPageSql(options: BuildExportPageSqlOptions): string {
|
||||
});
|
||||
}
|
||||
|
||||
export function generateDatabaseExportId(): string {
|
||||
return uuid();
|
||||
}
|
||||
|
||||
export function buildDatabaseSqlExport(options: BuildDatabaseSqlExportOptions): string {
|
||||
const exportedAt = options.exportedAt ?? new Date();
|
||||
const rowLimit = options.rowLimitPerTable ?? DATABASE_EXPORT_ROW_LIMIT;
|
||||
|
||||
Reference in new issue
Block a user