This is a prerelease version.

View latest

Connecting to the SQL Service

Before you Begin

To use the SQL service, the Jet engine must be enabled on the cluster. For information about how to enable the Jet engine, see Securing Jobs.

Connection Options

You can connect to the SQL service of a Hazelcast member using one of the following options:

You cannot run SQL queries on lite members. This limitation will be removed in future releases.

Using the SQL Shell

The easiest way to run SQL queries on a cluster is to connect to the SQL shell.

To connect to the SQL shell, run the hz-cli sql command of your member’s built-in CLI.

  • Binary

  • Docker

Mac and Linux
bin/hz-cli sql
Windows
bin/hz-cli.bat sql

Replace the $LOCAL_IP placeholder with your member’s local IP address.

docker run --network hazelcast-network -it --rm hazelcast/hazelcast:5.1-SNAPSHOT hz-cli --targets hello-world@$LOCAL_IP sql

The --targets parameter tells the SQL shell to connect to the member at the given IP address in a cluster called hello-world.