Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-ince authored Aug 23, 2018
1 parent 37e0f48 commit c0eb739
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@ This package requires the following tools/libraries to be installed in order to
2. Clone [seabolt](http://github.com/neo4j-drivers/seabolt) (assume `<seabolt_dir>` to be the absolute path in which the clone resides) and make sure you can build it successfully (follow it's own instructions)
3. Add/Update environment variable `PKG_CONFIG_PATH` to include `<seabolt_dir>/build`
4. Add/Update environment variable `LD_LIBRARY_PATH` to include `<seabolt_dir>/build/lib`
5. Get this package via `go get github.com/neo4j/neo4j-go-driver`
5. Get this package via `go get github.com/neo4j/neo4j-go-driver/neo4j`

### MacOS

1. Install pkg-config via `brew install pkg-config`
2. Clone [seabolt](http://github.com/neo4j-drivers/seabolt) (assume `<seabolt_dir>` to be the absolute path in which the clone resides) and make sure you can build it successfully,
3. Add/Update environment variable `PKG_CONFIG_PATH` to include `build` subdirectory of seabolt, i.e. `$PKG_CONFIG_PATH:<seabolt_dir>/build`
4. Add/Update environment variable `LD_LIBRARY_PATH` to include `<seabolt_dir>/build/lib`
5. Go Get this package via `go get github.com/neo4j/neo4j-go-driver`
5. Go Get this package via `go get github.com/neo4j/neo4j-go-driver/neo4j`

### Windows

1. Install a mingw toolchain (for instance MSYS2 from https://www.msys2.org/) for cgo support (seabolt include some instructions),
2. Clone [seabolt](http://github.com/neo4j-drivers/seabolt) (assume `<seabolt_dir>` to be the absolute path in which the clone resides) and make sure you can build it successfully,
3. Add/Update environment variable `PKG_CONFIG_PATH` to include `build` subdirectory of seabolt, i.e. `%PKG_CONFIG_PATH%;<seabolt_dir>/build`
4. Update environment variable `PATH` to include `<seabolt_dir>/build/bin`
5. Go Get this package via `go get github.com/neo4j/neo4j-go-driver`
5. Go Get this package via `go get github.com/neo4j/neo4j-go-driver/neo4j`

## Versioning

Expand All @@ -45,7 +45,7 @@ Although `master` branch contains the source code for the latest available relea
Add the driver as a dependency with `dep`.

```
dep ensure -add github.com/neo4j/neo4j-go-driver
dep ensure -add github.com/neo4j/neo4j-go-driver/neo4j
```

## Minimum Viable Snippet
Expand Down Expand Up @@ -88,6 +88,16 @@ if err = result.Err(); err != nil {
}
```

## Connecting to a causal cluster

You just need to use `bolt+routing` as the URL scheme and set host of the URL to one of your core members of the cluster.

```go
if driver, err = neo4j.NewDriver("bolt+routing://localhost:7687", neo4j.BasicAuth("username", "password", "")); err != nil {
return err // handle error
}
```

There are a few points that need to be highlighted:
* Each `Driver` instance maintains a pool of connections inside, as a result, it is recommended to only use **one driver per application**.
* It is considerably cheap to create new sessions and transactions, as sessions and transactions do not create new connections as long as there are free connections available in the connection pool.
Expand Down Expand Up @@ -143,7 +153,7 @@ The temporal types are introduced in Neo4j 3.4 series.
You can create a 2-dimensional `Point` value using;

```go
point := NewPoint(srId, 1.0, 2.0)
point := NewPoint2D(srId, 1.0, 2.0)
```

or a 3-dimensional `Point` value using;
Expand Down

0 comments on commit c0eb739

Please sign in to comment.