Querying Polypheny with JetBrains DataGrip

Use a custom JDBC driver in JetBrains DataGrip to browse relational namespaces and run SQL against Polypheny. Enable the Prism 2.2 query interface on your Polypheny instance before connecting.

Add the JDBC driver

  1. Download the shaded polypheny-jdbc-driver-3.1.jar.
  2. Open File > Data Sources. On the Drivers tab, click + to add a driver. Name it Polypheny.
  3. In Driver Files, click + > Custom JARs and select the JAR. Set Class to org.polypheny.jdbc.PolyphenyDriver.
  4. Click Apply and Create Data Source in the driver’s settings.

Connect

In the data source’s General tab, enter your Polypheny credentials and use the JDBC URL below for a local instance.

jdbc:polypheny://localhost:20590/

If your local instance still uses the defaults, enter pa in User and use Set Empty in the Password field’s context menu. For another server, replace the host and port with its Prism TCP address. Click Test Connection and save the data source.

The URL below uses the namespace connection property to select public as the default namespace.

jdbc:polypheny://localhost:20590/?namespace=public

See JDBC driver settings for supported properties. If DataGrip cannot load the class, check the JAR path and class name. If the driver loads but cannot connect, check that the Prism TCP endpoint is reachable.

Run SQL

Open a query console for the data source and run the following statements.

SELECT 1 AS ready;
SELECT CURRENT_DATE AS today;

DataGrip shows the results in the results pane. You can run one statement at a time or select both to run the selection. Use Export Data in the result grid if you need a CSV or other file.

DataGrip uses the standard relational JDBC interfaces for its console and schema browser. To execute MongoQL or handle document results, use the JDBC multi-model extensions in application code. Other JetBrains IDEs with the Database Tools and SQL plugin can use the same custom driver configuration. See JetBrains’ guide to custom data sources.

© Polypheny GmbH. All Rights Reserved.