fix(jdbc): include managed drivers in offline bundles
This commit is contained in:
14 files changed
+942
-15
No files matched your search
@@ -628,7 +628,7 @@ async function importOfflineZip() {
|
||||
resetAgentInstallProgress();
|
||||
try {
|
||||
const count = await api.importAgentsFromZip(selected, activeAgentOperationId.value);
|
||||
await refreshAgents();
|
||||
await Promise.all([refreshAgents(), loadJdbcDrivers(), loadJdbcPluginStatus()]);
|
||||
toast(t("driverStore.offlineImportSuccess", { count }));
|
||||
} catch (e: any) {
|
||||
toast(t("driverStore.offlineImportFailed", { error: backendError(e) }));
|
||||
@@ -660,7 +660,7 @@ async function importDriverFile(driver: AgentDriverInfo) {
|
||||
resetAgentInstallProgress();
|
||||
try {
|
||||
const count = await api.importAgentsFromZip(selected, activeAgentOperationId.value);
|
||||
await refreshAgents();
|
||||
await Promise.all([refreshAgents(), loadJdbcDrivers(), loadJdbcPluginStatus()]);
|
||||
toast(t("driverStore.offlineImportSuccess", { count }));
|
||||
} finally {
|
||||
activeAgentOperationId.value = null;
|
||||
|
||||
@@ -24,6 +24,26 @@ describe("managedJdbcDrivers", () => {
|
||||
expect(managedJdbcDriverRows([], pluginStatus()).map(({ db_type }) => db_type)).toEqual(["prestosql", "phoenix"]);
|
||||
});
|
||||
|
||||
it("marks both managed drivers installed when the offline payload contains every bundle", () => {
|
||||
const coordinates = [PRESTOSQL_JDBC_DRIVER_COORDINATE, ...PHOENIX_MANAGED_MAVEN_COORDINATES];
|
||||
const bundles = coordinates.map(
|
||||
(coordinate): JdbcMavenBundleInfo => ({
|
||||
id: coordinate.replace(/[^A-Za-z0-9.-]/g, "_"),
|
||||
coordinate,
|
||||
scope: "runtime",
|
||||
repositories: ["https://repo.maven.apache.org/maven2/"],
|
||||
installed_at: "2026-08-14T00:00:00Z",
|
||||
path: `/plugins/jdbc/drivers/maven/${coordinate}`,
|
||||
artifacts: [],
|
||||
}),
|
||||
);
|
||||
|
||||
expect(managedJdbcDriverRows(bundles, pluginStatus()).map(({ db_type, installed }) => ({ db_type, installed }))).toEqual([
|
||||
{ db_type: "prestosql", installed: true },
|
||||
{ db_type: "phoenix", installed: true },
|
||||
]);
|
||||
});
|
||||
|
||||
it("installs PrestoSQL through the generic Maven resolver", async () => {
|
||||
const installed: JdbcMavenBundleInfo = {
|
||||
id: "io.prestosql_presto-jdbc_350",
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"repository": "https://repo.maven.apache.org/maven2/",
|
||||
"drivers": {
|
||||
"prestosql": {
|
||||
"bundles": {
|
||||
"driver": {
|
||||
"id": "io.prestosql_presto-jdbc_350",
|
||||
"coordinate": "io.prestosql:presto-jdbc:350",
|
||||
"artifact": {
|
||||
"group_id": "io.prestosql",
|
||||
"artifact_id": "presto-jdbc",
|
||||
"version": "350",
|
||||
"classifier": "",
|
||||
"extension": "jar",
|
||||
"file_name": "presto-jdbc-350.jar",
|
||||
"size": 6656599,
|
||||
"sha256": "664a23e517c120c1d5a9bb88b215612b117415b9f1649bc22c48298eaf3f979b"
|
||||
},
|
||||
"redistribution": {
|
||||
"project_url": "https://prestosql.io/",
|
||||
"source_url": "https://github.com/prestosql/presto/tree/350",
|
||||
"root_license_expression": "Apache-2.0",
|
||||
"license_entries": ["META-INF/LICENSE", "META-INF/LICENSE.txt"],
|
||||
"notice_entries": ["META-INF/NOTICE", "META-INF/NOTICE.txt"]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"phoenix": {
|
||||
"bundles": {
|
||||
"direct": {
|
||||
"id": "org.apache.phoenix_phoenix-client-embedded-hbase-2.5_5.2.1",
|
||||
"coordinate": "org.apache.phoenix:phoenix-client-embedded-hbase-2.5:5.2.1",
|
||||
"artifact": {
|
||||
"group_id": "org.apache.phoenix",
|
||||
"artifact_id": "phoenix-client-embedded-hbase-2.5",
|
||||
"version": "5.2.1",
|
||||
"classifier": "",
|
||||
"extension": "jar",
|
||||
"file_name": "phoenix-client-embedded-hbase-2.5-5.2.1.jar",
|
||||
"size": 158572775,
|
||||
"sha256": "c698a81f4250dbfe0af4b656b6de9c72bd3fee26e7945ccb893f741fbe05c4ca"
|
||||
},
|
||||
"redistribution": {
|
||||
"project_url": "https://phoenix.apache.org/",
|
||||
"source_url": "https://github.com/apache/phoenix/tree/5.2.1",
|
||||
"root_license_expression": "Apache-2.0",
|
||||
"license_entries": ["META-INF/LICENSE", "META-INF/LICENSE.txt", "LICENSE", "META-INF/licenses-binary/LICENSE.protobuf.txt"],
|
||||
"notice_entries": ["META-INF/DEPENDENCIES", "META-INF/NOTICE.txt", "META-INF/NOTICE-binary", "META-INF/NOTICE.md", "META-INF/NOTICE.markdown"]
|
||||
}
|
||||
},
|
||||
"logging": {
|
||||
"id": "ch.qos.reload4j_reload4j_1.2.26",
|
||||
"coordinate": "ch.qos.reload4j:reload4j:1.2.26",
|
||||
"artifact": {
|
||||
"group_id": "ch.qos.reload4j",
|
||||
"artifact_id": "reload4j",
|
||||
"version": "1.2.26",
|
||||
"classifier": "",
|
||||
"extension": "jar",
|
||||
"file_name": "reload4j-1.2.26.jar",
|
||||
"size": 338688,
|
||||
"sha256": "a7e86ae144541d04d24d1b7123d7425415477d50f387bb868e5c955aeaedd96f"
|
||||
},
|
||||
"redistribution": {
|
||||
"project_url": "https://reload4j.qos.ch/",
|
||||
"source_url": "https://github.com/qos-ch/reload4j/tree/v_1.2.26",
|
||||
"root_license_expression": "Apache-2.0",
|
||||
"license_entries": ["META-INF/LICENSE"],
|
||||
"notice_entries": ["META-INF/NOTICE"]
|
||||
}
|
||||
},
|
||||
"query_server": {
|
||||
"id": "org.apache.phoenix_phoenix-queryserver-client_6.0.0",
|
||||
"coordinate": "org.apache.phoenix:phoenix-queryserver-client:6.0.0",
|
||||
"artifact": {
|
||||
"group_id": "org.apache.phoenix",
|
||||
"artifact_id": "phoenix-queryserver-client",
|
||||
"version": "6.0.0",
|
||||
"classifier": "",
|
||||
"extension": "jar",
|
||||
"file_name": "phoenix-queryserver-client-6.0.0.jar",
|
||||
"size": 6294972,
|
||||
"sha256": "94e634ded958525f1dee090999c77ab1d0e7e022ea2767b0c73416cc67c8ebcf"
|
||||
},
|
||||
"redistribution": {
|
||||
"project_url": "https://phoenix.apache.org/",
|
||||
"source_url": "https://github.com/apache/phoenix-queryserver/tree/6.0.0",
|
||||
"root_license_expression": "Apache-2.0",
|
||||
"license_entries": ["META-INF/LICENSE"],
|
||||
"notice_entries": ["META-INF/DEPENDENCIES", "META-INF/NOTICE"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,17 @@
|
||||
import type { ConnectionConfig } from "@/types/database";
|
||||
import type { JdbcProductProfileDefinition } from "@/lib/database/jdbcProductProfile";
|
||||
import managedJdbcAssets from "@/lib/database/managedJdbcAssets.json";
|
||||
|
||||
export const PHOENIX_DRIVER_PROFILE = "phoenix";
|
||||
export const PHOENIX_DIRECT_JDBC_URL = "jdbc:phoenix:localhost";
|
||||
export const PHOENIX_DIRECT_JDBC_DRIVER_CLASS = "org.apache.phoenix.jdbc.PhoenixDriver";
|
||||
export const PHOENIX_QUERY_SERVER_JDBC_URL = "jdbc:phoenix:thin:url=http://127.0.0.1:8765;serialization=PROTOBUF";
|
||||
export const PHOENIX_QUERY_SERVER_JDBC_DRIVER_CLASS = "org.apache.phoenix.queryserver.client.Driver";
|
||||
export const PHOENIX_MAVEN_REPOSITORY = "https://repo.maven.apache.org/maven2/";
|
||||
export const PHOENIX_DIRECT_MAVEN_COORDINATE = "org.apache.phoenix:phoenix-client-embedded-hbase-2.5:5.2.1";
|
||||
export const PHOENIX_QUERY_SERVER_MAVEN_COORDINATE = "org.apache.phoenix:phoenix-queryserver-client:6.0.0";
|
||||
export const PHOENIX_DIRECT_LOGGING_MAVEN_COORDINATE = "ch.qos.reload4j:reload4j:1.2.26";
|
||||
const PHOENIX_JDBC_ASSETS = managedJdbcAssets.drivers.phoenix.bundles;
|
||||
export const PHOENIX_MAVEN_REPOSITORY = managedJdbcAssets.repository;
|
||||
export const PHOENIX_DIRECT_MAVEN_COORDINATE = PHOENIX_JDBC_ASSETS.direct.coordinate;
|
||||
export const PHOENIX_QUERY_SERVER_MAVEN_COORDINATE = PHOENIX_JDBC_ASSETS.query_server.coordinate;
|
||||
export const PHOENIX_DIRECT_LOGGING_MAVEN_COORDINATE = PHOENIX_JDBC_ASSETS.logging.coordinate;
|
||||
export const PHOENIX_DRIVER_NOT_INSTALLED_ERROR = "Apache Phoenix JDBC driver is not installed. Install it from the Driver Manager, then retry.";
|
||||
export const PHOENIX_JDBC_PLUGIN_NOT_INSTALLED_ERROR = "DBX JDBC plugin is not installed. Install Apache Phoenix JDBC from the Driver Manager, then retry.";
|
||||
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import type { JdbcMavenBundleInfo } from "@/types/database";
|
||||
import { managedJdbcDriverPaths, type ManagedJdbcDriverDefinition } from "@/lib/database/managedJdbcDriver";
|
||||
import managedJdbcAssets from "@/lib/database/managedJdbcAssets.json";
|
||||
|
||||
export const PRESTOSQL_DRIVER_DB_TYPE = "prestosql";
|
||||
export const PRESTOSQL_JDBC_DRIVER_VERSION = "350";
|
||||
export const PRESTOSQL_JDBC_DRIVER_COORDINATE = `io.prestosql:presto-jdbc:${PRESTOSQL_JDBC_DRIVER_VERSION}`;
|
||||
export const PRESTOSQL_JDBC_DRIVER_REPOSITORY = "https://repo.maven.apache.org/maven2/";
|
||||
const PRESTOSQL_JDBC_ASSET = managedJdbcAssets.drivers.prestosql.bundles.driver;
|
||||
export const PRESTOSQL_JDBC_DRIVER_VERSION = PRESTOSQL_JDBC_ASSET.artifact.version;
|
||||
export const PRESTOSQL_JDBC_DRIVER_COORDINATE = PRESTOSQL_JDBC_ASSET.coordinate;
|
||||
export const PRESTOSQL_JDBC_DRIVER_REPOSITORY = managedJdbcAssets.repository;
|
||||
export const PRESTOSQL_MANAGED_JDBC_DRIVER: ManagedJdbcDriverDefinition = {
|
||||
id: PRESTOSQL_DRIVER_DB_TYPE,
|
||||
label: "PrestoSQL",
|
||||
|
||||
Reference in new issue
Block a user