Skip to content

Commit 5d7f081

Browse files
committed
Merge tag 'v1.0.0-rc.1' into develop
Released v1.0.0-rc.1
2 parents b8c3d58 + d5ad40c commit 5d7f081

10 files changed

+42
-35
lines changed

CHANGELOG.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,14 @@
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-
## Unreleased
6-
5+
## v1.0.0-RC.1 - 2015-06-07
76
In an attempt to make this library more "idiomatic" some functions have been renamed, for the full list of changes see below.
87

98
### Added
109
- Added more documentation.
1110
- Added `Shards`, `Replicas` and `PrimaryReplicaTag` optional arguments in `TableCreateOpts`.
1211
- Added `MultiGroup` and `MultiGroupByIndex` which are equivalent to the running `group` with the `multi` optional argument set to true.
1312

14-
### Fixed
15-
- Fixed issue causing inconsistent results when unmarshaling query response into structs (#192)
16-
- Fixed issue causing errors when closing a changefeed cursor (#191)
17-
1813
### Changed
1914
- Renamed `Db` to `DB`.
2015
- Renamed `DbCreate` to `DBCreate`.
@@ -32,11 +27,12 @@ In an attempt to make this library more "idiomatic" some functions have been ren
3227
- Renamed `WriteChanges` to `ChangeResponse`, this is now a general type and can be used when dealing with changefeeds.
3328
- Removed depth limit when encoding values using `Expr`
3429

35-
## Fixed
30+
### Fixed
31+
- Fixed issue causing inconsistent results when unmarshaling query response into structs (#192)
32+
- Fixed issue causing errors when closing a changefeed cursor (#191)
3633
- Fixed issue causing nodes to remain unhealthy when host discovery is disabled (#195)
3734

3835
### Removed
39-
4036
- Removed `CacheSize` and `DataCenter` optional arguments in `TableCreateOpts`.
4137
- Removed `CacheSize` optional argument from `InsertOpts`
4238

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[Go](http://golang.org/) driver for [RethinkDB](http://www.rethinkdb.com/)
88

99

10-
Current version: v0.7.2 (RethinkDB v2.0)
10+
Current version: v1.0.0-RC.1 (RethinkDB v2.0)
1111

1212
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).
1313

cursor.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"encoding/json"
55
"errors"
66
"reflect"
7+
"sync/atomic"
78

89
"github.com/dancannon/gorethink/encoding"
910
p "github.com/dancannon/gorethink/ql2"

doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Package gorethink implements a Go driver for RethinkDB
22
//
3-
// Current version: v0.7.2 (RethinkDB v2.0)
3+
// Current version: v1.0.0-rc.1 (RethinkDB v2.0)
44
// For more in depth information on how to use RethinkDB check out the API docs
55
// at http://rethinkdb.com/api
66
package gorethink

example_query_control_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func ExampleTerm_Default() {
6262
}
6363

6464
// Convert a Go integer to a ReQL object
65-
func ExampleExpr_Int() {
65+
func ExampleExpr_int() {
6666
cur, err := Expr(1).Run(session)
6767
if err != nil {
6868
fmt.Print(err)
@@ -82,7 +82,7 @@ func ExampleExpr_Int() {
8282
}
8383

8484
// Convert a Go slice to a ReQL object
85-
func ExampleExpr_Slice() {
85+
func ExampleExpr_slice() {
8686
cur, err := Expr([]int{1, 2, 3}).Run(session)
8787
if err != nil {
8888
fmt.Print(err)
@@ -107,7 +107,7 @@ func ExampleExpr_Slice() {
107107
}
108108

109109
// Convert a Go slice to a ReQL object
110-
func ExampleExpr_Map() {
110+
func ExampleExpr_map() {
111111
cur, err := Expr(map[string]interface{}{
112112
"a": 1,
113113
"b": "b",
@@ -134,7 +134,7 @@ func ExampleExpr_Map() {
134134
}
135135

136136
// Convert a Go slice to a ReQL object
137-
func ExampleExpr_Struct() {
137+
func ExampleExpr_struct() {
138138
type ExampleTypeNested struct {
139139
N int
140140
}
@@ -188,7 +188,7 @@ func ExampleExpr_Struct() {
188188

189189
// Convert a Go struct (with gorethink tags) to a ReQL object. The tags allow
190190
// the field names to be changed.
191-
func ExampleExpr_StructTags() {
191+
func ExampleExpr_structTags() {
192192
type ExampleType struct {
193193
A int `gorethink:"field_a"`
194194
B string `gorethink:"field_b"`

example_query_manipulation_test.go

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

77
// Get john's age
8-
func ExampleField() {
8+
func ExampleTerm_Field() {
99
cur, err := DB("examples").Table("users").Get("john").Field("age").Run(session)
1010
if err != nil {
1111
fmt.Print(err)

example_query_select_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func ExampleTerm_Get() {
3131
}
3232

3333
// Find a document and merge another document with it.
34-
func ExampleTerm_Get_Merge() {
34+
func ExampleTerm_Get_merge() {
3535
// Fetch the row from the database
3636
res, err := DB("examples").Table("heroes").Get(4).Merge(map[string]interface{}{
3737
"powers": []string{"speed"},
@@ -83,7 +83,7 @@ func ExampleTerm_Filter() {
8383
}
8484

8585
// Get all users who are more than 25 years old.
86-
func ExampleTerm_Filter_Row() {
86+
func ExampleTerm_Filter_row() {
8787
// Fetch the row from the database
8888
res, err := DB("examples").Table("users").Filter(Row.Field("age").Gt(25)).Run(session)
8989
if err != nil {
@@ -105,7 +105,7 @@ func ExampleTerm_Filter_Row() {
105105
}
106106

107107
// Retrieve all users who have a gmail account (whose field email ends with @gmail.com).
108-
func ExampleTerm_Filter_Function() {
108+
func ExampleTerm_Filter_function() {
109109
// Fetch the row from the database
110110
res, err := DB("examples").Table("users").Filter(func(user Term) Term {
111111
return user.Field("email").Match("@gmail.com$")

example_query_transformation_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func ExampleTerm_Map() {
2828
}
2929

3030
// Sum the elements of three sequences.
31-
func ExampleMap_MultipleSequences() {
31+
func ExampleMap_multipleSequences() {
3232
var sequence1 = []int{100, 200, 300, 400}
3333
var sequence2 = []int{10, 20, 30, 40}
3434
var sequence3 = []int{1, 2, 3, 4}
@@ -55,7 +55,7 @@ func ExampleMap_MultipleSequences() {
5555
}
5656

5757
// Order all the posts using the index date.
58-
func ExampleTerm_OrderBy_Index() {
58+
func ExampleTerm_OrderBy_index() {
5959
cur, err := DB("examples").Table("posts").OrderBy(OrderByOpts{
6060
Index: "date",
6161
}).Run(session)
@@ -75,7 +75,7 @@ func ExampleTerm_OrderBy_Index() {
7575
}
7676

7777
// Order all the posts using the index date in descending order.
78-
func ExampleTerm_OrderBy_IndexDesc() {
78+
func ExampleTerm_OrderBy_indexDesc() {
7979
cur, err := DB("examples").Table("posts").OrderBy(OrderByOpts{
8080
Index: Desc("date"),
8181
}).Run(session)
@@ -96,7 +96,7 @@ func ExampleTerm_OrderBy_IndexDesc() {
9696

9797
// You can efficiently order using multiple fields by using a compound index.
9898
// For example order by date and title.
99-
func ExampleTerm_OrderBy_Compound() {
99+
func ExampleTerm_OrderBy_compound() {
100100
cur, err := DB("examples").Table("posts").OrderBy(OrderByOpts{
101101
Index: Desc("dateAndTitle"),
102102
}).Run(session)
@@ -117,7 +117,7 @@ func ExampleTerm_OrderBy_Compound() {
117117

118118
// If you have a sequence with fewer documents than the arrayLimit, you can order
119119
// it by multiple fields without an index.
120-
func ExampleTerm_OrderBy_Multiple() {
120+
func ExampleTerm_OrderBy_multiple() {
121121
cur, err := DB("examples").Table("posts").OrderBy(
122122
"title",
123123
OrderByOpts{Index: Desc("date")},
@@ -140,7 +140,7 @@ func ExampleTerm_OrderBy_Multiple() {
140140
// Notice that an index ordering always has highest precedence. The following
141141
// query orders posts by date, and if multiple posts were published on the same
142142
// date, they will be ordered by title.
143-
func ExampleTerm_OrderBy_MultipleWithIndex() {
143+
func ExampleTerm_OrderBy_multipleWithIndex() {
144144
cur, err := DB("examples").Table("posts").OrderBy(
145145
"title",
146146
OrderByOpts{Index: Desc("date")},

example_query_write_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
)
66

77
// Insert a document into the table posts using a struct.
8-
func ExampleTerm_Insert_Struct() {
8+
func ExampleTerm_Insert_struct() {
99
type Post struct {
1010
ID int `gorethink:"id"`
1111
Title string `gorethink:"title"`
@@ -30,7 +30,7 @@ func ExampleTerm_Insert_Struct() {
3030

3131
// Insert a document without a defined primary key into the table posts where
3232
// the primary key is id.
33-
func ExampleTerm_Insert_GeneratedKey() {
33+
func ExampleTerm_Insert_generatedKey() {
3434
type Post struct {
3535
Title string `gorethink:"title"`
3636
Content string `gorethink:"content"`
@@ -52,7 +52,7 @@ func ExampleTerm_Insert_GeneratedKey() {
5252
}
5353

5454
// Insert a document into the table posts using a map.
55-
func ExampleTerm_Insert_Map() {
55+
func ExampleTerm_Insert_map() {
5656
resp, err := DB("examples").Table("posts").Insert(map[string]interface{}{
5757
"id": 2,
5858
"title": "Lorem ipsum",
@@ -70,7 +70,7 @@ func ExampleTerm_Insert_Map() {
7070
}
7171

7272
// Insert multiple documents into the table posts.
73-
func ExampleTerm_Insert_Multiple() {
73+
func ExampleTerm_Insert_multiple() {
7474
resp, err := DB("examples").Table("posts").Insert([]interface{}{
7575
map[string]interface{}{
7676
"title": "Lorem ipsum",
@@ -94,7 +94,7 @@ func ExampleTerm_Insert_Multiple() {
9494

9595
// Insert a document into the table posts, replacing the document if it already
9696
// exists.
97-
func ExampleTerm_Insert_Upsert() {
97+
func ExampleTerm_Insert_upsert() {
9898
resp, err := DB("examples").Table("posts").Insert(map[string]interface{}{
9999
"id": 1,
100100
"title": "Lorem ipsum 2",
@@ -129,7 +129,7 @@ func ExampleTerm_Update() {
129129
}
130130

131131
// Update bob's cell phone number.
132-
func ExampleTerm_Update_Nested() {
132+
func ExampleTerm_Update_nested() {
133133
resp, err := DB("examples").Table("users").Get("bob").Update(map[string]interface{}{
134134
"contact": map[string]interface{}{
135135
"phone": "408-555-4242",
@@ -147,7 +147,7 @@ func ExampleTerm_Update_Nested() {
147147
}
148148

149149
// Update the status of all posts to published.
150-
func ExampleTerm_Update_All() {
150+
func ExampleTerm_Update_all() {
151151
resp, err := DB("examples").Table("posts").Update(map[string]interface{}{
152152
"status": "published",
153153
}).RunWrite(session)
@@ -164,7 +164,7 @@ func ExampleTerm_Update_All() {
164164

165165
// Increment the field view of the post with id of 1. If the field views does not
166166
// exist, it will be set to 0.
167-
func ExampleTerm_Update_Increment() {
167+
func ExampleTerm_Update_increment() {
168168
resp, err := DB("examples").Table("posts").Get(1).Update(map[string]interface{}{
169169
"views": Row.Field("views").Add(1).Default(0),
170170
}).RunWrite(session)
@@ -180,7 +180,7 @@ func ExampleTerm_Update_Increment() {
180180
}
181181

182182
// Update the status of the post with id of 1 using soft durability.
183-
func ExampleTerm_Update_SoftDurability() {
183+
func ExampleTerm_Update_softDurability() {
184184
resp, err := DB("examples").Table("posts").Get(2).Update(map[string]interface{}{
185185
"status": "draft",
186186
}, UpdateOpts{
@@ -212,7 +212,7 @@ func ExampleTerm_Delete() {
212212
}
213213

214214
// Delete all comments where the field status is published
215-
func ExampleTerm_Delete_Many() {
215+
func ExampleTerm_Delete_many() {
216216
resp, err := DB("examples").Table("posts").Filter(map[string]interface{}{
217217
"status": "published",
218218
}).Delete().RunWrite(session)

example_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ import (
55
)
66

77
func Example() {
8+
session, err := Connect(ConnectOpts{
9+
Address: url,
10+
})
11+
if err != nil {
12+
log.Fatalln(err.Error())
13+
}
14+
815
res, err := Expr("Hello World").Run(session)
916
if err != nil {
1017
log.Fatalln(err.Error())
@@ -17,4 +24,7 @@ func Example() {
1724
}
1825

1926
fmt.Println(response)
27+
28+
// Output:
29+
// Hello World
2030
}

0 commit comments

Comments
 (0)