/hogql-jdbc-driver

JDBC connector for PostHog's HogQL

Primary LanguageJava

PostHog HogQL JDBC Driver

image

Usage

Connect the connector's JAR to your JDBC client, and use a URL with the following structure:

jdbc:hogql://PERSONAL_API_KEY@app.posthog.com/PROJECT_ID/

or

jdbc:hogql://PERSONAL_API_KEY@localhost:8080/PROJECT_ID/

Omitting a port, or specifying one with 443 will use HTTPS. Any other port will use HTTP.

Developing

mvn clean && mvn compile && mvn package && mvn exec:java

Then:

  1. Copy target/hogql-jdbc-driver-1.0.0-SNAPSHOT-jar-with-dependencies.jar to your app.
  2. Select com.posthog.hogql.HogQLDriver as the driver.

Note

This is still very much a work in progress. For example the API URL and a (development) private key are encoded in the code.

However it at least works for making SQL queries inside PyCharm.