Basic JDBC query functionality for the InfluxDB.
Intended to help developers and data analyst to inspect data over various GUI.
Caution
|
This driver does not provide full JDBC functionality and compatibility. |
influxdb-jdbc artifact is hosted on Maven Central
This driver should provide basic query functionality for various IDEs and GUI DB clients. You can send InfluxQL queries which are returned as sets of result sets.
It is capable to fetch all dababase (catalog) names, measurements (table), fields (column) and tags (column & index) from the metadata.
I tested it with IntelliJ Idea’s DB support.
-
SQL syntax. You must send InfluxQL queries.
-
Changing to other database when connection is already open is not implemented yet. #1
-
Ordering by tags or fields (columns other than
time
).
InfluxDB doesn’t support ordering except oftime
. -
Prepared statements are not implemented yet. #16
-
Callable statements.
InfluxDB doesn’t support procedures. -
Write operations.
Get the driver from the GitHub repo: influxdb-jdbc-0.2.2
JDBC URL is in the form of jdbc:influxdb:[http://][<USER>:<PASSWORD>]<HOST>[:<PORT>][?db=<DATABASE>]
.
Example: jdbc:influxdb:localhost:8086?db=telegraf
You can also pass database, username and password as driver properties:
Property | Description |
---|---|
username |
login to the InfluxDB with this username |
user |
alias for username |
password |
login to the InfluxDB with this password |
database |
use this database after connecting |
db |
alias fo r database |
repositories {
maven {
url = uri("https://maven.pkg.github.com/konikvranik/jdbc-influxdb")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("TOKEN")
}
}
}
dependencies {
implementation 'net.suteren.jdbc.influxdb:influxdb-jdbc:0.2.2'
}
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<activeProfiles>
<activeProfile>github</activeProfile>
</activeProfiles>
<profiles>
<profile>
<id>github</id>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
</repository>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/konikvranik/jdbc-influxdb</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<servers>
<server>
<id>github</id>
<username>USERNAME</username>
<password>TOKEN</password>
</server>
</servers>
</settings>
<dependency>
<groupId>net.suteren.jdbc.influxdb</groupId>
<artifactId>influxdb-jdbc</artifactId>
<version>0.2.2</version>
</dependency>