NebulaGraph Go¶
NebulaGraph Go is a Golang client for connecting to and managing the NebulaGraph database.
Prerequisites¶
You have installed Golang 1.13 or later versions.
Compatibility with NebulaGraph¶
| NebulaGraph version | NebulaGraph Go version | 
|---|---|
| 3.3.0 | 3.3.0 | 
| 3.2.x | 3.2.0 | 
| 3.1.0 | 3.1.0 | 
| 3.0.0 ~ 3.0.2 | 3.0.0 | 
| 2.6.x | 2.6.0 | 
| 2.0.x | 2.0.0-GA | 
Download NebulaGraph Go¶
- 
(Recommended) To install a specific version of NebulaGraph Go, use the Git option --branchto specify the branch. For example, to install v3.4.0, run the following command:$ git clone --branch release-3.4 https://github.com/vesoft-inc/nebula-go.git
- 
To install the daily development version, run the following command to download the source code from the masterbranch:$ git clone https://github.com/vesoft-inc/nebula-go.git
Install or update¶
Run the following command to install or update NebulaGraph Go:
$ go get -u -v github.com/vesoft-inc/nebula-go/v3@v3.4.0
Core of the example code¶
The NebulaGraph GO client provides both Connection Pool and Session Pool, using Connection Pool requires the user to manage the session instances.
- 
Session Pool For details about all the code, see session_pool_example.go. For limitations of using Session Pool, see Usage example. 
- 
Connection Pool For all the code, see graph_client_basic_example and graph_client_goroutines_example.