Skip to content

Releases: rethinkdb/rethinkdb-go

v2.1.0

26 Jun 19:10
Compare
Choose a tag to compare

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 the QueryExecutor interface.
    • Added the NewMock function to create a mock query executor
    • Queries can be mocked using On and Return, 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.

Changed

  • Exported the Build() function on Query and Term.
  • Updated import of github.com/cenkalti/backoff to github.com/cenk/backoff

v2.0.4

24 May 19:42
Compare
Choose a tag to compare

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

24 May 19:42
Compare
Choose a tag to compare

Added

  • Added constants for system database and table names.

Changed

  • Re-enabled keep alive by default.

v2.0.2

18 Apr 20:09
Compare
Choose a tag to compare

Fixed

  • Fixed issue which prevented anonymous time.Time values from being encoded when used in a struct.
  • Fixed panic when attempting to run a query with a nil session

v2.0.1

14 Apr 19:30
Compare
Choose a tag to compare

Added

  • Added UnionWithOpts term which allows Union to be called with optional arguments (such as Interleave)
  • Added IncludeOffsets and IncludeTypes optional arguments to ChangesOpts
  • Added Conflict optional argument to InsertOpts

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

13 Apr 19:19
Compare
Choose a tag to compare

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 and Password fields in the ConnectOpts.
  • Added the Grant term
  • Added the Ordered optional argument to EqJoin
  • Added the Fold term and examples
  • Added the ReadOne and ReadAll helper functions for quickly executing a query and scanning the result into a variable. For examples see the godocs.
  • Added the Peek and Skip functions to the Cursor.
  • Added support for referential arrays in structs
  • Added the Durability argument to RunOpts/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 field PrimaryTag

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

16 Apr 00:04
Compare
Choose a tag to compare

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

15 Mar 21:11
Compare
Choose a tag to compare

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 the json add the following call SetTags("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 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 to Cursor 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 in ConnectOpts.

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 calling Run, Exec or RunWrite.
  • Fixed potential dead lock in connection code caused when building the query.

v1.3.2

01 Feb 22:26
Compare
Choose a tag to compare

Fixed

Fixed race condition in cursor which caused issues when closing a cursor that is in the process of fetching data.

v1.3.1

22 Jan 21:48
Compare
Choose a tag to compare

Added

  • Added more documentation and examples for GetAll.

Fixed

  • Fixed RunWrite not defering its call to Cursor.Close(). This could cause issues if an error occurred when decoding the result.
  • Fixed panic when calling Error() on a GoRethink rqlError.