Releases: rethinkdb/rethinkdb-go
Releases · rethinkdb/rethinkdb-go
v2.1.0
Added
- Added ability to mock queries based on the library github.com/stretchr/testify
- Added the
QueryExecutor
interface and changed query runner methods (Run
/Exec
) to accept this type instead of*Session
,Session
will still be accepted as it implements theQueryExecutor
interface. - Added the
NewMock
function to create a mock query executor - Queries can be mocked using
On
andReturn
,Mock
also contains functions for asserting that the required mocked queries were executed. - For more information about how to mock queries see the readme and tests in
mock_test.go
.
- Added the
Changed
- Exported the
Build()
function onQuery
andTerm
. - Updated import of
github.com/cenkalti/backoff
togithub.com/cenk/backoff
v2.0.4
Changed
- Changed
Connect
to return the reason for connections failing (instead of just "no connections were made when creating the session")
Fixed
- Fixed queries not being retried when using
Query()
, queries are now retried if the request failed due to a bad connection. - Fixed
Cursor
methods panicking if using a nil cursor, please note that you should still always check if your queries return an error.
v2.0.3
v2.0.2
v2.0.1
Added
- Added
UnionWithOpts
term which allowsUnion
to be called with optional arguments (such asInterleave
) - Added
IncludeOffsets
andIncludeTypes
optional arguments toChangesOpts
- Added
Conflict
optional argument toInsertOpts
Fixed
- Fixed error when connecting to database as non-admin user, please note that
DiscoverHosts
will not work with user authentication at this time due to the fact that RethinkDB restricts access to the required system tables.
v2.0.0
Changed
- 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:
r.Connect(
...
HandshakeVersion: r.HandshakeV0_4,
...
)
Added
- Added support for username/password authentication. To login pass your username and password when creating a session using the
Username
andPassword
fields in theConnectOpts
. - Added the
Grant
term - Added the
Ordered
optional argument toEqJoin
- Added the
Fold
term and examples - Added the
ReadOne
andReadAll
helper functions for quickly executing a query and scanning the result into a variable. For examples see the godocs. - Added the
Peek
andSkip
functions to theCursor
. - Added support for referential arrays in structs
- Added the
Durability
argument toRunOpts
/ExecOpts
Deprecated
- Deprecated the root
Wait
term,r.Table(...).Wait()
should now be used instead. - Deprecated session authentication using
AuthKey
Fixed
- Fixed issue with
ReconfigureOpts
fieldPrimaryTag
Thanks to all contributors who helped out with this release, especially @rschmukler and @russmatney for spending the time to work with me on fixing some of the more difficult issues in this release.
v1.4.1
Fixed
- Fixed panic when closing a connection at the same time as using a changefeed.
- Update imports to correctly use gopkg.in
- Fixed race condition when using anonymous functions
- Fixed IsConflictErr and IsTypeErr panicking when passed nil errors
- RunWrite no longer misformats errors with formatting directives in them
v1.4.0
Added
- Added the ability to reference subdocuments when inserting new documents, for more information see the documentation in the readme.
- Added the
SetTags
function which allows GoRethink to override which tags are used when working with structs. For example to support thejson
add the following callSetTags("gorethink", "json")
. - Added helper functions for checking the error type of a write query, this is useful when calling
RunWrite
.- Added
IsConflictErr
which returns true when RethinkDB returns a duplicate key error. - Added
IsTypeErr
which returns true when RethinkDB returns an unexpected type error.
- Added
- Added the
RawQuery
term which can be used to execute a raw JSON query, for more information about this query see the godoc. - Added the
NextResponse
function toCursor
which will return the next raw JSON response in the result set. - Added ability to set the keep alive period by setting the
KeepAlivePeriod
field inConnectOpts
.
Fixed
- Fixed an issue that could prevent bad connections from being removed from the connection pool.
- Fixed certain connection errors not being returned as
RqlConnectionError
when callingRun
,Exec
orRunWrite
. - Fixed potential dead lock in connection code caused when building the query.