feat(transfer): enable YashanDB table transfers

Closes #9643
This commit is contained in:
t8y2
2026-09-27 07:16:29 +00:00
parent df4315ae44
commit 0c7b3d3e98
5 changed files with 19 additions and 4 deletions
@@ -28,6 +28,7 @@ const connections: ConnectionConfig[] = [
{ id: "pg-source", name: "PostgreSQL Source", db_type: "postgres", host: "localhost", port: 5432, username: "test", password: "" },
{ id: "h2-local-id", name: "Local H2", db_type: "h2", driver_profile: "h2-v3", host: "", port: 0, username: "sa", password: "", database: "mem:transfer-test" },
{ id: "h2-jdbc-id", name: "JDBC H2", db_type: "jdbc", connection_string: "jdbc:h2:mem:transfer-test", host: "", port: 0, username: "sa", password: "" },
{ id: "yashandb-id", name: "YashanDB", db_type: "yashandb", host: "localhost", port: 1688, username: "test", password: "" },
{ id: "redis-id", name: "Redis", db_type: "redis", host: "localhost", port: 6379, username: "", password: "" },
{ id: "unknown-jdbc-id", name: "Unknown JDBC", db_type: "jdbc", host: "localhost", port: 0, username: "", password: "" },
];
@@ -83,6 +84,7 @@ describe("data transfer connection choices", () => {
const picker = container.querySelector(`[data-side="${side}"]`)!;
expect(picker.querySelector('[data-picker-connection="h2-local-id"]')?.textContent).toContain("Local H2");
expect(picker.querySelector('[data-picker-connection="h2-jdbc-id"]')?.textContent).toContain("JDBC H2");
expect(picker.querySelector('[data-picker-connection="yashandb-id"]')?.textContent).toContain("YashanDB");
expect(picker.querySelector('[data-picker-connection="redis-id"]')).toBeNull();
expect(picker.querySelector('[data-picker-connection="unknown-jdbc-id"]')).toBeNull();
}
@@ -94,7 +96,7 @@ describe("data transfer connection choices", () => {
expect(selection.source).toBe(source);
});
it.each(["h2-local-id", "h2-jdbc-id"])("resolves the prefilled %s to its connection name", async (source) => {
it.each(["h2-local-id", "h2-jdbc-id", "yashandb-id"])("resolves the prefilled %s to its connection name", async (source) => {
const { container } = await mountTransferPickers(source);
const trigger = container.querySelector('[data-side="source"] button');
expect(trigger?.textContent).toContain(connections.find((connection) => connection.id === source)!.name);
@@ -4,7 +4,7 @@ import { manifestDatabaseTypes } from "@/lib/database/databaseDriverManifest";
import { supportsTransfer } from "@/lib/database/databaseFeatureSupport";
import type { DatabaseType } from "@/types/database";
const TABLE_ONLY_TRANSFER_DATABASES: DatabaseType[] = ["sqlite", "rqlite", "turso", "cloudflare-d1", "duckdb", "clickhouse", "mongodb", "highgo", "vastbase", "goldendb", "questdb", "h2", "hive", "argo", "kyuubi", "impala", "spark"];
const TABLE_ONLY_TRANSFER_DATABASES: DatabaseType[] = ["sqlite", "rqlite", "turso", "cloudflare-d1", "duckdb", "clickhouse", "mongodb", "highgo", "vastbase", "goldendb", "yashandb", "questdb", "h2", "hive", "argo", "kyuubi", "impala", "spark"];
describe("transferObjectKinds", () => {
it("groups databases into transfer families", () => {
@@ -1231,7 +1231,7 @@
"tableDataEdit": true,
"tableStructureEdit": true,
"tableImport": true,
"dataTransfer": false,
"dataTransfer": true,
"sqlFileExecution": true,
"databaseCreate": true,
"fieldLineage": false,
@@ -491,6 +491,19 @@ fn vastbase_declares_data_transfer_support() {
assert!(vastbase.capabilities.data_transfer);
}
#[test]
fn yashandb_declares_data_transfer_support() {
let manifest = driver_manifest();
let yashandb = manifest
.drivers
.iter()
.find(|driver| driver.db_type == DatabaseType::Yashandb)
.expect("YashanDB manifest entry");
assert!(yashandb.capabilities.table_import);
assert!(yashandb.capabilities.data_transfer);
}
#[test]
fn xugu_declares_table_import_support() {
let manifest = driver_manifest();
+1 -1
View File
@@ -27,7 +27,7 @@ capabilities:
tableDataEdit: true
tableStructureEdit: true
tableImport: true
dataTransfer: false
dataTransfer: true
sqlFileExecution: true
databaseCreate: true
fieldLineage: false