Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How implement struct for use in crud insert request? #320

Open
siller174 opened this issue Jul 29, 2023 · 14 comments
Open

How implement struct for use in crud insert request? #320

siller174 opened this issue Jul 29, 2023 · 14 comments
Labels
1sp documentation Improvements or additions to documentation teamE

Comments

@siller174
Copy link

siller174 commented Jul 29, 2023

How implement struct for put in crud request?

Example with map

	insert := crud.MakeInsertObjectRequest("user").
			Object(
				crud.MapObject(map[string]interface{}{
					"id":         userUUID,
					"created_at": time.Now().Unix(),
					"buc1ket_id": nil,
				})).
			Context(ctx)

But i want implement myself Object.

I should use this interface:

type encoder = msgpack.Encoder
type decoder = msgpack.Decoder

// Object is an interface to describe object for CRUD methods.
type Object interface {
	EncodeMsgpack(enc *encoder)
}

with private field encoder.

My struct

type Customer struct {
	ID        string `msgpack:"'id'"`
	CreatedAt string `msgpack:"'created_at'"`
	BucketID  *int64 `msgpack:"'bucket_id'"`
}

func (c *Customer) EncodeMsgpack(enc *msgpack.Encoder) {
	enc.Encode(&c)
}

What am i doing wrong?

@oleg-jukovec
Copy link
Collaborator

oleg-jukovec commented Jul 29, 2023

Hello. Could you please provide more information about the issue you're facing? What specific error message or problem are you encountering?

You could insert a tuple with InsertRequest:

type exampleInsertTuple struct {
	_msgpack struct{} `msgpack:",asArray"` //nolint: structcheck,unused
	ID        uint
	BucketID  *uint	
	Name      string
}

func ExampleInsertRequest() {
	conn := exampleConnect()
	tup := exampleInsertTuple{
		ID:       2024,
		BucketID: nil,
		Name:     "foo",
	}
	req := crud.MakeInsertRequest(exampleSpace).Tuple(tup)

	ret := crud.Result{}
	if err := conn.Do(req).GetTyped(&ret); err != nil {
		fmt.Printf("Failed to execute request: %s", err)
	} else {
		fmt.Println(ret.Metadata)
		fmt.Println(ret.Rows)
	}
	// Output:
	// [{id unsigned false} {bucket_id unsigned true} {name string false}]
	// [[2024 263 foo]]
}

or an object with InsertObjectRequest:

type exampleInsertObject struct {
	ID        uint   `msgpack:"'id'"`
	BucketID  *uint  `msgpack:"'bucket_id'"`	
	Name      string `msgpack:"'name'"`
}

func (e *exampleInsertObject) EncodeMsgpack(enc *msgpack.Encoder) {
	enc.Encode(e)
}

func ExampleInsertObjectRequest() {
	conn := exampleConnect()
	obj := exampleInsertObject{
		ID:       2022,
		BucketID: nil,
		Name:     "foo",
	}
	req := crud.MakeInsertObjectRequest(exampleSpace).Object(&obj)

	ret := crud.Result{}
	if err := conn.Do(req).GetTyped(&ret); err != nil {
		fmt.Printf("Failed to execute request: %s", err)
	} else {
		fmt.Println(ret.Metadata)
		fmt.Println(ret.Rows)
	}
	// Output:
	// [{id unsigned false} {bucket_id unsigned true} {name string false}]
	// [[2022 263 foo]]
}

The examples are works with out test space format:

{name = 'id', type = 'unsigned'},
{name = 'bucket_id', type = 'unsigned', is_nullable = true},
{name = 'name', type = 'string'},

You could add the code into crud/example_test.go and run an example with a command:

$ cd crud && go test -v . -run ExampleInsertRequest

or

$ cd crud && go test -v . -run ExampleInsertObjectRequest

TODO: add an example with *ObjectRequest to crud/example_test.go.

@oleg-jukovec oleg-jukovec added documentation Improvements or additions to documentation 1sp needs feedback Something is unclear with the issue teamE question Further information is requested labels Jul 29, 2023
@siller174
Copy link
Author

Yes, thank you. Main problem in crud is examples, it's really hard to integrate.
Could you also write example for crud.MakeUpsertManyRequest?

@DifferentialOrange
Copy link
Member

Btw, if you mean "put" as "write a record disregarding whether a record with such primary key exist or not", it's Replace operations you are looking for. Insert operations throw error when you're trying to overwrite an existing record.

@siller174
Copy link
Author

@oleg-jukovec. One more question with crud.

How implement pagination select request?

For example in Lua

s:select({0},{iterator='GT',offset=1,limit=2})

In Options i found this

	// First describes the maximum count of the objects to return.
	First OptInt
	// After is a tuple after which objects should be selected.
	After OptTuple
	// BatchSize is a number of tuples to process per one request to storage.
	BatchSize OptUint

But didn't find offset parameter.

@siller174
Copy link
Author

@DifferentialOrange thank you!

@oleg-jukovec
Copy link
Collaborator

oleg-jukovec commented Jul 31, 2023

@oleg-jukovec. One more question with crud.
But didn't find offset parameter.

crud's select does not have the offset parameter:

https://github.com/tarantool/crud/#select

You need to use After + First as it is described for crud:

https://github.com/tarantool/crud/blob/master/doc/select.md#pagination

@siller174
Copy link
Author

