gopkg.in/rethinkdb/rethinkdb-go.v6@v6.2.2/CHANGELOG.md (about)

     1  # Change Log
     2  All notable changes to this project will be documented in this file.
     3  This project adheres to [Semantic Versioning](http://semver.org/).
     4  
     5  ## v6.2.1 - 2020-03-19
     6  
     7  - Revert backoff v4 for gopath compatibility
     8  
     9  ## v6.2.0 - 2020-03-18
    10  
    11  - Backoff v4
    12  - Reworked cluster discovery
    13  - Fix rare connection goroutine leak
    14  
    15  ## v6.1.0 - 2020-03-09
    16  
    17  - Reworked and tested new connection pools with multiple queries per connection
    18  - Socket Read- and WriteTimeout replaced with context timeout
    19  - Mock assert fix
    20  - Connection pool fixed initial size
    21  - Changes added offsets
    22  
    23  ## v6.0.0 - 2019-12-22
    24  
    25  - 2.4 RethinkDB support
    26  - Added JSON tags to ConnectOpts to make it serializable
    27  - Blocking mocks for responses
    28  - Fix Connect documentation
    29  - Added Type to ChangeResponse
    30  - Added bitwise operations support
    31  - Added write hooks support
    32  
    33  ## v5.0.1 - 2018-10-18
    34  
    35  - Fix noreply queries memory leak due unnecessary for responses
    36  
    37  ## v5.0.0 - 2018-09-12
    38  
    39  - Moved to rethinkdb organization
    40  - Renamed to rethinkdb-go repo
    41  - Renamed to rethinkdb package
    42  
    43  ## v4.1.0 - 2018-08-29
    44  
    45  ### Fixed
    46  
    47   - Rare `Connection` leaks if socket errors occurred
    48   - Updated `ql2.proto` file from rethinkdb repo
    49   
    50  ### Added
    51  
    52   - Support for independent custom type marshalers 
    53  
    54  ## v4.0.0 - 2017-12-14
    55  
    56  ### Fixed
    57  
    58   - `Connection` work with sockets, now only a single goroutine reads from socket.
    59   - Optimized threadsafe operations in `Connection` with channels and atomics instead of mutex.
    60   - All tests with real db moved to integration folder
    61  
    62  ### Added
    63  
    64   - Added support for tracing with `opentracing-go`
    65   - Added a brand-new unit tests for `Connection` 
    66  
    67  ## v3.0.5 - 2017-09-28
    68  
    69  - Fixed typo at http opts
    70  
    71  ## v3.0.4 - 2017-09-04
    72  
    73  - Fixed default context timeout if one of config's timeout os omitted
    74  
    75  ## v3.0.3 - 2017-09-03
    76  
    77  - Added support to cancellation queries and timeouts with `context.Context` passed through `RunOpts`
    78  - Fixed import path for `sirupsen/logrus` due to repo was renamed
    79  
    80  ## v3.0.2 - 2017-04-16
    81  
    82  ### Changed
    83  
    84  - Updated Go versions used by CI
    85  
    86  ### Fixed
    87  
    88  - Fixed performance issue caused by lock contention in `IsConnected` (thanks to @ekle)
    89  
    90  ## v3.0.1 - 2016-01-30
    91  
    92  ### Fixed
    93  
    94   - Fixed import paths
    95   - Updated Go version used by Travis
    96  
    97  ## v3.0.0 - 2016-12-06
    98  
    99  Unfortunately this will likely be the last release I plan to work on. This is due to the following reasons:
   100  
   101   - Over the last few years while I have spent a lot of time maintaining this driver I have not used it very much for my own personal projects.
   102   - My job has been keeping me very busy lately and I don't have as much time to work on this project as I used to.
   103   - The company behind RethinkDB has shut down and while I am sure the community will keep the database going it seems like a good time for me to step away from the project.
   104   - The driver itself is in a relatively good condition and many companies are using the existing version in production.
   105  
   106  I hope you understand my decision to step back from the project, if you have any questions or would be interested in take over some of the maintenance of the project please let me know. To make this process easier I have also decided to move the repository to the RethinkDB-go organisation. All existing imports _should_ still work.
   107  
   108  Thanks to everybody who got involved with this project over the last ~4 years and helped out, I have truly enjoyed the time I have spent building this library and I hope both RethinkDB and this driver manage to keep going.
   109  
   110  ### Changed
   111  
   112   - Moved project to `gorethink` organisation
   113   - Fixed behaviour when unmarshaling nil slices
   114  
   115  ### Fixed
   116  
   117   - Fix possible deadlock when calling `Session.Reconnect`
   118   - Fixed another bug with panic/infinite loop when closing cursor during reads
   119   - Fixed goroutine leak when calling `Session.Close`
   120  
   121  ## v2.2.2 - 2016-09-25
   122  
   123  ### Changed
   124  
   125   - The `gorethink` struct tag is now always checked even after calling `SetTags`
   126  
   127  ### Fixed
   128  
   129   - Fixed infinite loop in cursor when closed during read
   130  
   131  ## v2.2.1 - 2016-09-18
   132  
   133  ### Added
   134  
   135   - Added `State` and `Error` to `ChangeResponse`
   136  
   137  ### Fixed
   138  
   139   - Fixed panic caused by cursor trying to read outstanding responses while closed
   140   - Fixed panic when using mock session
   141  
   142  ## v2.2.0 - 2016-08-16
   143  
   144  ### Added
   145  
   146   - Added support for optional arguments to `r.JS()`
   147   - Added `NonVotingReplicaTags` optional argument to `TableCreateOpts`
   148   - Added root term `TypeOf`, previously only the method term was supported
   149   - Added root version of `Group` terms (`Group`, `GroupByIndex`, `MultiGroup`, `MultiGroupByIndex`)
   150   - Added root version of `Distinct`
   151   - Added root version of `Contains`
   152   - Added root version of `Count`
   153   - Added root version of `Sum`
   154   - Added root version of `Avg`
   155   - Added root version of `Min`
   156   - Added root version of `MinIndex`
   157   - Added root version of `Max`
   158   - Added root version of `MaxIndex`
   159   - Added `ReadMode` to `RunOpts`
   160   - Added the `Interface` function to the `Cursor` which returns a queries result set as an `interface{}`
   161   - Added `GroupOpts` type
   162   - Added `GetAllOpts` type
   163   - Added `MinOpts`/`MaxOpts` types
   164   - Added `OptArgs` method to `Term` which allows optional arguments to be specified in an alternative way, for example:
   165  
   166  ```go
   167  r.DB("examples").Table("heroes").GetAll("man_of_steel").OptArgs(r.GetAllOpts{
   168      Index: "code_name",
   169  })
   170  ```
   171   
   172   - Added ability to create compound keys from structs, for example:
   173  
   174  ```
   175  type User struct {
   176    Company string `rethinkdb:"id[0]"`
   177    Name    string `rethinkdb:"id[1]"`
   178    Age     int    `rethinkdb:"age"`
   179  }
   180  // Creates
   181  {"id": [COMPANY, NAME], "age": AGE}
   182  ```
   183  
   184   - Added `Merge` function to `encoding` package that decodes data into a value without zeroing it first.
   185   - Added `MockAnything` functions to allow mocking of only part of a query (Thanks to @pzduniak)
   186  
   187  ### Changed
   188  
   189   - Renamed `PrimaryTag` to `PrimaryReplicaTag` in `ReconfigureOpts`
   190   - Renamed `NotAtomic` to `NonAtomic` in `ReplaceOpts` and `UpdateOpts`
   191   - Changed behaviour of function callbacks to allow arguments to be either of type `r.Term` or `interface {}` instead of only `r.Term`
   192   - Changed logging to be disabled by default, to enable logs change the output writer of the logger. For example: `r.Log.Out = os.Stderr`
   193  
   194  ### Fixed
   195  
   196   - Fixed `All` not working correctly when the cursor is created by `Mock`
   197   - Fixed `Mock` not matching queries containing functions
   198   - Fixed byte arrays not being correctly converted to the BINARY pseudo-type
   199  
   200  ## v2.1.3 - 2016-08-01
   201  
   202  ### Changed
   203  
   204   - Changed behaviour of function callbacks to allow arguments to be either of type `r.Term` or `interface {}` instead of only `r.Term`
   205  
   206  ### Fixed
   207  
   208   - Fixed incorrectly named `Replicas` field in `TableCreateOpts`
   209   - Fixed broken optional argument `FinalEmit` in `FoldOpts`
   210   - Fixed bug causing some queries using `r.Row` to fail with the error `Cannot use r.row in nested queries.`
   211   - Fixed typos in `ConnectOpt` field (and related functions) `InitialCap`.
   212  
   213  ## v2.1.2 - 2016-07-22
   214  
   215  ### Added
   216  
   217   - Added the `InitialCap` field to `ConnectOpts` to replace `MaxIdle` as the name no longer made sense.
   218  
   219  ### Changed
   220  
   221   - Improved documentation of ConnectOpts
   222   - Default value for `KeepAlivePeriod` changed from `0` to `30s`
   223  
   224  ### Deprecated
   225  
   226   - Deprecated the field `MaxIdle` in `ConnectOpts`, it has now been replaced by `InitialCap` which has the same behaviour as before. Setting both fields will still work until the field is removed in a future version.
   227  
   228  ### Fixed
   229  
   230   - Fixed issue causing changefeeds to hang if no data was received
   231  
   232  ## v2.1.1 - 2016-07-12
   233  
   234   - Added `session.Database()` which returns the current default database
   235  
   236  ### Changed
   237   - Added more documentation
   238  
   239  ### Fixed
   240   - Fixed `Random()` not being implemented correctly and added tests (Thanks to @bakape for the PR)
   241  
   242  ## v2.1.0 - 2016-06-26
   243  
   244  ### Added
   245  
   246   - Added ability to mock queries based on the library github.com/stretchr/testify
   247       + 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.
   248       + Added the `NewMock` function to create a mock query executor
   249       + Queries can be mocked using `On` and `Return`, `Mock` also contains functions for asserting that the required mocked queries were executed.
   250       + For more information about how to mock queries see the readme and tests in `mock_test.go`.
   251  
   252  ## Changed
   253  
   254  - Exported the `Build()` function on `Query` and `Term`.
   255  - Updated import of `github.com/cenkalti/backoff` to `github.com/cenk/backoff`
   256  
   257  ## v2.0.4 - 2016-05-22
   258  
   259  ### Changed
   260   - Changed `Connect` to return the reason for connections failing (instead of just "no connections were made when creating the session")
   261   - Changed how queries are retried internally, previously when a query failed due to an issue with the connection a new connection was picked from the connection pool and the query was retried, now the driver will attempt to retry the query with a new host (and connection). This should make applications connecting to a multi-node cluster more reliable.
   262  
   263  ### Fixed
   264   - Fixed queries not being retried when using `Query()`, queries are now retried if the request failed due to a bad connection.
   265   - Fixed `Cursor` methods panicking if using a nil cursor, please note that you should still always check if your queries return an error.
   266  
   267  ## v2.0.3 - 2016-05-12
   268  
   269  ### Added
   270   - Added constants for system database and table names.
   271  
   272  ### Changed
   273   - Re-enabled keep alive by default.
   274  
   275  ## v2.0.2 - 2016-04-18
   276  
   277  ### Fixed
   278   - Fixed issue which prevented anonymous `time.Time` values from being encoded when used in a struct.
   279   - Fixed panic when attempting to run a query with a nil session
   280  
   281  ## v2.0.1 - 2016-04-14
   282  
   283  ### Added
   284   - Added `UnionWithOpts` term which allows `Union` to be called with optional arguments (such as `Interleave`)
   285   - Added `IncludeOffsets` and `IncludeTypes` optional arguments to `ChangesOpts`
   286   - Added `Conflict` optional argument to `InsertOpts`
   287  
   288  ### Fixed
   289   - 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.
   290  
   291  ## v2.0.0 - 2016-04-13
   292  
   293  ### Changed
   294  
   295   - RethinkDB-go 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:
   296  ```go
   297  r.Connect(
   298      ...
   299      HandshakeVersion: r.HandshakeV0_4,
   300      ...
   301  )
   302  ```
   303  
   304  ### Added
   305   - 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`.
   306   - Added the `Grant` term
   307   - Added the `Ordered` optional argument to `EqJoin`
   308   - Added the `Fold` term and examples
   309   - Added the `ReadOne` and `ReadAll` helper functions for quickly executing a query and scanning the result into a variable. For examples see the godocs.
   310   - Added the `Peek` and `Skip` functions to the `Cursor`.
   311   - Added support for referential arrays in structs
   312   - Added the `Durability` argument to `RunOpts`/`ExecOpts`
   313  
   314  ### Deprecated
   315   - Deprecated the root `Wait` term, `r.Table(...).Wait()` should now be used instead.
   316   - Deprecated session authentication using `AuthKey` 
   317  
   318  ### Fixed
   319   - Fixed issue with `ReconfigureOpts` field `PrimaryTag`
   320  
   321  ## v1.4.1 - 2016-04-02
   322  
   323  ### Fixed
   324  
   325   - Fixed panic when closing a connection at the same time as using a changefeed.
   326   - Update imports to correctly use gopkg.in
   327   - Fixed race condition when using anonymous functions
   328   - Fixed IsConflictErr and IsTypeErr panicking when passed nil errors
   329   - RunWrite no longer misformats errors with formatting directives in them
   330  
   331  ## v1.4.0 - 2016-03-15
   332  
   333  ### Added
   334  - Added the ability to reference subdocuments when inserting new documents, for more information see the documentation in the readme.
   335  - Added the `SetTags` function which allows RethinkDB-go to override which tags are used when working with structs. For example to support the `json` add the following call `SetTags("gorethink", "json")`.
   336  - Added helper functions for checking the error type of a write query, this is useful when calling `RunWrite`.
   337      + Added `IsConflictErr` which returns true when RethinkDB returns a duplicate key error.
   338      + Added `IsTypeErr` which returns true when RethinkDB returns an unexpected type error.
   339  - Added the `RawQuery` term which can be used to execute a raw JSON query, for more information about this query see the godoc.
   340  - Added the `NextResponse` function to `Cursor` which will return the next raw JSON response in the result set.
   341  - Added ability to set the keep alive period by setting the `KeepAlivePeriod` field in `ConnectOpts`.
   342  
   343  ### Fixed
   344  - Fixed an issue that could prevent bad connections from being removed from the connection pool.
   345  - Fixed certain connection errors not being returned as `RqlConnectionError` when calling `Run`, `Exec` or `RunWrite`. 
   346  - Fixed potential dead lock in connection code caused when building the query.
   347  
   348  ## v1.3.2 - 2015-02-01
   349  
   350  ### Fixed
   351  - Fixed race condition in cursor which caused issues when closing a cursor that is in the process of fetching data.
   352  
   353  ## v1.3.1 - 2015-01-22
   354  
   355  ### Added
   356   - Added more documentation and examples for `GetAll`.
   357  
   358  ### Fixed
   359  - Fixed `RunWrite` not defering its call to `Cursor.Close()`. This could cause issues if an error occurred when decoding the result.
   360  - Fixed panic when calling `Error()` on a RethinkDB-go `rqlError`.
   361  
   362  ## v1.3.0 - 2016-01-11
   363  
   364  ### Added
   365   - Added new error types, the following error types can now be returned: `RQLClientError`, `RQLCompileError`, `RQLDriverCompileError`, `RQLServerCompileError`, `RQLAuthError`, `RQLRuntimeError`, `RQLQueryLogicError`, `RQLNonExistenceError`, `RQLResourceLimitError`, `RQLUserError`, `RQLInternalError`, `RQLTimeoutError`, `RQLAvailabilityError`, `RQLOpFailedError`, `RQLOpIndeterminateError`, `RQLDriverError`, `RQLConnectionError`. Please note that some other errors can be returned.
   366   - Added `IsConnected` function to `Session`.
   367   
   368  ### Fixed
   369   - Fixed panic when scanning through results caused by incorrect queue implementation.
   370  
   371  ## v1.2.0 - 2015-11-19
   372  ### Added
   373   - Added `UUID` term
   374   - Added `Values` term
   375   - Added `IncludeInitial` and `ChangefeedQueueSize` to `ChangesOpts`
   376   - Added `UseJSONNumber` to `ConnectOpts` which changes the way the JSON unmarshal works when deserializing JSON with interface{}, it's preferred to use json.Number instead float64 as it preserves the original precision.
   377   - Added `HostDecayDuration` to `ConnectOpts` to configure how hosts are selected. For more information see the godoc.
   378  
   379  ### Changed
   380   - Timezones from `time.Time` are now stored in the database, before all times were stored as UTC. To convert a go `time.Time` back to UTC you can call  `t.In(time.UTC)`.
   381   - Improved host selection to use `hailocab/go-hostpool` to select nodes based on recent responses and timings.
   382   - Changed connection pool to use `fatih/pool` instead of a custom connection pool, this has caused some internal API changes and the behaviour of `MaxIdle` and `MaxOpen` has slightly changed. This change was made mostly to make driver maintenance easier.
   383       + `MaxIdle` now configures the initial size of the pool, the name of this field will likely change in the future.
   384       + Not setting `MaxOpen` no longer creates an unbounded connection pool per host but instead creates a pool with a maximum capacity of 2 per host.
   385  
   386  ### Deprecated
   387   - Deprecated the option `NodeRefreshInterval` in `ConnectOpts`
   388   - Deprecated `SetMaxIdleConns` and `SetMaxOpenConns`, these options should now only be set when creating the session.
   389  
   390  ### Fixed
   391   - Fixed some type aliases not being correctly encoded when using `Expr`.
   392  
   393  ## v1.1.4 - 2015-10-02
   394  ### Added
   395   - Added root table terms (`r.TableCreate`, `r.TableList` and `r.TableDrop`)
   396  
   397  ### Removed
   398   - Removed `ReadMode` option from `RunOpts` and `ExecOpts` (incorrectly added in v1.1.0)
   399  
   400  ### Fixed 
   401   - Fixed `Decode` no longer setting pointer to nil on document not found
   402   - Fixed panic when `fetchMore` returns an error
   403   - Fixed deadlock when closing changefeed
   404   - Fixed stop query incorrectly waiting for response
   405   - Fixed pointers not to be properly decoded
   406  
   407  ## v1.1.3 - 2015-09-06
   408  ### Fixed
   409   - Fixed pointers not to be properly decoded
   410   - Fixed queries always timing out when Timeout ConnectOpt is set.
   411  
   412  ## v1.1.2 - 2015-08-28
   413  ### Fixed
   414   - Fixed issue when encoding some maps
   415  
   416  ## v1.1.1 - 2015-08-21
   417  ### Fixed
   418   - Corrected protobuf import
   419   - Fixed documentation
   420   - Fixed issues with time pseudotype conversion that caused issues with milliseconds
   421  
   422  ## v1.1.0 - 2015-08-19
   423  ### Added
   424   - Replaced `UseOutdated` with `ReadMode`
   425   - Added `EmergencyRepair` and `NonVotingReplicaTags` to `ReconfigureOpts`
   426   - Added `Union` as a root term
   427   - Added `Branch` as a root term
   428   - Added `ReadTimeout` and `WriteTimeout` to `RunOpts` and `ExecOpts`
   429   - Exported `github.com/Sirupsen/logrus.Logger` as `Log`
   430   - Added support for encoding maps with non-string keys
   431   - Added 'Round', 'Ceil' and 'Floor' terms
   432   - Added race detector to CI
   433  
   434  ### Changed
   435   - Changed `Timeout` connect argument to only configure the connection timeout.
   436   - Replaced `Db` with `DB` in `RunOpts` and `ExecOpts` (`Db` still works for now)
   437   - Made `Cursor` and `Session` safe for concurrent use
   438   - Replaced `ErrClusterClosed` with `ErrConnectionClosed`
   439  
   440  ## Deprecated
   441   - Deprecated `UseOutdated` optional argument
   442   - Deprecated `Db` in `RunOpt`
   443  
   444  ### Fixed
   445   - Fixed race condition in node pool
   446   - Fixed node refresh issue with RethinkDB 2.1 due to an API change
   447   - Fixed encoding errors not being returned when running queries
   448  
   449  ## v1.0.0 - 2015-06-27
   450  
   451  1.0.0 is finally here, This is the first stable production ready release of RethinkDB-go!
   452  
   453  ![RethinkDB-go Logo](https://raw.github.com/wiki/gorethink/gorethink/gopher-and-thinker.png "Golang Gopher and RethinkDB Thinker")
   454  
   455  In an attempt to make this library more "idiomatic" some functions have been renamed, for the full list of changes and bug fixes see below.
   456  
   457  ### Added
   458   - Added more documentation.
   459   - Added `Shards`, `Replicas` and `PrimaryReplicaTag` optional arguments in `TableCreateOpts`.
   460   - Added `MultiGroup` and `MultiGroupByIndex` which are equivalent to the running `group` with the `multi` optional argument set to true.
   461  
   462  ### Changed 
   463   - Renamed `Db` to `DB`.
   464   - Renamed `DbCreate` to `DBCreate`.
   465   - Renamed `DbDrop` to `DBDrop`.
   466   - Renamed `RqlConnectionError` to `RQLConnectionError`.
   467   - Renamed `RqlDriverError` to `RQLDriverError`.
   468   - Renamed `RqlClientError` to `RQLClientError`.
   469   - Renamed `RqlRuntimeError` to `RQLRuntimeError`.
   470   - Renamed `RqlCompileError` to `RQLCompileError`.
   471   - Renamed `Js` to `JS`.
   472   - Renamed `Json` to `JSON`.
   473   - Renamed `Http` to `HTTP`.
   474   - Renamed `GeoJson` to `GeoJSON`.
   475   - Renamed `ToGeoJson` to `ToGeoJSON`.
   476   - Renamed `WriteChanges` to `ChangeResponse`, this is now a general type and can be used when dealing with changefeeds.
   477   - Removed depth limit when encoding values using `Expr`
   478  
   479  ### Fixed
   480   - Fixed issue causing errors when closing a changefeed cursor (#191)
   481   - Fixed issue causing nodes to remain unhealthy when host discovery is disabled (#195)
   482   - Fixed issue causing driver to fail when connecting to DB which did not have its canonical address set correctly (#200).
   483  - Fixed ongoing queries not being properly stopped when closing the cursor.
   484  
   485  ### Removed
   486   - Removed `CacheSize` and `DataCenter` optional arguments in `TableCreateOpts`.
   487   - Removed `CacheSize` optional argument from `InsertOpts`
   488  
   489  ## v0.7.2 - 2015-05-05
   490  ### Added
   491   - Added support for connecting to a server using TLS (#179)
   492  
   493  ### Fixed
   494   - Fixed issue causing driver to fail to connect to servers with the HTTP admin interface disabled (#181)
   495   - Fixed errors in documentation (#182, #184)
   496   - Fixed RunWrite not closing the cursor (#185)
   497  
   498  ## v0.7.1 - 2015-04-19
   499  ### Changed
   500  - Improved logging of connection errors.
   501  
   502  ### Fixed
   503  - Fixed bug causing empty times to be inserted into the DB even when the omitempty tag was set.
   504  - Fixed node status refresh loop leaking goroutines.
   505  
   506  ## v0.7.0 - 2015-03-30
   507  
   508  This release includes support for RethinkDB 2.0 and connecting to clusters. To connect to a cluster you should use the new `Addresses` field in `ConnectOpts`, for example:
   509  
   510  ```go
   511  session, err := r.Connect(r.ConnectOpts{
   512      Addresses: []string{"localhost:28015", "localhost:28016"},
   513  })
   514  if err != nil {
   515      log.Fatalln(err.Error())
   516  }
   517  ```
   518  
   519  Also added was the ability to read from a cursor using a channel, this is especially useful when using changefeeds. For more information see this [gist](https://gist.github.com/gorethink/2865686d163ed78bbc3c)
   520  
   521  ```go
   522  cursor, err := r.Table("items").Changes()
   523  ch := make(chan map[string]interface{})
   524  cursor.Listen(ch)
   525  ```
   526  
   527  For more details checkout the [README](https://github.com/gorethink/gorethink/blob/master/README.md) and [godoc](https://godoc.org/github.com/gorethink/gorethink). As always if you have any further questions send me a message on [Gitter](https://gitter.im/gorethink/gorethink).
   528  
   529  - Added the ability to connect to multiple nodes, queries are then distributed between these nodes. If a node stops responding then queries stop being sent to this node.
   530  - Added the `DiscoverHosts` optional argument to `ConnectOpts`, when this value is `true` the driver will listen for new nodes added to the cluster.
   531  - Added the `Addresses` optional argument to `ConnectOpts`, this allows the driver to connect to multiple nodes in a cluster.
   532  - Added the `IncludeStates` optional argument to `Changes`.
   533  - Added `MinVal` and `MaxVal` which represent the smallest and largest possible values.
   534  - Added the `Listen` cursor helper function which publishes database results to a channel.
   535  - Added support for optional  arguments for the `Wait` function.
   536  - Added the `Type` function to the `Cursor`, by default this value will be "Cursor" unless using a changefeed.
   537  - Changed the `IndexesOf` function to `OffsetsOf` .
   538  - Changed driver to use the v0.4 protocol (used to use v0.3).
   539  - Fixed geometry tests not properly checking the expected results.
   540  - Fixed bug causing nil pointer panics when using an `Unmarshaler`
   541  - Fixed dropped millisecond precision if given value is too old
   542  
   543  ## v0.6.3 - 2015-03-04
   544  ### Added
   545  - Add `IdentifierFormat` optarg to `TableOpts` (#158)
   546  
   547  ### Fixed
   548  - Fix struct alignment for ARM and x86-32 builds (#153)
   549  - Fix sprintf format for geometry error message (#157)
   550  - Fix duplicate if block (#159)
   551  - Fix incorrect assertion in decoder tests
   552  
   553  ## v0.6.2 - 2015-02-15
   554  
   555  - Fixed `writeQuery` being too small when sending large queries
   556  
   557  ## v0.6.1 - 2015-02-13
   558  
   559  - Reduce GC by using buffers when reading and writing
   560  - Fixed encoding `time.Time` ignoring millseconds
   561  - Fixed pointers in structs that implement the `Marshaler`/`Unmarshaler` interfaces being ignored
   562  
   563  ## v0.6.0 - 2015-01-01
   564  
   565  There are some major changes to the driver with this release that are not related to the RethinkDB v1.16 release. Please have a read through them:
   566  - Improvements to result decoding by caching reflection calls.
   567  - Finished implementing the `Marshaler`/`Unmarshaler` interfaces
   568  - Connection pool overhauled. There were a couple of issues with connections in the previous releases so this release replaces the `fatih/pool` package with a connection pool based on the `database/sql` connection pool.
   569  - Another change is the removal of the prefetching mechanism as the connection+cursor logic was becoming quite complex and causing bugs, hopefully this will be added back in the near future but for now I am focusing my efforts on ensuring the driver is as stable as possible #130 #137
   570  - Due to the above change the API for connecting has changed slightly (The API is now closer to the `database/sql` API. `ConnectOpts` changes:
   571    - `MaxActive` renamed to `MaxOpen`
   572    - `IdleTimeout` renamed to `Timeout`
   573  - `Cursor`s are now only closed automatically when calling either `All` or `One`
   574  - `Exec` now takes `ExecOpts` instead of `RunOpts`. The only difference is that `Exec` has the `NoReply` field
   575  
   576  With that out the way here are the v1.16 changes:
   577  
   578  - Added `Range` which generates all numbers from a given range
   579  - Added an optional squash argument to the changes command, which lets the server combine multiple changes to the same document (defaults to true)
   580  - Added new admin functions (`Config`, `Rebalance`, `Reconfigure`, `Status`, `Wait`)
   581  - Added support for `SUCCESS_ATOM_FEED`
   582  - Added `MinIndex` + `MaxInde`x functions
   583  - Added `ToJSON` function
   584  - Updated `WriteResponse` type
   585  
   586  Since this release has a lot of changes and although I have tested these changes sometimes things fall through the gaps. If you discover any bugs please let me know and I will try to fix them as soon as possible.
   587  
   588  ## v.0.5.1 - 2014-12-14
   589  
   590  - Fixed empty slices being returned as `[]T(nil)` not `[]T{}` #138
   591  
   592  ## v0.5.0 - 2014-10-06
   593  
   594  - Added geospatial terms (`Circle`, `Distance`, `Fill`, `Geojson`, `ToGeojson`, `GetIntersecting`, `GetNearest`, `Includes`, `Intersects`, `Line`, `Point`, `Polygon`, `PolygonSub`)
   595  - Added `UUID` term for generating unique IDs
   596  - Added `AtIndex` term, combines `Nth` and `GetField`
   597  - Added the `Geometry` type, see the types package
   598  - Updated the `BatchConf` field in `RunOpts`, now uses the `BatchOpts` type
   599  - Removed support for the `FieldMapper` interface
   600  
   601  Internal Changes
   602  
   603  - Fixed encoding performance issues, greatly improves writes/second
   604  - Updated `Next` to zero the destination value every time it is called.
   605  
   606  ## v0.4.2 - 2014-09-06
   607  
   608  - Fixed issue causing `Close` to start an infinite loop
   609  - Tidied up connection closing logic
   610  
   611  ## v0.4.1 - 2014-09-05
   612  
   613  - Fixed bug causing Pseudotypes to not be decoded properly (#117)
   614  - Updated github.com/fatih/pool to v2 (#118)
   615  
   616  ## v0.4.0 - 2014-08-13
   617  
   618  - Updated the driver to support RethinkDB v1.14 (#116)
   619  - Added the Binary data type
   620  - Added the Binary command which takes a `[]byte` or `bytes.Buffer{}` as an argument.
   621  - Added the `BinaryFormat` optional argument to `RunOpts` 
   622  - Added the `GroupFormat` optional argument to `RunOpts` 
   623  - Added the `ArrayLimit` optional argument to `RunOpts` 
   624  - Renamed the `ReturnVals` optional argument to `ReturnChanges` 
   625  - Renamed the `Upsert` optional argument to `Conflict` 
   626  - Added the `IndexRename` command
   627  - Updated `Distinct` to now take the `Index` optional argument (using `DistinctOpts`)
   628  
   629  Internal Changes
   630  
   631  - Updated to use the new JSON protocol
   632  - Switched the connection pool code to use github.com/fatih/pool
   633  - Added some benchmarks
   634  
   635  ## v0.3.2 - 2014-08-17
   636  
   637  - Fixed issue causing connections not to be closed correctly (#109)
   638  - Fixed issue causing terms in optional arguments to be encoded incorrectly (#114)
   639  
   640  ## v0.3.1 - 2014-06-14
   641  
   642  - Fixed "Token ## not in stream cache" error (#103)
   643  - Changed Exec to no longer use NoReply. It now waits for the server to respond.
   644  
   645  ## v0.3.0 - 2014-06-26
   646  
   647  - Replaced `ResultRows`/`ResultRow` with `Cursor`, `Cursor` has the `Next`, `All` and `One` methods which stores the relevant value in the value pointed at by result. For more information check the examples.
   648  - Changed the time constants (Days and Months) to package globals instead of functions
   649  - Added the `Args` term and changed the arguments for many terms to `args ...interface{}` to allow argument splicing
   650  - Added the `Changes` term and support for the feed response type
   651  - Added the `Random` term
   652  - Added the `Http` term
   653  - The second argument for `Slice` is now optional
   654  - `EqJoin` now accepts a function as its first argument
   655  - `Nth` now returns a selection
   656  
   657  ## v0.2.0 - 2014-04-13
   658  
   659  * Changed `Connect` to use `ConnectOpts` instead of `map[string]interface{}`
   660  * Migrated to new `Group`/`Ungroup` functions, these replace `GroupedMapReduce` and `GroupBy`
   661  * Added new aggregators
   662  * Removed base parameter for `Reduce`
   663  * Added `Object` function
   664  * Added `Upcase`, `Downcase` and `Split` string functions
   665  * Added `GROUPED_DATA` pseudotype
   666  * Fixed query printing
   667  
   668  ## v0.1.0 - 2013-11-27
   669  
   670  * Added noreply writes
   671  * Added the new terms `index_status`, `index_wait` and `sync`
   672  * Added the profile flag to the run functions
   673  * Optional arguments are now structs instead of key, pair strings. Almost all of the struct fields are of type interface{} as they can have terms inside them. For example: `r.TableCreateOpts{ PrimaryKey: r.Expr("index") }`
   674  * Returned arrays are now properly loaded into ResultRows. In the past when running `r.Expr([]interface{}{1,2,3})` would require you to use `RunRow` followed by `Scan`. You can now use `Run` followed by `ScanAll`