Skip to content

Commit ca0916a

Browse files
committed
Merge branch 'release/v2.0.0'
2 parents edc7a6a + 3ccfe40 commit ca0916a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1101
-249
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ go:
66

77
cache: apt
88

9+
go_import_path: gopkg.in/dancannon/gorethink.v2
10+
911
before_script:
1012
- source /etc/lsb-release && echo "deb http://download.rethinkdb.com/apt $DISTRIB_CODENAME main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list
1113
- wget -qO- http://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add -

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,36 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## v2.0.0 - 2016-04-13g
6+
7+
### Changed
8+
9+
- GoRethink now uses the v1.0 RethinkDB protocol which supports RethinkDB v2.3 and above. If you are using RethinkDB 2.2 or older please set `HandshakeVersion` when creating a session. For example:
10+
```go
11+
r.Connect(
12+
...
13+
HandshakeVersion: r.HandshakeV0_4,
14+
...
15+
)
16+
```
17+
18+
### Added
19+
- Added support for username/password authentication. To login pass your username and password when creating a session using the `Username` and `Password` fields in the `ConnectOpts`.
20+
- Added the `Grant` term
21+
- Added the `Ordered` optional argument to `EqJoin`
22+
- Added the `Fold` term and examples
23+
- Added the `ReadOne` and `ReadAll` helper functions for quickly executing a query and scanning the result into a variable. For examples see the godocs.
24+
- Added the `Peek` and `Skip` functions to the `Cursor`.
25+
- Added support for referential arrays in structs
26+
- Added the `Durability` argument to `RunOpts`/`ExecOpts`
27+
28+
### Deprecated
29+
- Deprecated the root `Wait` term, `r.Table(...).Wait()` should now be used instead.
30+
- Deprecated session authentication using `AuthKey`
31+
32+
### Fixed
33+
- Fixed issue with `ReconfigureOpts` field `PrimaryTag`
34+
535
## v1.4.1 - 2016-04-02
636

737
### Fixed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
![GoRethink Logo](https://raw.github.com/wiki/dancannon/gorethink/gopher-and-thinker-s.png "Golang Gopher and RethinkDB Thinker")
1010

11-
Current version: v1.4.1 (RethinkDB v2.2)
11+
Current version: v2.0.0 (RethinkDB v2.3)
1212

1313
Please note that this version of the driver only supports versions of RethinkDB using the v0.4 protocol (any versions of the driver older than RethinkDB 2.0 will not work).
1414

@@ -22,7 +22,7 @@ go get -u github.com/dancannon/gorethink
2222

2323
Or (pinned to the v1.x.x tag)
2424
```
25-
go get gopkg.in/dancannon/gorethink.v1
25+
go get gopkg.in/dancannon/gorethink.v2
2626
```
2727

2828
## Connection

checkers_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66

77
test "gopkg.in/check.v1"
88

9-
"gopkg.in/dancannon/gorethink.v1/types"
9+
"gopkg.in/dancannon/gorethink.v2/types"
1010
)
1111

1212
type jsonChecker struct {

connection.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"sync/atomic"
1010
"time"
1111

12-
p "gopkg.in/dancannon/gorethink.v1/ql2"
12+
p "gopkg.in/dancannon/gorethink.v2/internal/ql2"
1313
)
1414

1515
const (
@@ -63,16 +63,14 @@ func NewConnection(address string, opts *ConnectOpts) (*Connection, error) {
6363
return nil, RQLConnectionError{rqlError(err.Error())}
6464
}
6565

66-
// Send handshake request
67-
if err = c.writeHandshakeReq(); err != nil {
68-
c.Close()
69-
return nil, RQLConnectionError{rqlError(err.Error())}
70-
}
71-
// Read handshake response
72-
err = c.readHandshakeSuccess()
66+
// Send handshake
67+
handshake, err := c.handshake(opts.HandshakeVersion)
7368
if err != nil {
74-
c.Close()
75-
return nil, RQLConnectionError{rqlError(err.Error())}
69+
return nil, err
70+
}
71+
72+
if err = handshake.Send(); err != nil {
73+
return nil, err
7674
}
7775

7876
return c, nil

0 commit comments

Comments
 (0)