fix(transfer): support gbase jdbc connections
This commit is contained in:
9 files changed
+240
-13
No files matched your search
@@ -189,6 +189,40 @@ describe("jdbc dialect inference", () => {
|
||||
expect(inferJdbcDialect(damengConnection)).toBe("dameng");
|
||||
});
|
||||
|
||||
it("detects GBase JDBC connections for transfer dialect selection", () => {
|
||||
const gbaseConnection = {
|
||||
db_type: "jdbc" as const,
|
||||
connection_string: "jdbc:gbase://localhost:5258/dbx_test",
|
||||
jdbc_driver_class: "cn.gbase.Driver",
|
||||
};
|
||||
|
||||
expect(inferJdbcDialect(gbaseConnection)).toBe("gbase");
|
||||
expect(effectiveDatabaseTypeForConnection(gbaseConnection)).toBe("gbase");
|
||||
|
||||
// GBase 8s is Informix-based and must stay on generic jdbc (no MySQL-family transfer dialect).
|
||||
const gbase8sByUrl = {
|
||||
db_type: "jdbc" as const,
|
||||
connection_string: "jdbc:gbasedbt-sqli://localhost:9088/dbx_test:INFORMIXSERVER=ol_gbasedbt",
|
||||
jdbc_driver_class: "com.gbasedbt.jdbc.Driver",
|
||||
};
|
||||
const gbase8sByProfile = {
|
||||
db_type: "jdbc" as const,
|
||||
driver_profile: "gbase8s",
|
||||
};
|
||||
const gbase8sProfileWithLegacyGbaseUrl = {
|
||||
db_type: "jdbc" as const,
|
||||
driver_profile: "gbase8s",
|
||||
connection_string: "jdbc:gbase://localhost:5258/dbx_test",
|
||||
jdbc_driver_class: "cn.gbase.Driver",
|
||||
};
|
||||
expect(inferJdbcDialect(gbase8sByUrl)).toBe("informix");
|
||||
expect(effectiveDatabaseTypeForConnection(gbase8sByUrl)).toBe("informix");
|
||||
expect(inferJdbcDialect(gbase8sByProfile)).toBeUndefined();
|
||||
expect(effectiveDatabaseTypeForConnection(gbase8sByProfile)).toBe("jdbc");
|
||||
expect(inferJdbcDialect(gbase8sProfileWithLegacyGbaseUrl)).toBeUndefined();
|
||||
expect(effectiveDatabaseTypeForConnection(gbase8sProfileWithLegacyGbaseUrl)).toBe("jdbc");
|
||||
});
|
||||
|
||||
it("uses Hive tree and execution semantics for Inceptor JDBC metadata", () => {
|
||||
const connection = {
|
||||
db_type: "jdbc" as const,
|
||||
|
||||
Reference in new issue
Block a user