Okay :(
So I should make 2 requests:
First for get object for After,
Second for make select with pagination?

@oleg-jukovec
Copy link
Collaborator

oleg-jukovec commented Jul 31, 2023

There is no difference between original crud. A pagination logic wtih crud looks like this:

res, err = crud.select('developers', nil, { first = 5 })
for i = 0; i < 10; i++ then
    res, err = crud.select('developers', nil, { after = res.rows[5], first = 5 })
end

go-tarantool just provides wrappers around Lua's requests without additional logic.

@siller174
Copy link
Author

Thank you

@siller174
Copy link
Author

I'm very sorry for so many questions.

But I have no idea, what I do wrong

const space = "user"

type User struct {
	_msgpack struct{} `msgpack:",asArray"` //nolint: structcheck,unused

	ID        string `msgpack:"id"`
	CreatedAt string `msgpack:"created_at"`
	BucketID  *uint  `msgpack:"'bucket_id'"`
}

func (e *User) EncodeMsgpack(enc *msgpack.Encoder) {
	enc.Encode(e)
}

func main() {
	var (
		user = "admin"
		pass = "secret-cluster-cookie"
		dsn  = "localhost:3301"

		ctx = context.Background()

		offset = 2
		limit  = 2
	)

	connection, err := tarantool.New(user, pass, dsn)
	if err != nil {
		panic(err)
	}

	if offset == 0 {
		offset = limit
	}

	var (
		req = crud.MakeSelectRequest(space).
			Context(ctx).
			Opts(crud.SelectOpts{
				First: crud.MakeOptInt(limit),
			})
		ret = crud.MakeResult(reflect.TypeOf(User{}))
	)

	if err := connection.Do(req).GetTyped(&ret); err != nil {
		panic(err)
	}

	users := ret.Rows.([]User)
	if len(users) == 0 {
		panic("len(users) == 0")
	}

	u := users[offset-1]

	req = crud.MakeSelectRequest(space).
		Context(ctx).
		Opts(crud.SelectOpts{
			First: crud.MakeOptInt(limit),
			After: crud.MakeOptTuple(&u),
		})

	if err := connection.Do(req).GetTyped(&ret); err != nil {
		panic(err)
	}

	fmt.Println(ret.Metadata)
	fmt.Println(ret.Rows.([]User))
	fmt.Println("len: ", len(ret.Rows.([]User)))
}

@oleg-jukovec
Copy link
Collaborator

oleg-jukovec commented Jul 31, 2023

Could you please provide more information about the issue you're facing? What specific error message or problem are you encountering?

oleg-jukovec added a commit that referenced this issue Jul 31, 2023
The patch fixes a typo that made it impossible to setup
SelectOpts.After, SelectOpts.BatchSize and SelectOpts.ForceMapCall.

Part of #320
@siller174
Copy link
Author

I just want to implement pagination logic

@oleg-jukovec
Copy link
Collaborator

oleg-jukovec commented Jul 31, 2023

I just want to implement pagination logic

What specific error message are you encountering?

Is the fix relevant for you problem?

#323

@siller174
Copy link
Author

@oleg-jukovec yes, i just checked it with fix. Thank you.

oleg-jukovec added a commit that referenced this issue Aug 2, 2023
The patch fixes a typo that made it impossible to setup
SelectOpts.After, SelectOpts.BatchSize and SelectOpts.ForceMapCall.

Part of #320
oleg-jukovec added a commit that referenced this issue Aug 3, 2023
The patch fixes a typo that made it impossible to setup
SelectOpts.After, SelectOpts.BatchSize and SelectOpts.ForceMapCall.

Part of #320
oleg-jukovec added a commit that referenced this issue Aug 3, 2023
The patch fixes a typo that made it impossible to setup
SelectOpts.After, SelectOpts.BatchSize and SelectOpts.ForceMapCall.

Part of #320

(cherry picked from f56fb90)
oleg-jukovec added a commit that referenced this issue Aug 3, 2023
Overview

    The release fixes options setup for crud's select requests.

Breaking changes

    There are no breaking changes in the release.

Bugfixes

    Incorrect options (`after`, `batch_size` and `force_map_call`)
    setup for crud.SelectRequest (#320)
oleg-jukovec added a commit that referenced this issue Aug 3, 2023
The patch fixes a typo that made it impossible to setup
SelectOpts.After, SelectOpts.BatchSize and SelectOpts.ForceMapCall.

Part of #320

(cherry picked from f56fb90)
oleg-jukovec added a commit that referenced this issue Aug 3, 2023
Overview

    The patch release with fixes from the master branch.

Breaking changes

    There are no breaking changes in the release.

Bugfixes

    Race condition at roundRobinStrategy.GetNextConnection() (#309)

    Incorrect decoding of an MP_DECIMAL when the `scale` value is
    negative (#314)

    Incorrect options (`after`, `batch_size` and `force_map_call`)
    setup for crud.SelectRequest (#320)

Other

    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 (#313).
oleg-jukovec added a commit that referenced this issue Aug 3, 2023
Overview

    The patch release with fixes from the master branch.

Breaking changes

    There are no breaking changes in the release.

Bugfixes

    Race condition at roundRobinStrategy.GetNextConnection() (#309).

    Incorrect decoding of an MP_DECIMAL when the `scale` value is
    negative (#314).

    Incorrect options (`after`, `batch_size` and `force_map_call`)
    setup for crud.SelectRequest (#320).

Other

    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 (#313).
oleg-jukovec added a commit that referenced this issue Aug 3, 2023
The patch fixes a typo that made it impossible to setup
SelectOpts.After, SelectOpts.BatchSize and SelectOpts.ForceMapCall.

Part of #320

(cherry picked from f56fb90)
oleg-jukovec added a commit that referenced this issue Aug 3, 2023
Overview

    The patch release imports fixes from the master branch.

Breaking changes

    There are no breaking changes in the release.

Bugfixes

    Flaky decimal/TestSelect (#300).

    Race condition at roundRobinStrategy.GetNextConnection() (#309).

    Incorrect decoding of an MP_DECIMAL when the `scale` value is
    negative (#314).

    Incorrect options (`after`, `batch_size` and `force_map_call`)
    setup for crud.SelectRequest (#320).

Other

    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 (#313).
oleg-jukovec added a commit that referenced this issue Aug 7, 2023
The patch fixes a typo that made it impossible to setup
SelectOpts.After, SelectOpts.BatchSize and SelectOpts.ForceMapCall.

Part of #320

(cherry picked from f56fb90)
oleg-jukovec added a commit that referenced this issue Aug 7, 2023
Overview

    The patch release imports fixes from the master branch.

Breaking changes

    There are no breaking changes in the release.

Bugfixes

    Flaky decimal/TestSelect (#300).

    Race condition at roundRobinStrategy.GetNextConnection() (#309).

    Incorrect decoding of an MP_DECIMAL when the `scale` value is
    negative (#314).

    Incorrect options (`after`, `batch_size` and `force_map_call`)
    setup for crud.SelectRequest (#320).

Other

    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 (#313).
@oleg-jukovec oleg-jukovec removed needs feedback Something is unclear with the issue question Further information is requested labels Nov 29, 2023
oleg-jukovec added a commit that referenced this issue Feb 11, 2024
Overview

    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[1] 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.
    * The `connection_pool` package renamed to `pool`.

    See the migration guide[2] for more details.

Breaking changes

    connection_pool renamed to pool (#239).

    Use msgpack/v5 instead of msgpack.v2 (#236).

    Call/NewCallRequest = Call17/NewCall17Request (#235).

    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 (#313).

    Use objects of the Decimal type instead of pointers (#238).

    Use objects of the Datetime type instead of pointers (#238).

    `connection.Connect` no longer return non-working connection
    objects (#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.

    `iproto.Feature` type now used instead of `ProtocolFeature` (#337).

    `iproto.IPROTO_FEATURE_` constants now used instead of local
    `Feature` constants for `protocol` (#337).

    Change `crud` operations `Timeout` option type to `crud.OptFloat64`
    instead of `crud.OptUint` (#342).

    Change all `Upsert` and `Update` requests to accept
    `*tarantool.Operations`  as `ops` parameters instead of
    `interface{}` (#348).

    Change `OverrideSchema(*Schema)` to `SetSchema(Schema)` (#7).

    Change values, stored by pointers in the `Schema`, `Space`,
    `Index` structs,  to be stored by their values (#7).

    Make `Dialer` mandatory for creation a single connection (#321).

    Remove `Connection.RemoteAddr()`, `Connection.LocalAddr()`.
    Add `Addr()` function instead (#321).

    Remove `Connection.ClientProtocolInfo`,
    `Connection.ServerProtocolInfo`. Add `ProtocolInfo()` function
    instead, which returns the server protocol info (#321).

    `NewWatcher` checks the actual features of the server, rather
    than relying on the features provided by the user during connection
    creation (#321).

    `pool.NewWatcher` does not create watchers for connections that do
    not support it (#321).

    Rename `pool.GetPoolInfo` to `pool.GetInfo`. Change return type to
    `map[string]ConnectionInfo` (#321).

    `Response` is now an interface (#237).

    All responses are now implementations of the `Response`
    interface (#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 (#237). It
    returns the information if the current response is a
    `PushResponse`. `PushCode` constant is removed.

    Method `Get` for `Future` now returns response data (#237). To get
    the actual response new `GetResponse` method has been added.
    Methods `AppendPush` and `SetResponse` accept response `Header`
    and data as their arguments.

    `Future` constructors now accept `Request` as their argument
    (#237).

    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 (#237).

    `pool.Connect`, `pool.ConnetcWithOpts` and `pool.Add` use a
    new type `pool.Instance` to determinate connection options (#356).

    `pool.Connect`, `pool.ConnectWithOpts` and `pool.Add` add
    connections to the pool even it is unable to connect to it (#372).

    Required Go version from `1.13` to `1.20` (#378).

    multi subpackage is removed (#240).

    msgpack.v2 support is removed (#236).

    pool/RoundRobinStrategy is removed (#158).

    DeadlineIO is removed (#158).

    UUID_extId is removed (#158).

    IPROTO constants are removed (#158).

    Code() method from the Request interface is removed (#158).

    `Schema` field from the `Connection` struct is removed (#7).

    `OkCode` and `PushCode` constants is removed (#237).

    SSL support is removed (#301).

    `Future.Err()` method is removed (#382).

New features

    Type() method to the Request interface (#158).

    Enumeration types for RLimitAction/iterators (#158).

    IsNullable flag for Field (#302).

    More linters on CI (#310).

    Meaningful description for read/write socket errors (#129).

    Support `operation_data` in `crud.Error` (#330).

    Support `fetch_latest_metadata` option for crud requests with
    metadata (#335).

    Support `noreturn` option for data change crud requests (#335).

    Support `crud.schema` request (#336, #351).

    Support `IPROTO_WATCH_ONCE` request type for Tarantool
    version >= 3.0.0-alpha1 (#337).

    Support `yield_every` option for crud select requests (#350).

    Support `IPROTO_FEATURE_SPACE_AND_INDEX_NAMES` for Tarantool
    version >= 3.0.0-alpha1 (#338). It allows to use space and index
    names in requests instead of their IDs.

    `GetSchema` function to get the actual schema (#7).

    Support connection via an existing socket fd (#321).

    `Header` struct for the response header (#237). It can be accessed
    via `Header()` method of the `Response` interface.

   `Response` method added to the `Request` interface (#237).

   New `LogAppendPushFailed` connection log constant (#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 (#237).

   `AuthDialer` type for creating a dialer with authentication (#301).

   `ProtocolDialer` type for creating a dialer with `ProtocolInfo`
   receiving and  check (#301).

   `GreetingDialer` type for creating a dialer, that fills `Greeting`
   of a connection (#301).

   New method `Pool.DoInstance` to execute a request on a target
   instance in a pool (#376).

Bugfixes

    Race condition at roundRobinStrategy.GetNextConnection() (#309).

    Incorrect decoding of an MP_DECIMAL when the `scale` value is
    negative (#314).

    Incorrect options (`after`, `batch_size` and `force_map_call`)
    setup for crud.SelectRequest (#320).

    Incorrect options (`vshard_router`, `fields`, `bucket_id`, `mode`,
    `prefer_replica`, `balance`) setup for crud.GetRequest (#335)

    Splice update operation accepts 3 arguments instead of 5 (#348).

    Unable to use a slice of custom types as a slice of tuples or
    objects for `crud.*ManyRequest/crud.*ObjectManyRequest` (#365).

Testing

    Added an ability to mock connections for tests (#237). Added new
    types `MockDoer`, `MockRequest` to `test_helpers`.

    Flaky decimal/TestSelect (#300).

    Tests with crud 1.4.0 (#336).

    Tests with case sensitive SQL (#341).

    Renamed `StrangerResponse` to `MockResponse` (#237).

Other

    All Connection.<Request>, Connection.<Request>Typed and
    Connection.<Request>Async methods are now deprecated. Instead you
    should use requests objects + Connection.Do() (#241).

    All ConnectionPool.<Request>, ConnectionPool.<Request>Typed and
    ConnectionPool.<Request>Async methods are now deprecated. Instead
    you should use requests objects + ConnectionPool.Do() (#241).

    box.session.push() usage is deprecated: Future.AppendPush() and
    Future.GetIterator() methods, ResponseIterator and
    TimeoutResponseIterator types (#324).

1. https://github.com/tarantool/go-tlsdialer
2. https://github.com/tarantool/go-tarantool/blob/master/MIGRATION.md
oleg-jukovec added a commit that referenced this issue Feb 11, 2024
Overview

    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[1] 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.
    * The `connection_pool` package renamed to `pool`.

    See the migration guide[2] for more details.

Breaking changes

    connection_pool renamed to pool (#239).

    Use msgpack/v5 instead of msgpack.v2 (#236).

    Call/NewCallRequest = Call17/NewCall17Request (#235).

    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 (#313).

    Use objects of the Decimal type instead of pointers (#238).

    Use objects of the Datetime type instead of pointers (#238).

    `connection.Connect` no longer return non-working connection
    objects (#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.

    `iproto.Feature` type now used instead of `ProtocolFeature` (#337).

    `iproto.IPROTO_FEATURE_` constants now used instead of local
    `Feature` constants for `protocol` (#337).

    Change `crud` operations `Timeout` option type to `crud.OptFloat64`
    instead of `crud.OptUint` (#342).

    Change all `Upsert` and `Update` requests to accept
    `*tarantool.Operations`  as `ops` parameters instead of
    `interface{}` (#348).

    Change `OverrideSchema(*Schema)` to `SetSchema(Schema)` (#7).

    Change values, stored by pointers in the `Schema`, `Space`,
    `Index` structs,  to be stored by their values (#7).

    Make `Dialer` mandatory for creation a single connection (#321).

    Remove `Connection.RemoteAddr()`, `Connection.LocalAddr()`.
    Add `Addr()` function instead (#321).

    Remove `Connection.ClientProtocolInfo`,
    `Connection.ServerProtocolInfo`. Add `ProtocolInfo()` function
    instead, which returns the server protocol info (#321).

    `NewWatcher` checks the actual features of the server, rather
    than relying on the features provided by the user during connection
    creation (#321).

    `pool.NewWatcher` does not create watchers for connections that do
    not support it (#321).

    Rename `pool.GetPoolInfo` to `pool.GetInfo`. Change return type to
    `map[string]ConnectionInfo` (#321).

    `Response` is now an interface (#237).

    All responses are now implementations of the `Response`
    interface (#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 (#237). It
    returns the information if the current response is a
    `PushResponse`. `PushCode` constant is removed.

    Method `Get` for `Future` now returns response data (#237). To get
    the actual response new `GetResponse` method has been added.
    Methods `AppendPush` and `SetResponse` accept response `Header`
    and data as their arguments.

    `Future` constructors now accept `Request` as their argument
    (#237).

    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 (#237).

    `pool.Connect`, `pool.ConnetcWithOpts` and `pool.Add` use a
    new type `pool.Instance` to determinate connection options (#356).

    `pool.Connect`, `pool.ConnectWithOpts` and `pool.Add` add
    connections to the pool even it is unable to connect to it (#372).

    Required Go version from `1.13` to `1.20` (#378).

    multi subpackage is removed (#240).

    msgpack.v2 support is removed (#236).

    pool/RoundRobinStrategy is removed (#158).

    DeadlineIO is removed (#158).

    UUID_extId is removed (#158).

    IPROTO constants are removed (#158).

    Code() method from the Request interface is removed (#158).

    `Schema` field from the `Connection` struct is removed (#7).

    `OkCode` and `PushCode` constants is removed (#237).

    SSL support is removed (#301).

    `Future.Err()` method is removed (#382).

New features

    Type() method to the Request interface (#158).

    Enumeration types for RLimitAction/iterators (#158).

    IsNullable flag for Field (#302).

    More linters on CI (#310).

    Meaningful description for read/write socket errors (#129).

    Support `operation_data` in `crud.Error` (#330).

    Support `fetch_latest_metadata` option for crud requests with
    metadata (#335).

    Support `noreturn` option for data change crud requests (#335).

    Support `crud.schema` request (#336, #351).

    Support `IPROTO_WATCH_ONCE` request type for Tarantool
    version >= 3.0.0-alpha1 (#337).

    Support `yield_every` option for crud select requests (#350).

    Support `IPROTO_FEATURE_SPACE_AND_INDEX_NAMES` for Tarantool
    version >= 3.0.0-alpha1 (#338). It allows to use space and index
    names in requests instead of their IDs.

    `GetSchema` function to get the actual schema (#7).

    Support connection via an existing socket fd (#321).

    `Header` struct for the response header (#237). It can be accessed
    via `Header()` method of the `Response` interface.

   `Response` method added to the `Request` interface (#237).

   New `LogAppendPushFailed` connection log constant (#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 (#237).

   `AuthDialer` type for creating a dialer with authentication (#301).

   `ProtocolDialer` type for creating a dialer with `ProtocolInfo`
   receiving and  check (#301).

   `GreetingDialer` type for creating a dialer, that fills `Greeting`
   of a connection (#301).

   New method `Pool.DoInstance` to execute a request on a target
   instance in a pool (#376).

Bugfixes

    Race condition at roundRobinStrategy.GetNextConnection() (#309).

    Incorrect decoding of an MP_DECIMAL when the `scale` value is
    negative (#314).

    Incorrect options (`after`, `batch_size` and `force_map_call`)
    setup for crud.SelectRequest (#320).

    Incorrect options (`vshard_router`, `fields`, `bucket_id`, `mode`,
    `prefer_replica`, `balance`) setup for crud.GetRequest (#335).

    Splice update operation accepts 3 arguments instead of 5 (#348).

    Unable to use a slice of custom types as a slice of tuples or
    objects for `crud.*ManyRequest/crud.*ObjectManyRequest` (#365).

Testing

    Added an ability to mock connections for tests (#237). Added new
    types `MockDoer`, `MockRequest` to `test_helpers`.

    Fixed flaky decimal/TestSelect (#300).

    Fixed tests with crud 1.4.0 (#336).

    Fixed tests with case sensitive SQL (#341).

    Renamed `StrangerResponse` to `MockResponse` (#237).

Other

    All Connection.<Request>, Connection.<Request>Typed and
    Connection.<Request>Async methods are now deprecated. Instead you
    should use requests objects + Connection.Do() (#241).

    All ConnectionPool.<Request>, ConnectionPool.<Request>Typed and
    ConnectionPool.<Request>Async methods are now deprecated. Instead
    you should use requests objects + ConnectionPool.Do() (#241).

    box.session.push() usage is deprecated: Future.AppendPush() and
    Future.GetIterator() methods, ResponseIterator and
    TimeoutResponseIterator types (#324).

1. https://github.com/tarantool/go-tlsdialer
2. https://github.com/tarantool/go-tarantool/blob/master/MIGRATION.md
oleg-jukovec added a commit that referenced this issue Feb 11, 2024
Overview

    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[1] 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.
    * The `connection_pool` package renamed to `pool`.

    See the migration guide[2] for more details.

Breaking changes

    connection_pool renamed to pool (#239).

    Use msgpack/v5 instead of msgpack.v2 (#236).

    Call/NewCallRequest = Call17/NewCall17Request (#235).

    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 (#313).

    Use objects of the Decimal type instead of pointers (#238).

    Use objects of the Datetime type instead of pointers (#238).

    `connection.Connect` no longer return non-working connection
    objects (#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.

    `iproto.Feature` type now used instead of `ProtocolFeature` (#337).

    `iproto.IPROTO_FEATURE_` constants now used instead of local
    `Feature` constants for `protocol` (#337).

    Change `crud` operations `Timeout` option type to `crud.OptFloat64`
    instead of `crud.OptUint` (#342).

    Change all `Upsert` and `Update` requests to accept
    `*tarantool.Operations`  as `ops` parameters instead of
    `interface{}` (#348).

    Change `OverrideSchema(*Schema)` to `SetSchema(Schema)` (#7).

    Change values, stored by pointers in the `Schema`, `Space`,
    `Index` structs,  to be stored by their values (#7).

    Make `Dialer` mandatory for creation a single connection (#321).

    Remove `Connection.RemoteAddr()`, `Connection.LocalAddr()`.
    Add `Addr()` function instead (#321).

    Remove `Connection.ClientProtocolInfo`,
    `Connection.ServerProtocolInfo`. Add `ProtocolInfo()` function
    instead, which returns the server protocol info (#321).

    `NewWatcher` checks the actual features of the server, rather
    than relying on the features provided by the user during connection
    creation (#321).

    `pool.NewWatcher` does not create watchers for connections that do
    not support it (#321).

    Rename `pool.GetPoolInfo` to `pool.GetInfo`. Change return type to
    `map[string]ConnectionInfo` (#321).

    `Response` is now an interface (#237).

    All responses are now implementations of the `Response`
    interface (#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 (#237). It
    returns the information if the current response is a
    `PushResponse`. `PushCode` constant is removed.

    Method `Get` for `Future` now returns response data (#237). To get
    the actual response new `GetResponse` method has been added.
    Methods `AppendPush` and `SetResponse` accept response `Header`
    and data as their arguments.

    `Future` constructors now accept `Request` as their argument
    (#237).

    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 (#237).

    `pool.Connect`, `pool.ConnetcWithOpts` and `pool.Add` use a
    new type `pool.Instance` to determinate connection options (#356).

    `pool.Connect`, `pool.ConnectWithOpts` and `pool.Add` add
    connections to the pool even it is unable to connect to it (#372).

    Required Go version from `1.13` to `1.20` (#378).

    multi subpackage is removed (#240).

    msgpack.v2 support is removed (#236).

    pool/RoundRobinStrategy is removed (#158).

    DeadlineIO is removed (#158).

    UUID_extId is removed (#158).

    IPROTO constants are removed (#158).

    Code() method from the Request interface is removed (#158).

    `Schema` field from the `Connection` struct is removed (#7).

    `OkCode` and `PushCode` constants is removed (#237).

    SSL support is removed (#301).

    `Future.Err()` method is removed (#382).

New features

    Type() method to the Request interface (#158).

    Enumeration types for RLimitAction/iterators (#158).

    IsNullable flag for Field (#302).

    Meaningful description for read/write socket errors (#129).

    Support `operation_data` in `crud.Error` (#330).

    Support `fetch_latest_metadata` option for crud requests with
    metadata (#335).

    Support `noreturn` option for data change crud requests (#335).

    Support `crud.schema` request (#336, #351).

    Support `IPROTO_WATCH_ONCE` request type for Tarantool
    version >= 3.0.0-alpha1 (#337).

    Support `yield_every` option for crud select requests (#350).

    Support `IPROTO_FEATURE_SPACE_AND_INDEX_NAMES` for Tarantool
    version >= 3.0.0-alpha1 (#338). It allows to use space and index
    names in requests instead of their IDs.

    `GetSchema` function to get the actual schema (#7).

    Support connection via an existing socket fd (#321).

    `Header` struct for the response header (#237). It can be accessed
    via `Header()` method of the `Response` interface.

   `Response` method added to the `Request` interface (#237).

   New `LogAppendPushFailed` connection log constant (#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 (#237).

   `AuthDialer` type for creating a dialer with authentication (#301).

   `ProtocolDialer` type for creating a dialer with `ProtocolInfo`
   receiving and  check (#301).

   `GreetingDialer` type for creating a dialer, that fills `Greeting`
   of a connection (#301).

   New method `Pool.DoInstance` to execute a request on a target
   instance in a pool (#376).

Bugfixes

    Race condition at roundRobinStrategy.GetNextConnection() (#309).

    Incorrect decoding of an MP_DECIMAL when the `scale` value is
    negative (#314).

    Incorrect options (`after`, `batch_size` and `force_map_call`)
    setup for crud.SelectRequest (#320).

    Incorrect options (`vshard_router`, `fields`, `bucket_id`, `mode`,
    `prefer_replica`, `balance`) setup for crud.GetRequest (#335).

    Splice update operation accepts 3 arguments instead of 5 (#348).

    Unable to use a slice of custom types as a slice of tuples or
    objects for `crud.*ManyRequest/crud.*ObjectManyRequest` (#365).

Testing

    More linters on CI (#310).

    Added an ability to mock connections for tests (#237). Added new
    types `MockDoer`, `MockRequest` to `test_helpers`.

    Fixed flaky decimal/TestSelect (#300).

    Fixed tests with crud 1.4.0 (#336).

    Fixed tests with case sensitive SQL (#341).

    Renamed `StrangerResponse` to `MockResponse` (#237).

Other

    All Connection.<Request>, Connection.<Request>Typed and
    Connection.<Request>Async methods are now deprecated. Instead you
    should use requests objects + Connection.Do() (#241).

    All ConnectionPool.<Request>, ConnectionPool.<Request>Typed and
    ConnectionPool.<Request>Async methods are now deprecated. Instead
    you should use requests objects + ConnectionPool.Do() (#241).

    box.session.push() usage is deprecated: Future.AppendPush() and
    Future.GetIterator() methods, ResponseIterator and
    TimeoutResponseIterator types (#324).

1. https://github.com/tarantool/go-tlsdialer
2. https://github.com/tarantool/go-tarantool/blob/master/MIGRATION.md
oleg-jukovec added a commit that referenced this issue Feb 11, 2024
Overview

    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[1] 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.
    * The `connection_pool` package renamed to `pool`.

    See the migration guide[2] for more details.

Breaking changes

    connection_pool renamed to pool (#239).

    Use msgpack/v5 instead of msgpack.v2 (#236).

    Call/NewCallRequest = Call17/NewCall17Request (#235).

    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 (#313).

    Use objects of the Decimal type instead of pointers (#238).

    Use objects of the Datetime type instead of pointers (#238).

    `connection.Connect` no longer return non-working connection
    objects (#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.

    `iproto.Feature` type now used instead of `ProtocolFeature` (#337).

    `iproto.IPROTO_FEATURE_` constants now used instead of local
    `Feature` constants for `protocol` (#337).

    Change `crud` operations `Timeout` option type to `crud.OptFloat64`
    instead of `crud.OptUint` (#342).

    Change all `Upsert` and `Update` requests to accept
    `*tarantool.Operations`  as `ops` parameters instead of
    `interface{}` (#348).

    Change `OverrideSchema(*Schema)` to `SetSchema(Schema)` (#7).

    Change values, stored by pointers in the `Schema`, `Space`,
    `Index` structs,  to be stored by their values (#7).

    Make `Dialer` mandatory for creation a single connection (#321).

    Remove `Connection.RemoteAddr()`, `Connection.LocalAddr()`.
    Add `Addr()` function instead (#321).

    Remove `Connection.ClientProtocolInfo`,
    `Connection.ServerProtocolInfo`. Add `ProtocolInfo()` function
    instead, which returns the server protocol info (#321).

    `NewWatcher` checks the actual features of the server, rather
    than relying on the features provided by the user during connection
    creation (#321).

    `pool.NewWatcher` does not create watchers for connections that do
    not support it (#321).

    Rename `pool.GetPoolInfo` to `pool.GetInfo`. Change return type to
    `map[string]ConnectionInfo` (#321).

    `Response` is now an interface (#237).

    All responses are now implementations of the `Response`
    interface (#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 (#237). It
    returns the information if the current response is a
    `PushResponse`. `PushCode` constant is removed.

    Method `Get` for `Future` now returns response data (#237). To get
    the actual response new `GetResponse` method has been added.
    Methods `AppendPush` and `SetResponse` accept response `Header`
    and data as their arguments.

    `Future` constructors now accept `Request` as their argument
    (#237).

    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 (#237).

    `pool.Connect`, `pool.ConnetcWithOpts` and `pool.Add` use a
    new type `pool.Instance` to determinate connection options (#356).

    `pool.Connect`, `pool.ConnectWithOpts` and `pool.Add` add
    connections to the pool even it is unable to connect to it (#372).

    Required Go version from `1.13` to `1.20` (#378).

    multi subpackage is removed (#240).

    msgpack.v2 support is removed (#236).

    pool/RoundRobinStrategy is removed (#158).

    DeadlineIO is removed (#158).

    UUID_extId is removed (#158).

    IPROTO constants are removed (#158).

    Code() method from the Request interface is removed (#158).

    `Schema` field from the `Connection` struct is removed (#7).

    `OkCode` and `PushCode` constants is removed (#237).

    SSL support is removed (#301).

    `Future.Err()` method is removed (#382).

New features

    Type() method to the Request interface (#158).

    Enumeration types for RLimitAction/iterators (#158).

    IsNullable flag for Field (#302).

    Meaningful description for read/write socket errors (#129).

    Support `operation_data` in `crud.Error` (#330).

    Support `fetch_latest_metadata` option for crud requests with
    metadata (#335).

    Support `noreturn` option for data change crud requests (#335).

    Support `crud.schema` request (#336, #351).

    Support `IPROTO_WATCH_ONCE` request type for Tarantool
    version >= 3.0.0-alpha1 (#337).

    Support `yield_every` option for crud select requests (#350).

    Support `IPROTO_FEATURE_SPACE_AND_INDEX_NAMES` for Tarantool
    version >= 3.0.0-alpha1 (#338). It allows to use space and index
    names in requests instead of their IDs.

    `GetSchema` function to get the actual schema (#7).

    Support connection via an existing socket fd (#321).

    `Header` struct for the response header (#237). It can be accessed
    via `Header()` method of the `Response` interface.

   `Response` method added to the `Request` interface (#237).

   New `LogAppendPushFailed` connection log constant (#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 (#237).

   `AuthDialer` type for creating a dialer with authentication (#301).

   `ProtocolDialer` type for creating a dialer with `ProtocolInfo`
   receiving and  check (#301).

   `GreetingDialer` type for creating a dialer, that fills `Greeting`
   of a connection (#301).

   New method `Pool.DoInstance` to execute a request on a target
   instance in a pool (#376).

Bugfixes

    Race condition at roundRobinStrategy.GetNextConnection() (#309).

    Incorrect decoding of an MP_DECIMAL when the `scale` value is
    negative (#314).

    Incorrect options (`after`, `batch_size` and `force_map_call`)
    setup for crud.SelectRequest (#320).

    Incorrect options (`vshard_router`, `fields`, `bucket_id`, `mode`,
    `prefer_replica`, `balance`) setup for crud.GetRequest (#335).

    Splice update operation accepts 3 arguments instead of 5 (#348).

    Unable to use a slice of custom types as a slice of tuples or
    objects for `crud.*ManyRequest/crud.*ObjectManyRequest` (#365).

Testing

    More linters on CI (#310).

    Added an ability to mock connections for tests (#237). Added new
    types `MockDoer`, `MockRequest` to `test_helpers`.

    Fixed flaky decimal/TestSelect (#300).

    Fixed tests with crud 1.4.0 (#336).

    Fixed tests with case sensitive SQL (#341).

    Renamed `StrangerResponse` to `MockResponse` (#237).

Other

    All Connection.<Request>, Connection.<Request>Typed and
    Connection.<Request>Async methods are now deprecated. Instead you
    should use requests objects + Connection.Do() (#241).

    All ConnectionPool.<Request>, ConnectionPool.<Request>Typed and
    ConnectionPool.<Request>Async methods are now deprecated. Instead
    you should use requests objects + ConnectionPool.Do() (#241).

    box.session.push() usage is deprecated: Future.AppendPush() and
    Future.GetIterator() methods, ResponseIterator and
    TimeoutResponseIterator types (#324).

1. https://github.com/tarantool/go-tlsdialer
2. https://github.com/tarantool/go-tarantool/blob/master/MIGRATION.md
oleg-jukovec added a commit that referenced this issue Feb 12, 2024
Overview

    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[1] 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.
    * The `connection_pool` package renamed to `pool`.

    See the migration guide[2] for more details.

Breaking changes

    connection_pool renamed to pool (#239).

    Use msgpack/v5 instead of msgpack.v2 (#236).

    Call/NewCallRequest = Call17/NewCall17Request (#235).

    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 (#313).

    Use objects of the Decimal type instead of pointers (#238).

    Use objects of the Datetime type instead of pointers (#238).

    `connection.Connect` no longer return non-working connection
    objects (#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.

    `iproto.Feature` type now used instead of `ProtocolFeature` (#337).

    `iproto.IPROTO_FEATURE_` constants now used instead of local
    `Feature` constants for `protocol` (#337).

    Change `crud` operations `Timeout` option type to `crud.OptFloat64`
    instead of `crud.OptUint` (#342).

    Change all `Upsert` and `Update` requests to accept
    `*tarantool.Operations`  as `ops` parameters instead of
    `interface{}` (#348).

    Change `OverrideSchema(*Schema)` to `SetSchema(Schema)` (#7).

    Change values, stored by pointers in the `Schema`, `Space`,
    `Index` structs,  to be stored by their values (#7).

    Make `Dialer` mandatory for creation a single connection (#321).

    Remove `Connection.RemoteAddr()`, `Connection.LocalAddr()`.
    Add `Addr()` function instead (#321).

    Remove `Connection.ClientProtocolInfo`,
    `Connection.ServerProtocolInfo`. Add `ProtocolInfo()` function
    instead, which returns the server protocol info (#321).

    `NewWatcher` checks the actual features of the server, rather
    than relying on the features provided by the user during connection
    creation (#321).

    `pool.NewWatcher` does not create watchers for connections that do
    not support it (#321).

    Rename `pool.GetPoolInfo` to `pool.GetInfo`. Change return type to
    `map[string]ConnectionInfo` (#321).

    `Response` is now an interface (#237).

    All responses are now implementations of the `Response`
    interface (#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 (#237). It
    returns the information if the current response is a
    `PushResponse`. `PushCode` constant is removed.

    Method `Get` for `Future` now returns response data (#237). To get
    the actual response new `GetResponse` method has been added.
    Methods `AppendPush` and `SetResponse` accept response `Header`
    and data as their arguments.

    `Future` constructors now accept `Request` as their argument
    (#237).

    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 (#237).

    `pool.Connect`, `pool.ConnetcWithOpts` and `pool.Add` use a
    new type `pool.Instance` to determinate connection options (#356).

    `pool.Connect`, `pool.ConnectWithOpts` and `pool.Add` add
    connections to the pool even it is unable to connect to it (#372).

    Required Go version from `1.13` to `1.20` (#378).

    multi subpackage is removed (#240).

    msgpack.v2 support is removed (#236).

    pool/RoundRobinStrategy is removed (#158).

    DeadlineIO is removed (#158).

    UUID_extId is removed (#158).

    IPROTO constants are removed (#158).

    Code() method from the Request interface is removed (#158).

    `Schema` field from the `Connection` struct is removed (#7).

    `OkCode` and `PushCode` constants is removed (#237).

    SSL support is removed (#301).

    `Future.Err()` method is removed (#382).

New features

    Type() method to the Request interface (#158).

    Enumeration types for RLimitAction/iterators (#158).

    IsNullable flag for Field (#302).

    Meaningful description for read/write socket errors (#129).

    Support `operation_data` in `crud.Error` (#330).

    Support `fetch_latest_metadata` option for crud requests with
    metadata (#335).

    Support `noreturn` option for data change crud requests (#335).

    Support `crud.schema` request (#336, #351).

    Support `IPROTO_WATCH_ONCE` request type for Tarantool
    version >= 3.0.0-alpha1 (#337).

    Support `yield_every` option for crud select requests (#350).

    Support `IPROTO_FEATURE_SPACE_AND_INDEX_NAMES` for Tarantool
    version >= 3.0.0-alpha1 (#338). It allows to use space and index
    names in requests instead of their IDs.

    `GetSchema` function to get the actual schema (#7).

    Support connection via an existing socket fd (#321).

    `Header` struct for the response header (#237). It can be accessed
    via `Header()` method of the `Response` interface.

   `Response` method added to the `Request` interface (#237).

   New `LogAppendPushFailed` connection log constant (#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 (#237).

   `AuthDialer` type for creating a dialer with authentication (#301).

   `ProtocolDialer` type for creating a dialer with `ProtocolInfo`
   receiving and  check (#301).

   `GreetingDialer` type for creating a dialer, that fills `Greeting`
   of a connection (#301).

   New method `Pool.DoInstance` to execute a request on a target
   instance in a pool (#376).

Bugfixes

    Race condition at roundRobinStrategy.GetNextConnection() (#309).

    Incorrect decoding of an MP_DECIMAL when the `scale` value is
    negative (#314).

    Incorrect options (`after`, `batch_size` and `force_map_call`)
    setup for crud.SelectRequest (#320).

    Incorrect options (`vshard_router`, `fields`, `bucket_id`, `mode`,
    `prefer_replica`, `balance`) setup for crud.GetRequest (#335).

    Splice update operation accepts 3 arguments instead of 5 (#348).

    Unable to use a slice of custom types as a slice of tuples or
    objects for `crud.*ManyRequest/crud.*ObjectManyRequest` (#365).

Testing

    More linters on CI (#310).

    Added an ability to mock connections for tests (#237). Added new
    types `MockDoer`, `MockRequest` to `test_helpers`.

    Fixed flaky decimal/TestSelect (#300).

    Fixed tests with crud 1.4.0 (#336).

    Fixed tests with case sensitive SQL (#341).

    Renamed `StrangerResponse` to `MockResponse` (#237).

Other

    All Connection.<Request>, Connection.<Request>Typed and
    Connection.<Request>Async methods are now deprecated. Instead you
    should use requests objects + Connection.Do() (#241).

    All ConnectionPool.<Request>, ConnectionPool.<Request>Typed and
    ConnectionPool.<Request>Async methods are now deprecated. Instead
    you should use requests objects + ConnectionPool.Do() (#241).

    box.session.push() usage is deprecated: Future.AppendPush() and
    Future.GetIterator() methods, ResponseIterator and
    TimeoutResponseIterator types (#324).

1. https://github.com/tarantool/go-tlsdialer
2. https://github.com/tarantool/go-tarantool/blob/master/MIGRATION.md
oleg-jukovec added a commit that referenced this issue Feb 12, 2024
Overview

    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[1] 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.
    * The `connection_pool` package renamed to `pool`.

    See the migration guide[2] for more details.

Breaking changes

    connection_pool renamed to pool (#239).

    Use msgpack/v5 instead of msgpack.v2 (#236).

    Call/NewCallRequest = Call17/NewCall17Request (#235).

    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 (#313).

    Use objects of the Decimal type instead of pointers (#238).

    Use objects of the Datetime type instead of pointers (#238).

    `connection.Connect` no longer return non-working connection
    objects (#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.

    `iproto.Feature` type now used instead of `ProtocolFeature` (#337).

    `iproto.IPROTO_FEATURE_` constants now used instead of local
    `Feature` constants for `protocol` (#337).

    Change `crud` operations `Timeout` option type to `crud.OptFloat64`
    instead of `crud.OptUint` (#342).

    Change all `Upsert` and `Update` requests to accept
    `*tarantool.Operations`  as `ops` parameters instead of
    `interface{}` (#348).

    Change `OverrideSchema(*Schema)` to `SetSchema(Schema)` (#7).

    Change values, stored by pointers in the `Schema`, `Space`,
    `Index` structs,  to be stored by their values (#7).

    Make `Dialer` mandatory for creation a single connection (#321).

    Remove `Connection.RemoteAddr()`, `Connection.LocalAddr()`.
    Add `Addr()` function instead (#321).

    Remove `Connection.ClientProtocolInfo`,
    `Connection.ServerProtocolInfo`. Add `ProtocolInfo()` function
    instead, which returns the server protocol info (#321).

    `NewWatcher` checks the actual features of the server, rather
    than relying on the features provided by the user during connection
    creation (#321).

    `pool.NewWatcher` does not create watchers for connections that do
    not support it (#321).

    Rename `pool.GetPoolInfo` to `pool.GetInfo`. Change return type to
    `map[string]ConnectionInfo` (#321).

    `Response` is now an interface (#237).

    All responses are now implementations of the `Response`
    interface (#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 (#237). It
    returns the information if the current response is a
    `PushResponse`. `PushCode` constant is removed.

    Method `Get` for `Future` now returns response data (#237). To get
    the actual response new `GetResponse` method has been added.
    Methods `AppendPush` and `SetResponse` accept response `Header`
    and data as their arguments.

    `Future` constructors now accept `Request` as their argument
    (#237).

    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 (#237).

    `pool.Connect`, `pool.ConnetcWithOpts` and `pool.Add` use a
    new type `pool.Instance` to determinate connection options (#356).

    `pool.Connect`, `pool.ConnectWithOpts` and `pool.Add` add
    connections to the pool even it is unable to connect to it (#372).

    Required Go version from `1.13` to `1.20` (#378).

    multi subpackage is removed (#240).

    msgpack.v2 support is removed (#236).

    pool/RoundRobinStrategy is removed (#158).

    DeadlineIO is removed (#158).

    UUID_extId is removed (#158).

    IPROTO constants are removed (#158).

    Code() method from the Request interface is removed (#158).

    `Schema` field from the `Connection` struct is removed (#7).

    `OkCode` and `PushCode` constants is removed (#237).

    SSL support is removed (#301).

    `Future.Err()` method is removed (#382).

New features

    Type() method to the Request interface (#158).

    Enumeration types for RLimitAction/iterators (#158).

    IsNullable flag for Field (#302).

    Meaningful description for read/write socket errors (#129).

    Support `operation_data` in `crud.Error` (#330).

    Support `fetch_latest_metadata` option for crud requests with
    metadata (#335).

    Support `noreturn` option for data change crud requests (#335).

    Support `crud.schema` request (#336, #351).

    Support `IPROTO_WATCH_ONCE` request type for Tarantool
    version >= 3.0.0-alpha1 (#337).

    Support `yield_every` option for crud select requests (#350).

    Support `IPROTO_FEATURE_SPACE_AND_INDEX_NAMES` for Tarantool
    version >= 3.0.0-alpha1 (#338). It allows to use space and index
    names in requests instead of their IDs.

    `GetSchema` function to get the actual schema (#7).

    Support connection via an existing socket fd (#321).

    `Header` struct for the response header (#237). It can be accessed
    via `Header()` method of the `Response` interface.

   `Response` method added to the `Request` interface (#237).

   New `LogAppendPushFailed` connection log constant (#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 (#237).

   `AuthDialer` type for creating a dialer with authentication (#301).

   `ProtocolDialer` type for creating a dialer with `ProtocolInfo`
   receiving and  check (#301).

   `GreetingDialer` type for creating a dialer, that fills `Greeting`
   of a connection (#301).

   New method `Pool.DoInstance` to execute a request on a target
   instance in a pool (#376).

Bugfixes

    Race condition at roundRobinStrategy.GetNextConnection() (#309).

    Incorrect decoding of an MP_DECIMAL when the `scale` value is
    negative (#314).

    Incorrect options (`after`, `batch_size` and `force_map_call`)
    setup for crud.SelectRequest (#320).

    Incorrect options (`vshard_router`, `fields`, `bucket_id`, `mode`,
    `prefer_replica`, `balance`) setup for crud.GetRequest (#335).

    Splice update operation accepts 3 arguments instead of 5 (#348).

    Unable to use a slice of custom types as a slice of tuples or
    objects for `crud.*ManyRequest/crud.*ObjectManyRequest` (#365).

Testing

    More linters on CI (#310).

    Added an ability to mock connections for tests (#237). Added new
    types `MockDoer`, `MockRequest` to `test_helpers`.

    Fixed flaky decimal/TestSelect (#300).

    Fixed tests with crud 1.4.0 (#336).

    Fixed tests with case sensitive SQL (#341).

    Renamed `StrangerResponse` to `MockResponse` (#237).

Other

    All Connection.<Request>, Connection.<Request>Typed and
    Connection.<Request>Async methods are now deprecated. Instead you
    should use requests objects + Connection.Do() (#241).

    All ConnectionPool.<Request>, ConnectionPool.<Request>Typed and
    ConnectionPool.<Request>Async methods are now deprecated. Instead
    you should use requests objects + ConnectionPool.Do() (#241).

    box.session.push() usage is deprecated: Future.AppendPush() and
    Future.GetIterator() methods, ResponseIterator and
    TimeoutResponseIterator types (#324).

1. https://github.com/tarantool/go-tlsdialer
2. https://github.com/tarantool/go-tarantool/blob/master/MIGRATION.md
oleg-jukovec added a commit that referenced this issue Feb 12, 2024
Overview

    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[1] 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.
    * The `connection_pool` package renamed to `pool`.

    See the migration guide[2] for more details.

Breaking changes

    connection_pool renamed to pool (#239).

    Use msgpack/v5 instead of msgpack.v2 (#236).

    Call/NewCallRequest = Call17/NewCall17Request (#235).

    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 (#313).

    Use objects of the Decimal type instead of pointers (#238).

    Use objects of the Datetime type instead of pointers (#238).

    `connection.Connect` no longer return non-working connection
    objects (#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.

    `iproto.Feature` type now used instead of `ProtocolFeature` (#337).

    `iproto.IPROTO_FEATURE_` constants now used instead of local
    `Feature` constants for `protocol` (#337).

    Change `crud` operations `Timeout` option type to `crud.OptFloat64`
    instead of `crud.OptUint` (#342).

    Change all `Upsert` and `Update` requests to accept
    `*tarantool.Operations`  as `ops` parameters instead of
    `interface{}` (#348).

    Change `OverrideSchema(*Schema)` to `SetSchema(Schema)` (#7).

    Change values, stored by pointers in the `Schema`, `Space`,
    `Index` structs,  to be stored by their values (#7).

    Make `Dialer` mandatory for creation a single connection (#321).

    Remove `Connection.RemoteAddr()`, `Connection.LocalAddr()`.
    Add `Addr()` function instead (#321).

    Remove `Connection.ClientProtocolInfo`,
    `Connection.ServerProtocolInfo`. Add `ProtocolInfo()` function
    instead, which returns the server protocol info (#321).

    `NewWatcher` checks the actual features of the server, rather
    than relying on the features provided by the user during connection
    creation (#321).

    `pool.NewWatcher` does not create watchers for connections that do
    not support it (#321).

    Rename `pool.GetPoolInfo` to `pool.GetInfo`. Change return type to
    `map[string]ConnectionInfo` (#321).

    `Response` is now an interface (#237).

    All responses are now implementations of the `Response`
    interface (#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 (#237). It
    returns the information if the current response is a
    `PushResponse`. `PushCode` constant is removed.

    Method `Get` for `Future` now returns response data (#237). To get
    the actual response new `GetResponse` method has been added.
    Methods `AppendPush` and `SetResponse` accept response `Header`
    and data as their arguments.

    `Future` constructors now accept `Request` as their argument
    (#237).

    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 (#237).

    `pool.Connect`, `pool.ConnetcWithOpts` and `pool.Add` use a
    new type `pool.Instance` to determinate connection options (#356).

    `pool.Connect`, `pool.ConnectWithOpts` and `pool.Add` add
    connections to the pool even it is unable to connect to it (#372).

    Required Go version from `1.13` to `1.20` (#378).

    multi subpackage is removed (#240).

    msgpack.v2 support is removed (#236).

    pool/RoundRobinStrategy is removed (#158).

    DeadlineIO is removed (#158).

    UUID_extId is removed (#158).

    IPROTO constants are removed (#158).

    Code() method from the Request interface is removed (#158).

    `Schema` field from the `Connection` struct is removed (#7).

    `OkCode` and `PushCode` constants is removed (#237).

    SSL support is removed (#301).

    `Future.Err()` method is removed (#382).

New features

    Type() method to the Request interface (#158).

    Enumeration types for RLimitAction/iterators (#158).

    IsNullable flag for Field (#302).

    Meaningful description for read/write socket errors (#129).

    Support `operation_data` in `crud.Error` (#330).

    Support `fetch_latest_metadata` option for crud requests with
    metadata (#335).

    Support `noreturn` option for data change crud requests (#335).

    Support `crud.schema` request (#336, #351).

    Support `IPROTO_WATCH_ONCE` request type for Tarantool
    version >= 3.0.0-alpha1 (#337).

    Support `yield_every` option for crud select requests (#350).

    Support `IPROTO_FEATURE_SPACE_AND_INDEX_NAMES` for Tarantool
    version >= 3.0.0-alpha1 (#338). It allows to use space and index
    names in requests instead of their IDs.

    `GetSchema` function to get the actual schema (#7).

    Support connection via an existing socket fd (#321).

    `Header` struct for the response header (#237). It can be accessed
    via `Header()` method of the `Response` interface.

   `Response` method added to the `Request` interface (#237).

   New `LogAppendPushFailed` connection log constant (#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 (#237).

   `AuthDialer` type for creating a dialer with authentication (#301).

   `ProtocolDialer` type for creating a dialer with `ProtocolInfo`
   receiving and  check (#301).

   `GreetingDialer` type for creating a dialer, that fills `Greeting`
   of a connection (#301).

   New method `Pool.DoInstance` to execute a request on a target
   instance in a pool (#376).

Bugfixes

    Race condition at roundRobinStrategy.GetNextConnection() (#309).

    Incorrect decoding of an MP_DECIMAL when the `scale` value is
    negative (#314).

    Incorrect options (`after`, `batch_size` and `force_map_call`)
    setup for crud.SelectRequest (#320).

    Incorrect options (`vshard_router`, `fields`, `bucket_id`, `mode`,
    `prefer_replica`, `balance`) setup for crud.GetRequest (#335).

    Splice update operation accepts 3 arguments instead of 5 (#348).

    Unable to use a slice of custom types as a slice of tuples or
    objects for `crud.*ManyRequest/crud.*ObjectManyRequest` (#365).

Testing

    More linters on CI (#310).

    Added an ability to mock connections for tests (#237). Added new
    types `MockDoer`, `MockRequest` to `test_helpers`.

    Fixed flaky decimal/TestSelect (#300).

    Fixed tests with crud 1.4.0 (#336).

    Fixed tests with case sensitive SQL (#341).

    Renamed `StrangerResponse` to `MockResponse` (#237).

Other

    All Connection.<Request>, Connection.<Request>Typed and
    Connection.<Request>Async methods are now deprecated. Instead you
    should use requests objects + Connection.Do() (#241).

    All ConnectionPool.<Request>, ConnectionPool.<Request>Typed and
    ConnectionPool.<Request>Async methods are now deprecated. Instead
    you should use requests objects + ConnectionPool.Do() (#241).

    box.session.push() usage is deprecated: Future.AppendPush() and
    Future.GetIterator() methods, ResponseIterator and
    TimeoutResponseIterator types (#324).

1. https://github.com/tarantool/go-tlsdialer
2. https://github.com/tarantool/go-tarantool/blob/master/MIGRATION.md
oleg-jukovec added a commit that referenced this issue Feb 12, 2024
Overview

    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[1] 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.
    * The `connection_pool` package renamed to `pool`.

    See the migration guide[2] for more details.

Breaking changes

    connection_pool renamed to pool (#239).

    Use msgpack/v5 instead of msgpack.v2 (#236).

    Call/NewCallRequest = Call17/NewCall17Request (#235).

    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 (#313).

    Use objects of the Decimal type instead of pointers (#238).

    Use objects of the Datetime type instead of pointers (#238).

    `connection.Connect` no longer return non-working connection
    objects (#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.

    `iproto.Feature` type now used instead of `ProtocolFeature` (#337).

    `iproto.IPROTO_FEATURE_` constants now used instead of local
    `Feature` constants for `protocol` (#337).

    Change `crud` operations `Timeout` option type to `crud.OptFloat64`
    instead of `crud.OptUint` (#342).

    Change all `Upsert` and `Update` requests to accept
    `*tarantool.Operations`  as `ops` parameters instead of
    `interface{}` (#348).

    Change `OverrideSchema(*Schema)` to `SetSchema(Schema)` (#7).

    Change values, stored by pointers in the `Schema`, `Space`,
    `Index` structs,  to be stored by their values (#7).

    Make `Dialer` mandatory for creation a single connection (#321).

    Remove `Connection.RemoteAddr()`, `Connection.LocalAddr()`.
    Add `Addr()` function instead (#321).

    Remove `Connection.ClientProtocolInfo`,
    `Connection.ServerProtocolInfo`. Add `ProtocolInfo()` function
    instead, which returns the server protocol info (#321).

    `NewWatcher` checks the actual features of the server, rather
    than relying on the features provided by the user during connection
    creation (#321).

    `pool.NewWatcher` does not create watchers for connections that do
    not support it (#321).

    Rename `pool.GetPoolInfo` to `pool.GetInfo`. Change return type to
    `map[string]ConnectionInfo` (#321).

    `Response` is now an interface (#237).

    All responses are now implementations of the `Response`
    interface (#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 (#237). It
    returns the information if the current response is a
    `PushResponse`. `PushCode` constant is removed.

    Method `Get` for `Future` now returns response data (#237). To get
    the actual response new `GetResponse` method has been added.
    Methods `AppendPush` and `SetResponse` accept response `Header`
    and data as their arguments.

    `Future` constructors now accept `Request` as their argument
    (#237).

    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 (#237).

    `pool.Connect`, `pool.ConnetcWithOpts` and `pool.Add` use a
    new type `pool.Instance` to determinate connection options (#356).

    `pool.Connect`, `pool.ConnectWithOpts` and `pool.Add` add
    connections to the pool even it is unable to connect to it (#372).

    Required Go version from `1.13` to `1.20` (#378).

    multi subpackage is removed (#240).

    msgpack.v2 support is removed (#236).

    pool/RoundRobinStrategy is removed (#158).

    DeadlineIO is removed (#158).

    UUID_extId is removed (#158).

    IPROTO constants are removed (#158).

    Code() method from the Request interface is removed (#158).

    `Schema` field from the `Connection` struct is removed (#7).

    `OkCode` and `PushCode` constants is removed (#237).

    SSL support is removed (#301).

    `Future.Err()` method is removed (#382).

New features

    Type() method to the Request interface (#158).

    Enumeration types for RLimitAction/iterators (#158).

    IsNullable flag for Field (#302).

    Meaningful description for read/write socket errors (#129).

    Support `operation_data` in `crud.Error` (#330).

    Support `fetch_latest_metadata` option for crud requests with
    metadata (#335).

    Support `noreturn` option for data change crud requests (#335).

    Support `crud.schema` request (#336, #351).

    Support `IPROTO_WATCH_ONCE` request type for Tarantool
    version >= 3.0.0-alpha1 (#337).

    Support `yield_every` option for crud select requests (#350).

    Support `IPROTO_FEATURE_SPACE_AND_INDEX_NAMES` for Tarantool
    version >= 3.0.0-alpha1 (#338). It allows to use space and index
    names in requests instead of their IDs.

    `GetSchema` function to get the actual schema (#7).

    Support connection via an existing socket fd (#321).

    `Header` struct for the response header (#237). It can be accessed
    via `Header()` method of the `Response` interface.

   `Response` method added to the `Request` interface (#237).

   New `LogAppendPushFailed` connection log constant (#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 (#237).

   `AuthDialer` type for creating a dialer with authentication (#301).

   `ProtocolDialer` type for creating a dialer with `ProtocolInfo`
   receiving and  check (#301).

   `GreetingDialer` type for creating a dialer, that fills `Greeting`
   of a connection (#301).

   New method `Pool.DoInstance` to execute a request on a target
   instance in a pool (#376).

Bugfixes

    Race condition at roundRobinStrategy.GetNextConnection() (#309).

    Incorrect decoding of an MP_DECIMAL when the `scale` value is
    negative (#314).

    Incorrect options (`after`, `batch_size` and `force_map_call`)
    setup for crud.SelectRequest (#320).

    Incorrect options (`vshard_router`, `fields`, `bucket_id`, `mode`,
    `prefer_replica`, `balance`) setup for crud.GetRequest (#335).

    Splice update operation accepts 3 arguments instead of 5 (#348).

    Unable to use a slice of custom types as a slice of tuples or
    objects for `crud.*ManyRequest/crud.*ObjectManyRequest` (#365).

Testing

    More linters on CI (#310).

    Added an ability to mock connections for tests (#237). Added new
    types `MockDoer`, `MockRequest` to `test_helpers`.

    Fixed flaky decimal/TestSelect (#300).

    Fixed tests with crud 1.4.0 (#336).

    Fixed tests with case sensitive SQL (#341).

    Renamed `StrangerResponse` to `MockResponse` (#237).

Other

    All Connection.<Request>, Connection.<Request>Typed and
    Connection.<Request>Async methods are now deprecated. Instead you
    should use requests objects + Connection.Do() (#241).

    All ConnectionPool.<Request>, ConnectionPool.<Request>Typed and
    ConnectionPool.<Request>Async methods are now deprecated. Instead
    you should use requests objects + ConnectionPool.Do() (#241).

    box.session.push() usage is deprecated: Future.AppendPush() and
    Future.GetIterator() methods, ResponseIterator and
    TimeoutResponseIterator types (#324).

1. https://github.com/tarantool/go-tlsdialer
2. https://github.com/tarantool/go-tarantool/blob/master/MIGRATION.md
oleg-jukovec added a commit that referenced this issue Feb 12, 2024
Overview

    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[1] 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.
    * The `connection_pool` package renamed to `pool`.

    See the migration guide[2] for more details.

Breaking changes

    connection_pool renamed to pool (#239).

    Use msgpack/v5 instead of msgpack.v2 (#236).

    Call/NewCallRequest = Call17/NewCall17Request (#235).

    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 (#313).

    Use objects of the Decimal type instead of pointers (#238).

    Use objects of the Datetime type instead of pointers (#238).

    `connection.Connect` no longer return non-working connection
    objects (#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.

    `iproto.Feature` type now used instead of `ProtocolFeature` (#337).

    `iproto.IPROTO_FEATURE_` constants now used instead of local
    `Feature` constants for `protocol` (#337).

    Change `crud` operations `Timeout` option type to `crud.OptFloat64`
    instead of `crud.OptUint` (#342).

    Change all `Upsert` and `Update` requests to accept
    `*tarantool.Operations`  as `ops` parameters instead of
    `interface{}` (#348).

    Change `OverrideSchema(*Schema)` to `SetSchema(Schema)` (#7).

    Change values, stored by pointers in the `Schema`, `Space`,
    `Index` structs,  to be stored by their values (#7).

    Make `Dialer` mandatory for creation a single connection (#321).

    Remove `Connection.RemoteAddr()`, `Connection.LocalAddr()`.
    Add `Addr()` function instead (#321).

    Remove `Connection.ClientProtocolInfo`,
    `Connection.ServerProtocolInfo`. Add `ProtocolInfo()` function
    instead, which returns the server protocol info (#321).

    `NewWatcher` checks the actual features of the server, rather
    than relying on the features provided by the user during connection
    creation (#321).

    `pool.NewWatcher` does not create watchers for connections that do
    not support it (#321).

    Rename `pool.GetPoolInfo` to `pool.GetInfo`. Change return type to
    `map[string]ConnectionInfo` (#321).

    `Response` is now an interface (#237).

    All responses are now implementations of the `Response`
    interface (#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 (#237). It
    returns the information if the current response is a
    `PushResponse`. `PushCode` constant is removed.

    Method `Get` for `Future` now returns response data (#237). To get
    the actual response new `GetResponse` method has been added.
    Methods `AppendPush` and `SetResponse` accept response `Header`
    and data as their arguments.

    `Future` constructors now accept `Request` as their argument
    (#237).

    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 (#237).

    `pool.Connect`, `pool.ConnetcWithOpts` and `pool.Add` use a
    new type `pool.Instance` to determinate connection options (#356).

    `pool.Connect`, `pool.ConnectWithOpts` and `pool.Add` add
    connections to the pool even it is unable to connect to it (#372).

    Required Go version from `1.13` to `1.20` (#378).

    multi subpackage is removed (#240).

    msgpack.v2 support is removed (#236).

    pool/RoundRobinStrategy is removed (#158).

    DeadlineIO is removed (#158).

    UUID_extId is removed (#158).

    IPROTO constants are removed (#158).

    Code() method from the Request interface is removed (#158).

    `Schema` field from the `Connection` struct is removed (#7).

    `OkCode` and `PushCode` constants is removed (#237).

    SSL support is removed (#301).

    `Future.Err()` method is removed (#382).

New features

    Type() method to the Request interface (#158).

    Enumeration types for RLimitAction/iterators (#158).

    IsNullable flag for Field (#302).

    Meaningful description for read/write socket errors (#129).

    Support `operation_data` in `crud.Error` (#330).

    Support `fetch_latest_metadata` option for crud requests with
    metadata (#335).

    Support `noreturn` option for data change crud requests (#335).

    Support `crud.schema` request (#336, #351).

    Support `IPROTO_WATCH_ONCE` request type for Tarantool
    version >= 3.0.0-alpha1 (#337).

    Support `yield_every` option for crud select requests (#350).

    Support `IPROTO_FEATURE_SPACE_AND_INDEX_NAMES` for Tarantool
    version >= 3.0.0-alpha1 (#338). It allows to use space and index
    names in requests instead of their IDs.

    `GetSchema` function to get the actual schema (#7).

    Support connection via an existing socket fd (#321).

    `Header` struct for the response header (#237). It can be accessed
    via `Header()` method of the `Response` interface.

   `Response` method added to the `Request` interface (#237).

   New `LogAppendPushFailed` connection log constant (#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 (#237).

   `AuthDialer` type for creating a dialer with authentication (#301).

   `ProtocolDialer` type for creating a dialer with `ProtocolInfo`
   receiving and  check (#301).

   `GreetingDialer` type for creating a dialer, that fills `Greeting`
   of a connection (#301).

   New method `Pool.DoInstance` to execute a request on a target
   instance in a pool (#376).

Bugfixes

    Race condition at roundRobinStrategy.GetNextConnection() (#309).

    Incorrect decoding of an MP_DECIMAL when the `scale` value is
    negative (#314).

    Incorrect options (`after`, `batch_size` and `force_map_call`)
    setup for crud.SelectRequest (#320).

    Incorrect options (`vshard_router`, `fields`, `bucket_id`, `mode`,
    `prefer_replica`, `balance`) setup for crud.GetRequest (#335).

    Splice update operation accepts 3 arguments instead of 5 (#348).

    Unable to use a slice of custom types as a slice of tuples or
    objects for `crud.*ManyRequest/crud.*ObjectManyRequest` (#365).

Testing

    More linters on CI (#310).

    Added an ability to mock connections for tests (#237). Added new
    types `MockDoer`, `MockRequest` to `test_helpers`.

    Fixed flaky decimal/TestSelect (#300).

    Fixed tests with crud 1.4.0 (#336).

    Fixed tests with case sensitive SQL (#341).

    Renamed `StrangerResponse` to `MockResponse` (#237).

Other

    All Connection.<Request>, Connection.<Request>Typed and
    Connection.<Request>Async methods are now deprecated. Instead you
    should use requests objects + Connection.Do() (#241).

    All ConnectionPool.<Request>, ConnectionPool.<Request>Typed and
    ConnectionPool.<Request>Async methods are now deprecated. Instead
    you should use requests objects + ConnectionPool.Do() (#241).

    box.session.push() usage is deprecated: Future.AppendPush() and
    Future.GetIterator() methods, ResponseIterator and
    TimeoutResponseIterator types (#324).

1. https://github.com/tarantool/go-tlsdialer
2. https://github.com/tarantool/go-tarantool/blob/master/MIGRATION.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1sp documentation Improvements or additions to documentation teamE
Projects
None yet
Development

No branches or pull requests

3 participants