1 parent
7c8e0a88cf
commit
e7ef9df85c
4 files changed
+123
-51
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import { isInternalDorisCatalog } from "@/lib/database/databaseFeatureSupport";
|
||||
import type { CatalogInfo } from "@/types/database";
|
||||
import { decodeSelectableDatabaseValue, encodeSelectableDatabaseValue } from "@/lib/database/defaultDatabase";
|
||||
import type { CatalogInfo, DatabaseType } from "@/types/database";
|
||||
|
||||
export interface TransferDatabaseSelection {
|
||||
connectionId: string;
|
||||
@@ -8,6 +9,18 @@ export interface TransferDatabaseSelection {
|
||||
database: string;
|
||||
}
|
||||
|
||||
export function encodeTransferDatabaseOptions(databaseType: DatabaseType | undefined, databases: readonly string[]): string[] {
|
||||
return databases.map((database) => encodeSelectableDatabaseValue(databaseType, database));
|
||||
}
|
||||
|
||||
export function decodeTransferDatabaseOption(databaseType: DatabaseType | undefined, option: string): string {
|
||||
return decodeSelectableDatabaseValue(databaseType, option);
|
||||
}
|
||||
|
||||
export function isTransferDatabaseSelected(option: string): boolean {
|
||||
return option.length > 0;
|
||||
}
|
||||
|
||||
export function normalizeTransferCatalog(catalog: string, catalogs: readonly CatalogInfo[]): string {
|
||||
const normalizedCatalog = catalog.trim();
|
||||
if (!normalizedCatalog) return "";
|
||||
|
||||
Reference in new issue
Block a user