dbeaver / cloudbeaver

Cloud Database Manager
https://dbeaver.com/
Apache License 2.0
3.41k stars 372 forks source link

Adding a driver does not work #2402

Closed michalkahle closed 7 months ago

michalkahle commented 7 months ago

I've tried to add a driver for InterSystems Cache database to CloudBeaver according to the instructions. I've modified the pom to take the jar from the filesystem as it is not present in the Maven repository. CloudBeaver builds without errors but the driver for Cache is not present in the GUI.

~/cloudbeaver/server/drivers/cache$ cat pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <artifactId>drivers.cache</artifactId>
    <version>1.0.0</version>
    <parent>
        <groupId>io.cloudbeaver</groupId>
        <artifactId>drivers</artifactId>
        <version>1.0.0</version>
        <relativePath>../</relativePath>
    </parent>

    <properties>
        <deps.output.dir>cache</deps.output.dir>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.intersystems</groupId>
            <artifactId>cache-jdbc</artifactId>
            <version>1.0</version>
    <scope>system</scope>
    <systemPath>/home/mkah/drivers/drivers/cache/CacheDB.jar</systemPath>
        </dependency>
    </dependencies>

</project>
diff --git a/server/bundles/io.cloudbeaver.resources.drivers.base/plugin.xml b/server/bundles/io.cloudbeaver.resources.drivers.base/plugin.xml
index 46cd99796..9787bc02f 100644
--- a/server/bundles/io.cloudbeaver.resources.drivers.base/plugin.xml
+++ b/server/bundles/io.cloudbeaver.resources.drivers.base/plugin.xml
@@ -17,6 +17,7 @@
         <resource name="drivers/sqlite/xerial"/>
         <resource name="drivers/mssql/new"/>
         <resource name="drivers/trino"/>
+        <resource name="drivers/cache"/>
     </extension>

     <!-- Bundles  -->
@@ -36,6 +37,7 @@
         <bundle id="drivers.sqlite.xerial" label="SQLite drivers"/>
         <bundle id="drivers.mssql.new" label="SQL Server drivers"/>
         <bundle id="drivers.trino" label="Trino drivers"/>
+        <bundle id="drivers.cache" label="Cache drivers"/>
     </extension>

     <!-- Enabled drivers -->
@@ -55,6 +57,7 @@
         <driver id="sqlserver:microsoft"/>
         <driver id="generic:trino_jdbc"/>
         <driver id="generic:duckdb_jdbc"/>
+        <driver id="generic:cache-jdbc"/>
     </extension>

diff --git a/server/drivers/pom.xml b/server/drivers/pom.xml
index 2d5d4b371..103b17124 100644
--- a/server/drivers/pom.xml
+++ b/server/drivers/pom.xml
@@ -12,6 +12,7 @@

     <modules>
         <module>clickhouse_com</module>
+        <module>cache</module>
         <module>db2</module>
         <module>db2-jt400</module>
         <module>duckdb</module>

image

EvgeniaBzzz commented 7 months ago

Hi @michalkahle Have you added driver to plugin.xml?

Also try to change id to <driver id="generic:cache"/>

michalkahle commented 7 months ago

The change to <driver id="generic:cache"/> fixed it. Maybe it should be mentioned in the instructions that this id has to match with the id in dbeaver/plugins/org.jkiss.dbeaver.ext.generic/plugin.xml.

Add line <driver id="full-driver-id"/> in the end of the enabled drivers list. Usually, your full driver id will be something like generic.new-driver-id and it have to match with the id in DBeaver's plugin.xml file.

LonwoLonwo commented 7 months ago

Thanks for the update @michalkahle

Maybe it should be mentioned in the instructions that this id has to match with the id in dbeaver/plugins/org.jkiss.dbeaver.ext.generic/plugin.xml.

This is a good idea.