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
QueryExecutorinterface and changed query runner methods (Run/Exec) to accept this type instead of*Session,Sessionwill still be accepted as it implements theQueryExecutorinterface. - Added the
NewMockfunction to create a mock query executor - Queries can be mocked using
OnandReturn,Mockalso 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 onQueryandTerm. - Updated import of
github.com/cenkalti/backofftogithub.com/cenk/backoff
v2.0.4
Changed
- Changed
Connectto 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
Cursormethods 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
UnionWithOptsterm which allowsUnionto be called with optional arguments (such asInterleave) - Added
IncludeOffsetsandIncludeTypesoptional arguments toChangesOpts - Added
Conflictoptional argument toInsertOpts
Fixed
- Fixed error when connecting to database as non-admin user, please note that
DiscoverHostswill 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
HandshakeVersionwhen 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
UsernameandPasswordfields in theConnectOpts. - Added the
Grantterm - Added the
Orderedoptional argument toEqJoin - Added the
Foldterm and examples - Added the
ReadOneandReadAllhelper functions for quickly executing a query and scanning the result into a variable. For examples see the godocs. - Added the
PeekandSkipfunctions to theCursor. - Added support for referential arrays in structs
- Added the
Durabilityargument toRunOpts/ExecOpts
Deprecated
- Deprecated the root
Waitterm,r.Table(...).Wait()should now be used instead. - Deprecated session authentication using
AuthKey
Fixed
- Fixed issue with
ReconfigureOptsfieldPrimaryTag
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
SetTagsfunction which allows GoRethink to override which tags are used when working with structs. For example to support thejsonadd the following callSetTags("gorethink", "json"). - Added helper functions for checking the error type of a write query, this is useful when calling
RunWrite.- Added
IsConflictErrwhich returns true when RethinkDB returns a duplicate key error. - Added
IsTypeErrwhich returns true when RethinkDB returns an unexpected type error.
- Added
- Added the
RawQueryterm which can be used to execute a raw JSON query, for more information about this query see the godoc. - Added the
NextResponsefunction toCursorwhich will return the next raw JSON response in the result set. - Added ability to set the keep alive period by setting the
KeepAlivePeriodfield 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
RqlConnectionErrorwhen callingRun,ExecorRunWrite. - Fixed potential dead lock in connection code caused when building the query.