dbeaver / cloudbeaver

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

Improve documentation add new driver not already defined in dbeaver #259

Closed momiji closed 3 years ago

momiji commented 3 years ago

Hi,

Great work, however adding new custom drivers is not as simple as it is currently explained in the wiki.

In our use case, we wanted to add the phoenix query server driver to dbeaver/cloudbeaver.

  1. dbeaver project

You need to add a generic driver in dbeaver/plugins/org.jkiss.dbeaver.ext.generic/plugin.xml, something like this:

                <driver
                    id="phoenix-qs"
                    label="Phoenix Query Server"
                    icon="icons/phoenix_icon.png"
                    iconBig="icons/phoenix_icon_big.png"
                    class="org.apache.phoenix.queryserver.client.Driver"
                    sampleURL="jdbc:phoenix:thin:url=http://{host}[:{port}];serialization=PROTOBUF"
                    defaultPort="8765"
                    webURL="http://phoenix.apache.org/"
                    description="Phoenix Query Server driver"
                    categories="hadoop"
                    anonymous="true"
                >
                    <file type="jar" path="drivers/phoenix-qs" bundle="drivers.phoenix-qs"/>
                </driver>
  1. cloudbeaver project

As explained in the wiki, one need to update plugin.xml:

...
        <resource name="drivers/phoenix-qs"/>
...
        <bundle id="drivers.phoenix-qs" label="Phoenix with Query Server drivers"/>
...
        <driver id="generic:phoenix-qs"/>
...

Also add a new phoenix-qs folder containing the following 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.phoenix-qs</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>phoenix-qs</deps.output.dir>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.phoenix</groupId>
            <artifactId>phoenix-queryserver-client</artifactId>
            <version>4.14.1-HBase-1.1</version>
        </dependency>
    </dependencies>

</project>

And finally add the new folder in the modules list in pom.xml:

...
        <module>phoenix-qs</module>
...

All other instructions for building project are correct and work like a charm.

Regards, Chris

kseniiaguzeeva commented 3 years ago

Thank you for your report.

serge-rider commented 3 years ago

New article was added: https://github.com/dbeaver/cloudbeaver/wiki/Adding-new-database-drivers

momiji commented 3 years ago

Thanks, nice to see my contribution helped! Good work :)