Skip to content

Commit 465af7f

Browse files
committed
Merge branch 'hotfix/v1.1.1'
2 parents cff081d + 29dadc8 commit 465af7f

File tree

6 files changed

+17
-10
lines changed

6 files changed

+17
-10
lines changed

Diff for: CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
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+
## v1.1.1
6+
### Fixed
7+
- Corrected protobuf import
8+
- Fixed documentation
9+
- Fixed issues with time pseudotype conversion that caused issues with milliseconds
10+
511
## v1.1.0
612
### Added
713
- Replaced `UseOutdated` with `ReadMode`

Diff for: README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# GoRethink - RethinkDB Driver for Go
22

3-
**Driver does not currently support RethinkDB 2.1, update coming soon!**
4-
53
[![GitHub tag](https://img.shields.io/github/tag/dancannon/gorethink.svg?style=flat)](https://github.com/dancannon/gorethink/releases)
64
[![GoDoc](https://godoc.org/github.com/dancannon/gorethink?status.png)](https://godoc.org/github.com/dancannon/gorethink)
75
[![build status](https://img.shields.io/travis/dancannon/gorethink/master.svg "build status")](https://travis-ci.org/dancannon/gorethink)
@@ -10,7 +8,7 @@
108

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

13-
Current version: v1.1.0 (RethinkDB v2.1)
11+
Current version: v1.1.1 (RethinkDB v2.1)
1412

1513
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).
1614

@@ -188,7 +186,7 @@ if err != nil {
188186
}
189187
```
190188

191-
## Encoding/Decoding Structs
189+
## Encoding/Decoding
192190
When passing structs to Expr(And functions that use Expr such as Insert, Update) the structs are encoded into a map before being sent to the server. Each exported field is added to the map unless
193191

194192
- the field's tag is "-", or
@@ -215,6 +213,8 @@ Field int `gorethink:",omitempty"`
215213

216214
**NOTE:** It is strongly recommended that struct tags are used to explicitly define the mapping between your Go type and how the data is stored by RethinkDB. This is especially important when using an `Id` field as by default RethinkDB will create a field named `id` as the primary key (note that the RethinkDB field is lowercase but the Go version starts with a capital letter).
217215

216+
When encoding maps with non-string keys the key values are automatically converted to strings where possible, however it is recommended that you use strings where possible (for example `map[string]T`).
217+
218218
## Benchmarks
219219

220220
Everyone wants their project's benchmarks to be speedy. And while we know that rethinkDb and the gorethink driver are quite fast, our primary goal is for our benchmarks to be correct. They are designed to give you, the user, an accurate picture of writes per second (w/s). If you come up with a accurate test that meets this aim, submit a pull request please.

Diff for: doc.go

+1-1
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: v1.1.0 (RethinkDB v2.1)
3+
// Current version: v1.1.1 (RethinkDB v2.1)
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

Diff for: pseudotypes.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,9 @@ func recursivelyConvertPseudotype(obj interface{}, opts map[string]interface{})
125125

126126
func reqlTimeToNativeTime(timestamp float64, timezone string) (time.Time, error) {
127127
sec, ms := math.Modf(timestamp)
128-
129-
t := time.Unix(int64(sec), int64(ms*1000*1000*1000))
128+
129+
// Convert to native time rounding to milliseconds
130+
t := time.Unix(int64(sec), int64(math.Floor(ms*1000+0.5))*1000*1000)
130131

131132
// Caclulate the timezone
132133
if timezone != "" {

Diff for: ql2/ql2.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: query_time_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ func (s *RethinkSuite) TestTimeTime(c *test.C) {
1818

1919
func (s *RethinkSuite) TestTimeTimeMillisecond(c *test.C) {
2020
var response time.Time
21-
res, err := Time(1986, 11, 3, 12, 30, 15.679, "Z").Run(session)
21+
res, err := Time(1986, 11, 3, 12, 30, 15.6790123, "Z").Run(session)
2222
c.Assert(err, test.IsNil)
2323

2424
err = res.One(&response)
2525
c.Assert(err, test.IsNil)
26-
c.Assert(response.Equal(time.Date(1986, 11, 3, 12, 30, 15, 679.00002*1000*1000, time.UTC)), test.Equals, true)
26+
c.Assert(response.Equal(time.Date(1986, 11, 3, 12, 30, 15, 679*1000*1000, time.UTC)), test.Equals, true)
2727
}
2828

2929
func (s *RethinkSuite) TestTimeEpochTime(c *test.C) {

0 commit comments

Comments
 (0)