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.
mvn clean && mvn compile && mvn package && mvn exec:java
Then:
- Copy
target/hogql-jdbc-driver-1.0.0-SNAPSHOT-jar-with-dependencies.jar
to your app. - Select
com.posthog.hogql.HogQLDriver
as the driver.
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.