You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GoRethink - RethinkDB Driver for Go [](https://app.wercker.com/project/bykey/e315e764041af8e80f0c68280d4b4de2)[](https://godoc.org/github.com/dancannon/gorethink)
2
+
=====================
4
3
5
4
[Go](http://golang.org/) driver for [RethinkDB](http://www.rethinkdb.com/) made by [Daniel Cannon](http://github.com/dancannon) and based off of Christopher Hesse's [RethinkGo](https://github.com/christopherhesse/rethinkgo) driver.
6
5
7
-
Current supported RethinkDB version: 1.11 | Documentation: [GoDoc](http://godoc.org/github.com/dancannon/gorethink)
6
+
Current version: v0.2 (RethinkDB v1.12)
7
+
8
+
**Version 0.2 introduced some BC breaking changes, for more information check the [change log](CHANGELOG.md)**
8
9
9
10
## Installation
10
11
11
12
```sh
12
13
go get -u github.com/dancannon/gorethink
13
14
```
14
15
15
-
If you do not have the [goprotobuf](https://code.google.com/p/goprotobuf/) runtime installed, it is required:
16
-
17
-
```sh
18
-
brew install mercurial # if you do not have mercurial installed
19
-
go get code.google.com/p/goprotobuf/{proto,protoc-gen-go}
20
-
```
21
-
22
16
## Connection
23
17
24
18
### Basic Connection
@@ -32,15 +26,14 @@ import (
32
26
33
27
varsession *r.Session
34
28
35
-
session, err:= r.Connect(map[string]interface{}{
36
-
"address": "localhost:28015",
37
-
"database": "test",
38
-
"authkey": "14daak1cad13dj",
39
-
})
29
+
session, err:= r.Connect(r.ConnectOpts{
30
+
Address: "localhost:28015",
31
+
Database: "test",
32
+
})
40
33
41
-
if err != nil {
42
-
log.Fatalln(err.Error())
43
-
}
34
+
if err != nil {
35
+
log.Fatalln(err.Error())
36
+
}
44
37
45
38
```
46
39
See the [documentation](http://godoc.org/github.com/dancannon/gorethink#Connect) for a list of supported arguments to Connect().
@@ -56,16 +49,16 @@ import (
56
49
57
50
varsession *r.Session
58
51
59
-
session, err:= r.Connect(map[string]interface{}{
60
-
"address": "localhost:28015",
61
-
"database": "test",
62
-
"maxIdle": 10,
63
-
"idleTimeout": time.Second * 10,
64
-
})
52
+
session, err:= r.Connect(r.ConnectOpts{
53
+
Address: "localhost:28015",
54
+
Database: "test",
55
+
MaxIdle: 10,
56
+
IdleTimeout: time.Second * 10,
57
+
})
65
58
66
-
if err != nil {
67
-
log.Fatalln(err.Error())
68
-
}
59
+
if err != nil {
60
+
log.Fatalln(err.Error())
61
+
}
69
62
```
70
63
71
64
A pre-configured [Pool](http://godoc.org/github.com/dancannon/gorethink#Pool) instance can also be passed to Connect().
0 commit comments