What is ngql¶
ngql is a command-line client for the Graph service in NebulaGraph Database Developer Edition. Use it to run GQL statements and scripts, load built-in sample data, and change result formats.
Features¶
- Interactive and non-interactive modes: Enter statements at the prompt or run statements from a script file.
- Auto-completion: Complete GQL statements with the Tab key.
- Statement history: Recall and rerun previous statements.
- Result formats: Display query results in different formats.
Open ngql with Docker Compose¶
After starting NebulaGraph Database Developer Edition as described in the deployment guide, open a terminal on the development machine running Docker, go to the directory containing compose.yaml, and run:
docker compose exec ngql ngql --host graph-cluster --port 9669 --user root
The first ngql is the Compose service name; the second is the client command inside the container. graph-cluster:9669 is the Graph service address inside the container network. Do not replace it with the development machine's IP address.
At the Password prompt, enter NebulaGraph Database Developer Edition's current root password. For initial password settings and escaping rules, see Set the root password. After connecting, enter GQL statements at the prompt; enter :q to exit the client.
For a connection and query example, see Connect and run your first query.
Download standalone packages¶
The supplied Docker Compose deployment includes an ngql container. Download a standalone package to run the client directly on your development machine or another machine.
Current version: 5.3.1. Choose the package for the operating system and CPU architecture of the machine that will run the client.
| Operating system | CPU architecture | Package | Checksum |
|---|---|---|---|
| macOS | Apple Silicon (ARM64) | Download | SHA-256 |
| macOS | Intel (x86-64) | Download | SHA-256 |
| Linux | ARM64 | Download | SHA-256 |
| Linux | x86-64 | Download | SHA-256 |
| Windows | x86-64 | Download | SHA-256 |
To check file integrity, see Verify a package.
Extract and connect¶
Make sure NebulaGraph Database Developer Edition is running as described in the deployment guide. Open a terminal in the download directory. Replace <package-name> with the downloaded filename before running the commands below.
The examples use 127.0.0.1:9669 to connect to a database running on the same machine. To connect from another machine, replace 127.0.0.1 with the Docker host's IP address. If you changed the port mapping, use the host port you configured.
tar -xzf "<package-name>"
cd nebula-graph-ngql/bin
./ngql --host 127.0.0.1 --port 9669 --user root
tar -xzf "<package-name>"
Set-Location nebula-graph-ngql/bin
.\ngql.exe --host 127.0.0.1 --port 9669 --user root
At the Password prompt, enter the current root password. Once connected, follow the first-query example to load sample data and run queries.
More usage examples¶
- For interactive commands, scripts, and result formats, see the ngql usage guide.
- For GQL syntax and examples, see the GQL reference.