There are a lot of changes in the new major version. The main ones:
The go_tarantool_call_17 build tag is no longer needed, since by default the CallRequest is Call17Request.
The go_tarantool_msgpack_v5 build tag is no longer needed, since only the msgpack/v5 library is used.
The go_tarantool_ssl_disable build tag is no longer needed, since the connector is no longer depends on OpenSSL by default. You could use the external library go-tlsdialer to create a connection with the ssl transport.
Required Go version is 1.20 now.
The Connect function became more flexible. It now allows to create a connection with cancellation and a custom Dialer implementation.
It is required to use Request implementation types with the Connection.Do method instead of Connection.<Request> methods.
Change encoding of the queue.Identify() UUID argument from binary blob to plain string. Needed for upgrade to Tarantool 3.0, where a binary blob is decoded to a varbinary object (https://github.com/tarantool/go-tarantool/pull/313).
connection.Connect no longer return non-working connection objects (https://github.com/tarantool/go-tarantool/issues/136). This function now does not attempt to reconnect and tries to establish a connection only once. Function might be canceled via context. Context accepted as first argument. pool.Connect and pool.Add now accept context as the first argument, which user may cancel in process. If pool.Connect is canceled in progress, an error will be returned. All created connections will be closed.
All responses are now implementations of the Response interface (https://github.com/tarantool/go-tarantool/issues/237). SelectResponse, ExecuteResponse, PrepareResponse, PushResponse are part of a public API. Pos(), MetaData(), SQLInfo() methods created for them to get specific info. Special types of responses are used with special requests.
Method Get for Future now returns response data (https://github.com/tarantool/go-tarantool/issues/237). To get the actual response new GetResponse method has been added. Methods AppendPush and SetResponse accept response Header and data as their arguments.
Operations Ping, Select, Insert, Replace, Delete, Update, Upsert, Call, Call16, Call17, Eval, Execute of a Connector and Pooler return response data instead of an actual responses (https://github.com/tarantool/go-tarantool/issues/237).
Support IPROTO_FEATURE_SPACE_AND_INDEX_NAMES for Tarantool version >= 3.0.0-alpha1 (https://github.com/tarantool/go-tarantool/issues/338). It allows to use space and index names in requests instead of their IDs.
All ConnectionPool., ConnectionPool.Typed and ConnectionPool.Async methods are now deprecated. Instead you should use requests objects + ConnectionPool.Do() (https://github.com/tarantool/go-tarantool/issues/241).
Overview
There are a lot of changes in the new major version. The main ones:
go_tarantool_call_17
build tag is no longer needed, since by default theCallRequest
isCall17Request
.go_tarantool_msgpack_v5
build tag is no longer needed, since only themsgpack/v5
library is used.go_tarantool_ssl_disable
build tag is no longer needed, since the connector is no longer depends onOpenSSL
by default. You could use the external library go-tlsdialer to create a connection with thessl
transport.1.20
now.Connect
function became more flexible. It now allows to create a connection with cancellation and a customDialer
implementation.Request
implementation types with theConnection.Do
method instead ofConnection.<Request>
methods.connection_pool
package renamed topool
.See the migration guide for more details.
Breaking changes
connection.Connect
no longer return non-working connection objects (https://github.com/tarantool/go-tarantool/issues/136). This function now does not attempt to reconnect and tries to establish a connection only once. Function might be canceled via context. Context accepted as first argument.pool.Connect
andpool.Add
now accept context as the first argument, which user may cancel in process. Ifpool.Connect
is canceled in progress, an error will be returned. All created connections will be closed.iproto.Feature
type now used instead ofProtocolFeature
(https://github.com/tarantool/go-tarantool/issues/337).iproto.IPROTO_FEATURE_
constants now used instead of localFeature
constants forprotocol
(https://github.com/tarantool/go-tarantool/issues/337).crud
operationsTimeout
option type tocrud.OptFloat64
instead ofcrud.OptUint
(https://github.com/tarantool/go-tarantool/issues/342).Upsert
andUpdate
requests to accept*tarantool.Operations
asops
parameters instead ofinterface{}
(https://github.com/tarantool/go-tarantool/issues/348).OverrideSchema(*Schema)
toSetSchema(Schema)
(https://github.com/tarantool/go-tarantool/issues/7).Schema
,Space
,Index
structs, to be stored by their values (https://github.com/tarantool/go-tarantool/issues/7).Dialer
mandatory for creation a single connection (https://github.com/tarantool/go-tarantool/issues/321).Connection.RemoteAddr()
,Connection.LocalAddr()
. AddAddr()
function instead (https://github.com/tarantool/go-tarantool/issues/321).Connection.ClientProtocolInfo
,Connection.ServerProtocolInfo
. AddProtocolInfo()
function instead, which returns the server protocol info (https://github.com/tarantool/go-tarantool/issues/321).NewWatcher
checks the actual features of the server, rather than relying on the features provided by the user during connection creation (https://github.com/tarantool/go-tarantool/issues/321).pool.NewWatcher
does not create watchers for connections that do not support it (https://github.com/tarantool/go-tarantool/issues/321).pool.GetPoolInfo
topool.GetInfo
. Change return type tomap[string]ConnectionInfo
(https://github.com/tarantool/go-tarantool/issues/321).Response
is now an interface (https://github.com/tarantool/go-tarantool/issues/237).Response
interface (https://github.com/tarantool/go-tarantool/issues/237).SelectResponse
,ExecuteResponse
,PrepareResponse
,PushResponse
are part of a public API.Pos()
,MetaData()
,SQLInfo()
methods created for them to get specific info. Special types of responses are used with special requests.IsPush()
method is added to the response iterator (https://github.com/tarantool/go-tarantool/issues/237). It returns the information if the current response is aPushResponse
.PushCode
constant is removed.Get
forFuture
now returns response data (https://github.com/tarantool/go-tarantool/issues/237). To get the actual response newGetResponse
method has been added. MethodsAppendPush
andSetResponse
accept responseHeader
and data as their arguments.Future
constructors now acceptRequest
as their argument (https://github.com/tarantool/go-tarantool/issues/237).Ping
,Select
,Insert
,Replace
,Delete
,Update
,Upsert
,Call
,Call16
,Call17
,Eval
,Execute
of aConnector
andPooler
return response data instead of an actual responses (https://github.com/tarantool/go-tarantool/issues/237).pool.Connect
,pool.ConnetcWithOpts
andpool.Add
use a new typepool.Instance
to determinate connection options (https://github.com/tarantool/go-tarantool/issues/356).pool.Connect
,pool.ConnectWithOpts
andpool.Add
add connections to the pool even it is unable to connect to it (https://github.com/tarantool/go-tarantool/issues/372).1.13
to1.20
(https://github.com/tarantool/go-tarantool/issues/378).Schema
field from theConnection
struct is removed (https://github.com/tarantool/go-tarantool/issues/7).OkCode
andPushCode
constants is removed (https://github.com/tarantool/go-tarantool/issues/237).Future.Err()
method is removed (https://github.com/tarantool/go-tarantool/pull/382).New features
operation_data
incrud.Error
(https://github.com/tarantool/go-tarantool/issues/330).fetch_latest_metadata
option for crud requests with metadata (https://github.com/tarantool/go-tarantool/pull/335).noreturn
option for data change crud requests (https://github.com/tarantool/go-tarantool/pull/335).crud.schema
request (https://github.com/tarantool/go-tarantool/pull/336, https://github.com/tarantool/go-tarantool/pull/351).IPROTO_WATCH_ONCE
request type for Tarantool version >= 3.0.0-alpha1 (https://github.com/tarantool/go-tarantool/issues/337).yield_every
option for crud select requests (https://github.com/tarantool/go-tarantool/pull/350).IPROTO_FEATURE_SPACE_AND_INDEX_NAMES
for Tarantool version >= 3.0.0-alpha1 (https://github.com/tarantool/go-tarantool/issues/338). It allows to use space and index names in requests instead of their IDs.GetSchema
function to get the actual schema (https://github.com/tarantool/go-tarantool/issues/7).Header
struct for the response header (https://github.com/tarantool/go-tarantool/issues/237). It can be accessed viaHeader()
method of theResponse
interface.Response
method added to theRequest
interface (https://github.com/tarantool/go-tarantool/issues/237).LogAppendPushFailed
connection log constant (https://github.com/tarantool/go-tarantool/issues/237). It is logged when connection fails to append a push response.ErrorNo
constant that indicates that no error has occurred while getting the response (https://github.com/tarantool/go-tarantool/issues/237).AuthDialer
type for creating a dialer with authentication (https://github.com/tarantool/go-tarantool/issues/301).ProtocolDialer
type for creating a dialer withProtocolInfo
receiving and check (https://github.com/tarantool/go-tarantool/issues/301).GreetingDialer
type for creating a dialer, that fillsGreeting
of a connection (https://github.com/tarantool/go-tarantool/issues/301).Pool.DoInstance
to execute a request on a target instance in a pool (https://github.com/tarantool/go-tarantool/issues/376).Bugfixes
scale
value is negative (https://github.com/tarantool/go-tarantool/pull/314).after
,batch_size
andforce_map_call
) setup for crud.SelectRequest (https://github.com/tarantool/go-tarantool/issues/320).vshard_router
,fields
,bucket_id
,mode
,prefer_replica
,balance
) setup for crud.GetRequest (https://github.com/tarantool/go-tarantool/pull/335).crud.*ManyRequest/crud.*ObjectManyRequest
(https://github.com/tarantool/go-tarantool/issues/365).Testing
MockDoer
,MockRequest
totest_helpers
.StrangerResponse
toMockResponse
(https://github.com/tarantool/go-tarantool/issues/237).Other