// Code generated by gtrace. DO NOT EDIT.

package trace

import (
	"context"

	"github.com/ydb-platform/ydb-go-genproto/protos/Ydb_TableStats"
)

// queryComposeOptions is a holder of options
type queryComposeOptions struct {
	panicCallback func(e interface{})
}

// QueryOption specified Query compose option
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
type QueryComposeOption func(o *queryComposeOptions)

// WithQueryPanicCallback specified behavior on panic
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func WithQueryPanicCallback(cb func(e interface{})) QueryComposeOption {
	return func(o *queryComposeOptions) {
		o.panicCallback = cb
	}
}

// Compose returns a new Query which has functional fields composed both from t and x.
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func (t *Query) Compose(x *Query, opts ...QueryComposeOption) *Query {
	if t == nil {
		return x
	}
	var ret Query
	options := queryComposeOptions{}
	for _, opt := range opts {
		if opt != nil {
			opt(&options)
		}
	}
	{
		h1 := t.OnNew
		h2 := x.OnNew
		ret.OnNew = func(q QueryNewStartInfo) func(QueryNewDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QueryNewDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(info QueryNewDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(info)
				}
				if r1 != nil {
					r1(info)
				}
			}
		}
	}
	{
		h1 := t.OnClose
		h2 := x.OnClose
		ret.OnClose = func(q QueryCloseStartInfo) func(QueryCloseDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QueryCloseDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(info QueryCloseDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(info)
				}
				if r1 != nil {
					r1(info)
				}
			}
		}
	}
	{
		h1 := t.OnPoolNew
		h2 := x.OnPoolNew
		ret.OnPoolNew = func(q QueryPoolNewStartInfo) func(QueryPoolNewDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QueryPoolNewDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(q QueryPoolNewDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(q)
				}
				if r1 != nil {
					r1(q)
				}
			}
		}
	}
	{
		h1 := t.OnPoolClose
		h2 := x.OnPoolClose
		ret.OnPoolClose = func(q QueryPoolCloseStartInfo) func(QueryPoolCloseDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QueryPoolCloseDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(q QueryPoolCloseDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(q)
				}
				if r1 != nil {
					r1(q)
				}
			}
		}
	}
	{
		h1 := t.OnPoolTry
		h2 := x.OnPoolTry
		ret.OnPoolTry = func(q QueryPoolTryStartInfo) func(QueryPoolTryDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QueryPoolTryDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(q QueryPoolTryDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(q)
				}
				if r1 != nil {
					r1(q)
				}
			}
		}
	}
	{
		h1 := t.OnPoolWith
		h2 := x.OnPoolWith
		ret.OnPoolWith = func(q QueryPoolWithStartInfo) func(QueryPoolWithDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QueryPoolWithDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(q QueryPoolWithDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(q)
				}
				if r1 != nil {
					r1(q)
				}
			}
		}
	}
	{
		h1 := t.OnPoolPut
		h2 := x.OnPoolPut
		ret.OnPoolPut = func(q QueryPoolPutStartInfo) func(QueryPoolPutDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QueryPoolPutDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(q QueryPoolPutDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(q)
				}
				if r1 != nil {
					r1(q)
				}
			}
		}
	}
	{
		h1 := t.OnPoolGet
		h2 := x.OnPoolGet
		ret.OnPoolGet = func(q QueryPoolGetStartInfo) func(QueryPoolGetDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QueryPoolGetDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(q QueryPoolGetDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(q)
				}
				if r1 != nil {
					r1(q)
				}
			}
		}
	}
	{
		h1 := t.OnPoolChange
		h2 := x.OnPoolChange
		ret.OnPoolChange = func(q QueryPoolChange) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(q)
			}
			if h2 != nil {
				h2(q)
			}
		}
	}
	{
		h1 := t.OnDo
		h2 := x.OnDo
		ret.OnDo = func(q QueryDoStartInfo) func(QueryDoDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QueryDoDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(q QueryDoDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(q)
				}
				if r1 != nil {
					r1(q)
				}
			}
		}
	}
	{
		h1 := t.OnDoTx
		h2 := x.OnDoTx
		ret.OnDoTx = func(q QueryDoTxStartInfo) func(QueryDoTxDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QueryDoTxDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(q QueryDoTxDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(q)
				}
				if r1 != nil {
					r1(q)
				}
			}
		}
	}
	{
		h1 := t.OnExec
		h2 := x.OnExec
		ret.OnExec = func(q QueryExecStartInfo) func(QueryExecDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QueryExecDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(q QueryExecDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(q)
				}
				if r1 != nil {
					r1(q)
				}
			}
		}
	}
	{
		h1 := t.OnQuery
		h2 := x.OnQuery
		ret.OnQuery = func(q QueryQueryStartInfo) func(QueryQueryDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QueryQueryDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(q QueryQueryDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(q)
				}
				if r1 != nil {
					r1(q)
				}
			}
		}
	}
	{
		h1 := t.OnQueryResultSet
		h2 := x.OnQueryResultSet
		ret.OnQueryResultSet = func(q QueryQueryResultSetStartInfo) func(QueryQueryResultSetDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QueryQueryResultSetDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(q QueryQueryResultSetDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(q)
				}
				if r1 != nil {
					r1(q)
				}
			}
		}
	}
	{
		h1 := t.OnQueryRow
		h2 := x.OnQueryRow
		ret.OnQueryRow = func(q QueryQueryRowStartInfo) func(QueryQueryRowDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QueryQueryRowDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(q QueryQueryRowDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(q)
				}
				if r1 != nil {
					r1(q)
				}
			}
		}
	}
	{
		h1 := t.OnSessionCreate
		h2 := x.OnSessionCreate
		ret.OnSessionCreate = func(q QuerySessionCreateStartInfo) func(QuerySessionCreateDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QuerySessionCreateDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(info QuerySessionCreateDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(info)
				}
				if r1 != nil {
					r1(info)
				}
			}
		}
	}
	{
		h1 := t.OnSessionAttach
		h2 := x.OnSessionAttach
		ret.OnSessionAttach = func(q QuerySessionAttachStartInfo) func(QuerySessionAttachDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QuerySessionAttachDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(info QuerySessionAttachDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(info)
				}
				if r1 != nil {
					r1(info)
				}
			}
		}
	}
	{
		h1 := t.OnSessionDelete
		h2 := x.OnSessionDelete
		ret.OnSessionDelete = func(q QuerySessionDeleteStartInfo) func(QuerySessionDeleteDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QuerySessionDeleteDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(info QuerySessionDeleteDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(info)
				}
				if r1 != nil {
					r1(info)
				}
			}
		}
	}
	{
		h1 := t.OnSessionExec
		h2 := x.OnSessionExec
		ret.OnSessionExec = func(q QuerySessionExecStartInfo) func(QuerySessionExecDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QuerySessionExecDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(info QuerySessionExecDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(info)
				}
				if r1 != nil {
					r1(info)
				}
			}
		}
	}
	{
		h1 := t.OnSessionQuery
		h2 := x.OnSessionQuery
		ret.OnSessionQuery = func(q QuerySessionQueryStartInfo) func(QuerySessionQueryDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QuerySessionQueryDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(info QuerySessionQueryDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(info)
				}
				if r1 != nil {
					r1(info)
				}
			}
		}
	}
	{
		h1 := t.OnSessionQueryResultSet
		h2 := x.OnSessionQueryResultSet
		ret.OnSessionQueryResultSet = func(q QuerySessionQueryResultSetStartInfo) func(QuerySessionQueryResultSetDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QuerySessionQueryResultSetDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(q QuerySessionQueryResultSetDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(q)
				}
				if r1 != nil {
					r1(q)
				}
			}
		}
	}
	{
		h1 := t.OnSessionQueryRow
		h2 := x.OnSessionQueryRow
		ret.OnSessionQueryRow = func(q QuerySessionQueryRowStartInfo) func(QuerySessionQueryRowDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QuerySessionQueryRowDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(q QuerySessionQueryRowDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(q)
				}
				if r1 != nil {
					r1(q)
				}
			}
		}
	}
	{
		h1 := t.OnSessionBegin
		h2 := x.OnSessionBegin
		ret.OnSessionBegin = func(q QuerySessionBeginStartInfo) func(QuerySessionBeginDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QuerySessionBeginDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(info QuerySessionBeginDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(info)
				}
				if r1 != nil {
					r1(info)
				}
			}
		}
	}
	{
		h1 := t.OnTxCommit
		h2 := x.OnTxCommit
		ret.OnTxCommit = func(q QueryTxCommitStartInfo) func(QueryTxCommitDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QueryTxCommitDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(info QueryTxCommitDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(info)
				}
				if r1 != nil {
					r1(info)
				}
			}
		}
	}
	{
		h1 := t.OnTxRollback
		h2 := x.OnTxRollback
		ret.OnTxRollback = func(q QueryTxRollbackStartInfo) func(QueryTxRollbackDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QueryTxRollbackDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(info QueryTxRollbackDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(info)
				}
				if r1 != nil {
					r1(info)
				}
			}
		}
	}
	{
		h1 := t.OnTxExec
		h2 := x.OnTxExec
		ret.OnTxExec = func(q QueryTxExecStartInfo) func(QueryTxExecDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QueryTxExecDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(info QueryTxExecDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(info)
				}
				if r1 != nil {
					r1(info)
				}
			}
		}
	}
	{
		h1 := t.OnTxQuery
		h2 := x.OnTxQuery
		ret.OnTxQuery = func(q QueryTxQueryStartInfo) func(QueryTxQueryDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QueryTxQueryDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(info QueryTxQueryDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(info)
				}
				if r1 != nil {
					r1(info)
				}
			}
		}
	}
	{
		h1 := t.OnTxQueryResultSet
		h2 := x.OnTxQueryResultSet
		ret.OnTxQueryResultSet = func(q QueryTxQueryResultSetStartInfo) func(QueryTxQueryResultSetDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QueryTxQueryResultSetDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(q QueryTxQueryResultSetDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(q)
				}
				if r1 != nil {
					r1(q)
				}
			}
		}
	}
	{
		h1 := t.OnTxQueryRow
		h2 := x.OnTxQueryRow
		ret.OnTxQueryRow = func(q QueryTxQueryRowStartInfo) func(QueryTxQueryRowDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QueryTxQueryRowDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(q QueryTxQueryRowDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(q)
				}
				if r1 != nil {
					r1(q)
				}
			}
		}
	}
	{
		h1 := t.OnResultNew
		h2 := x.OnResultNew
		ret.OnResultNew = func(q QueryResultNewStartInfo) func(QueryResultNewDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QueryResultNewDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(info QueryResultNewDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(info)
				}
				if r1 != nil {
					r1(info)
				}
			}
		}
	}
	{
		h1 := t.OnResultNextPart
		h2 := x.OnResultNextPart
		ret.OnResultNextPart = func(q QueryResultNextPartStartInfo) func(QueryResultNextPartDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QueryResultNextPartDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(info QueryResultNextPartDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(info)
				}
				if r1 != nil {
					r1(info)
				}
			}
		}
	}
	{
		h1 := t.OnResultNextResultSet
		h2 := x.OnResultNextResultSet
		ret.OnResultNextResultSet = func(q QueryResultNextResultSetStartInfo) func(QueryResultNextResultSetDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QueryResultNextResultSetDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(info QueryResultNextResultSetDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(info)
				}
				if r1 != nil {
					r1(info)
				}
			}
		}
	}
	{
		h1 := t.OnResultClose
		h2 := x.OnResultClose
		ret.OnResultClose = func(q QueryResultCloseStartInfo) func(QueryResultCloseDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(QueryResultCloseDoneInfo)
			if h1 != nil {
				r = h1(q)
			}
			if h2 != nil {
				r1 = h2(q)
			}
			return func(info QueryResultCloseDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(info)
				}
				if r1 != nil {
					r1(info)
				}
			}
		}
	}
	return &ret
}
func (t *Query) onNew(q QueryNewStartInfo) func(info QueryNewDoneInfo) {
	fn := t.OnNew
	if fn == nil {
		return func(QueryNewDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QueryNewDoneInfo) {
			return
		}
	}
	return res
}
func (t *Query) onClose(q QueryCloseStartInfo) func(info QueryCloseDoneInfo) {
	fn := t.OnClose
	if fn == nil {
		return func(QueryCloseDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QueryCloseDoneInfo) {
			return
		}
	}
	return res
}
func (t *Query) onPoolNew(q QueryPoolNewStartInfo) func(QueryPoolNewDoneInfo) {
	fn := t.OnPoolNew
	if fn == nil {
		return func(QueryPoolNewDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QueryPoolNewDoneInfo) {
			return
		}
	}
	return res
}
func (t *Query) onPoolClose(q QueryPoolCloseStartInfo) func(QueryPoolCloseDoneInfo) {
	fn := t.OnPoolClose
	if fn == nil {
		return func(QueryPoolCloseDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QueryPoolCloseDoneInfo) {
			return
		}
	}
	return res
}
func (t *Query) onPoolTry(q QueryPoolTryStartInfo) func(QueryPoolTryDoneInfo) {
	fn := t.OnPoolTry
	if fn == nil {
		return func(QueryPoolTryDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QueryPoolTryDoneInfo) {
			return
		}
	}
	return res
}
func (t *Query) onPoolWith(q QueryPoolWithStartInfo) func(QueryPoolWithDoneInfo) {
	fn := t.OnPoolWith
	if fn == nil {
		return func(QueryPoolWithDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QueryPoolWithDoneInfo) {
			return
		}
	}
	return res
}
func (t *Query) onPoolPut(q QueryPoolPutStartInfo) func(QueryPoolPutDoneInfo) {
	fn := t.OnPoolPut
	if fn == nil {
		return func(QueryPoolPutDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QueryPoolPutDoneInfo) {
			return
		}
	}
	return res
}
func (t *Query) onPoolGet(q QueryPoolGetStartInfo) func(QueryPoolGetDoneInfo) {
	fn := t.OnPoolGet
	if fn == nil {
		return func(QueryPoolGetDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QueryPoolGetDoneInfo) {
			return
		}
	}
	return res
}
func (t *Query) onPoolChange(q QueryPoolChange) {
	fn := t.OnPoolChange
	if fn == nil {
		return
	}
	fn(q)
}
func (t *Query) onDo(q QueryDoStartInfo) func(QueryDoDoneInfo) {
	fn := t.OnDo
	if fn == nil {
		return func(QueryDoDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QueryDoDoneInfo) {
			return
		}
	}
	return res
}
func (t *Query) onDoTx(q QueryDoTxStartInfo) func(QueryDoTxDoneInfo) {
	fn := t.OnDoTx
	if fn == nil {
		return func(QueryDoTxDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QueryDoTxDoneInfo) {
			return
		}
	}
	return res
}
func (t *Query) onExec(q QueryExecStartInfo) func(QueryExecDoneInfo) {
	fn := t.OnExec
	if fn == nil {
		return func(QueryExecDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QueryExecDoneInfo) {
			return
		}
	}
	return res
}
func (t *Query) onQuery(q QueryQueryStartInfo) func(QueryQueryDoneInfo) {
	fn := t.OnQuery
	if fn == nil {
		return func(QueryQueryDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QueryQueryDoneInfo) {
			return
		}
	}
	return res
}
func (t *Query) onQueryResultSet(q QueryQueryResultSetStartInfo) func(QueryQueryResultSetDoneInfo) {
	fn := t.OnQueryResultSet
	if fn == nil {
		return func(QueryQueryResultSetDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QueryQueryResultSetDoneInfo) {
			return
		}
	}
	return res
}
func (t *Query) onQueryRow(q QueryQueryRowStartInfo) func(QueryQueryRowDoneInfo) {
	fn := t.OnQueryRow
	if fn == nil {
		return func(QueryQueryRowDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QueryQueryRowDoneInfo) {
			return
		}
	}
	return res
}
func (t *Query) onSessionCreate(q QuerySessionCreateStartInfo) func(info QuerySessionCreateDoneInfo) {
	fn := t.OnSessionCreate
	if fn == nil {
		return func(QuerySessionCreateDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QuerySessionCreateDoneInfo) {
			return
		}
	}
	return res
}
func (t *Query) onSessionAttach(q QuerySessionAttachStartInfo) func(info QuerySessionAttachDoneInfo) {
	fn := t.OnSessionAttach
	if fn == nil {
		return func(QuerySessionAttachDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QuerySessionAttachDoneInfo) {
			return
		}
	}
	return res
}
func (t *Query) onSessionDelete(q QuerySessionDeleteStartInfo) func(info QuerySessionDeleteDoneInfo) {
	fn := t.OnSessionDelete
	if fn == nil {
		return func(QuerySessionDeleteDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QuerySessionDeleteDoneInfo) {
			return
		}
	}
	return res
}
func (t *Query) onSessionExec(q QuerySessionExecStartInfo) func(info QuerySessionExecDoneInfo) {
	fn := t.OnSessionExec
	if fn == nil {
		return func(QuerySessionExecDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QuerySessionExecDoneInfo) {
			return
		}
	}
	return res
}
func (t *Query) onSessionQuery(q QuerySessionQueryStartInfo) func(info QuerySessionQueryDoneInfo) {
	fn := t.OnSessionQuery
	if fn == nil {
		return func(QuerySessionQueryDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QuerySessionQueryDoneInfo) {
			return
		}
	}
	return res
}
func (t *Query) onSessionQueryResultSet(q QuerySessionQueryResultSetStartInfo) func(QuerySessionQueryResultSetDoneInfo) {
	fn := t.OnSessionQueryResultSet
	if fn == nil {
		return func(QuerySessionQueryResultSetDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QuerySessionQueryResultSetDoneInfo) {
			return
		}
	}
	return res
}
func (t *Query) onSessionQueryRow(q QuerySessionQueryRowStartInfo) func(QuerySessionQueryRowDoneInfo) {
	fn := t.OnSessionQueryRow
	if fn == nil {
		return func(QuerySessionQueryRowDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QuerySessionQueryRowDoneInfo) {
			return
		}
	}
	return res
}
func (t *Query) onSessionBegin(q QuerySessionBeginStartInfo) func(info QuerySessionBeginDoneInfo) {
	fn := t.OnSessionBegin
	if fn == nil {
		return func(QuerySessionBeginDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QuerySessionBeginDoneInfo) {
			return
		}
	}
	return res
}
func (t *Query) onTxCommit(q QueryTxCommitStartInfo) func(info QueryTxCommitDoneInfo) {
	fn := t.OnTxCommit
	if fn == nil {
		return func(QueryTxCommitDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QueryTxCommitDoneInfo) {
			return
		}
	}
	return res
}
func (t *Query) onTxRollback(q QueryTxRollbackStartInfo) func(info QueryTxRollbackDoneInfo) {
	fn := t.OnTxRollback
	if fn == nil {
		return func(QueryTxRollbackDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QueryTxRollbackDoneInfo) {
			return
		}
	}
	return res
}
func (t *Query) onTxExec(q QueryTxExecStartInfo) func(info QueryTxExecDoneInfo) {
	fn := t.OnTxExec
	if fn == nil {
		return func(QueryTxExecDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QueryTxExecDoneInfo) {
			return
		}
	}
	return res
}
func (t *Query) onTxQuery(q QueryTxQueryStartInfo) func(info QueryTxQueryDoneInfo) {
	fn := t.OnTxQuery
	if fn == nil {
		return func(QueryTxQueryDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QueryTxQueryDoneInfo) {
			return
		}
	}
	return res
}
func (t *Query) onTxQueryResultSet(q QueryTxQueryResultSetStartInfo) func(QueryTxQueryResultSetDoneInfo) {
	fn := t.OnTxQueryResultSet
	if fn == nil {
		return func(QueryTxQueryResultSetDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QueryTxQueryResultSetDoneInfo) {
			return
		}
	}
	return res
}
func (t *Query) onTxQueryRow(q QueryTxQueryRowStartInfo) func(QueryTxQueryRowDoneInfo) {
	fn := t.OnTxQueryRow
	if fn == nil {
		return func(QueryTxQueryRowDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QueryTxQueryRowDoneInfo) {
			return
		}
	}
	return res
}
func (t *Query) onResultNew(q QueryResultNewStartInfo) func(info QueryResultNewDoneInfo) {
	fn := t.OnResultNew
	if fn == nil {
		return func(QueryResultNewDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QueryResultNewDoneInfo) {
			return
		}
	}
	return res
}
func (t *Query) onResultNextPart(q QueryResultNextPartStartInfo) func(info QueryResultNextPartDoneInfo) {
	fn := t.OnResultNextPart
	if fn == nil {
		return func(QueryResultNextPartDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QueryResultNextPartDoneInfo) {
			return
		}
	}
	return res
}
func (t *Query) onResultNextResultSet(q QueryResultNextResultSetStartInfo) func(info QueryResultNextResultSetDoneInfo) {
	fn := t.OnResultNextResultSet
	if fn == nil {
		return func(QueryResultNextResultSetDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QueryResultNextResultSetDoneInfo) {
			return
		}
	}
	return res
}
func (t *Query) onResultClose(q QueryResultCloseStartInfo) func(info QueryResultCloseDoneInfo) {
	fn := t.OnResultClose
	if fn == nil {
		return func(QueryResultCloseDoneInfo) {
			return
		}
	}
	res := fn(q)
	if res == nil {
		return func(QueryResultCloseDoneInfo) {
			return
		}
	}
	return res
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnNew(t *Query, c *context.Context, call call) func() {
	var p QueryNewStartInfo
	p.Context = c
	p.Call = call
	res := t.onNew(p)
	return func() {
		var p QueryNewDoneInfo
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnClose(t *Query, c *context.Context, call call) func(error) {
	var p QueryCloseStartInfo
	p.Context = c
	p.Call = call
	res := t.onClose(p)
	return func(e error) {
		var p QueryCloseDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnPoolNew(t *Query, c *context.Context, call call) func(limit int) {
	var p QueryPoolNewStartInfo
	p.Context = c
	p.Call = call
	res := t.onPoolNew(p)
	return func(limit int) {
		var p QueryPoolNewDoneInfo
		p.Limit = limit
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnPoolClose(t *Query, c *context.Context, call call) func(error) {
	var p QueryPoolCloseStartInfo
	p.Context = c
	p.Call = call
	res := t.onPoolClose(p)
	return func(e error) {
		var p QueryPoolCloseDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnPoolTry(t *Query, c *context.Context, call call) func(error) {
	var p QueryPoolTryStartInfo
	p.Context = c
	p.Call = call
	res := t.onPoolTry(p)
	return func(e error) {
		var p QueryPoolTryDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnPoolWith(t *Query, c *context.Context, call call) func(attempts int, _ error) {
	var p QueryPoolWithStartInfo
	p.Context = c
	p.Call = call
	res := t.onPoolWith(p)
	return func(attempts int, e error) {
		var p QueryPoolWithDoneInfo
		p.Attempts = attempts
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnPoolPut(t *Query, c *context.Context, call call, session sessionInfo) func(error) {
	var p QueryPoolPutStartInfo
	p.Context = c
	p.Call = call
	p.Session = session
	res := t.onPoolPut(p)
	return func(e error) {
		var p QueryPoolPutDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnPoolGet(t *Query, c *context.Context, call call) func(session sessionInfo, attempts int, _ *NodeHintInfo, _ error) {
	var p QueryPoolGetStartInfo
	p.Context = c
	p.Call = call
	res := t.onPoolGet(p)
	return func(session sessionInfo, attempts int, n *NodeHintInfo, e error) {
		var p QueryPoolGetDoneInfo
		p.Session = session
		p.Attempts = attempts
		p.NodeHintInfo = n
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnPoolChange(t *Query, limit int, index int, idle int, wait int, createInProgress int) {
	var p QueryPoolChange
	p.Limit = limit
	p.Index = index
	p.Idle = idle
	p.Wait = wait
	p.CreateInProgress = createInProgress
	t.onPoolChange(p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnDo(t *Query, c *context.Context, call call, label string) func(attempts int, _ error) {
	var p QueryDoStartInfo
	p.Context = c
	p.Call = call
	p.Label = label
	res := t.onDo(p)
	return func(attempts int, e error) {
		var p QueryDoDoneInfo
		p.Attempts = attempts
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnDoTx(t *Query, c *context.Context, call call, label string) func(attempts int, _ error) {
	var p QueryDoTxStartInfo
	p.Context = c
	p.Call = call
	p.Label = label
	res := t.onDoTx(p)
	return func(attempts int, e error) {
		var p QueryDoTxDoneInfo
		p.Attempts = attempts
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnExec(t *Query, c *context.Context, call call, query string, label string) func(error) {
	var p QueryExecStartInfo
	p.Context = c
	p.Call = call
	p.Query = query
	p.Label = label
	res := t.onExec(p)
	return func(e error) {
		var p QueryExecDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnQuery(t *Query, c *context.Context, call call, query string, label string) func(error) {
	var p QueryQueryStartInfo
	p.Context = c
	p.Call = call
	p.Query = query
	p.Label = label
	res := t.onQuery(p)
	return func(e error) {
		var p QueryQueryDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnQueryResultSet(t *Query, c *context.Context, call call, query string, label string) func(_ error, rowsCount int) {
	var p QueryQueryResultSetStartInfo
	p.Context = c
	p.Call = call
	p.Query = query
	p.Label = label
	res := t.onQueryResultSet(p)
	return func(e error, rowsCount int) {
		var p QueryQueryResultSetDoneInfo
		p.Error = e
		p.RowsCount = rowsCount
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnQueryRow(t *Query, c *context.Context, call call, query string, label string) func(error) {
	var p QueryQueryRowStartInfo
	p.Context = c
	p.Call = call
	p.Query = query
	p.Label = label
	res := t.onQueryRow(p)
	return func(e error) {
		var p QueryQueryRowDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnSessionCreate(t *Query, c *context.Context, call call) func(session sessionInfo, _ error) {
	var p QuerySessionCreateStartInfo
	p.Context = c
	p.Call = call
	res := t.onSessionCreate(p)
	return func(session sessionInfo, e error) {
		var p QuerySessionCreateDoneInfo
		p.Session = session
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnSessionAttach(t *Query, c *context.Context, call call, session sessionInfo) func(error) {
	var p QuerySessionAttachStartInfo
	p.Context = c
	p.Call = call
	p.Session = session
	res := t.onSessionAttach(p)
	return func(e error) {
		var p QuerySessionAttachDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnSessionDelete(t *Query, c *context.Context, call call, session sessionInfo) func(error) {
	var p QuerySessionDeleteStartInfo
	p.Context = c
	p.Call = call
	p.Session = session
	res := t.onSessionDelete(p)
	return func(e error) {
		var p QuerySessionDeleteDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnSessionExec(t *Query, c *context.Context, call call, session sessionInfo, query string, label string) func(error) {
	var p QuerySessionExecStartInfo
	p.Context = c
	p.Call = call
	p.Session = session
	p.Query = query
	p.Label = label
	res := t.onSessionExec(p)
	return func(e error) {
		var p QuerySessionExecDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnSessionQuery(t *Query, c *context.Context, call call, session sessionInfo, query string, label string) func(error) {
	var p QuerySessionQueryStartInfo
	p.Context = c
	p.Call = call
	p.Session = session
	p.Query = query
	p.Label = label
	res := t.onSessionQuery(p)
	return func(e error) {
		var p QuerySessionQueryDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnSessionQueryResultSet(t *Query, c *context.Context, call call, session sessionInfo, query string) func(error) {
	var p QuerySessionQueryResultSetStartInfo
	p.Context = c
	p.Call = call
	p.Session = session
	p.Query = query
	res := t.onSessionQueryResultSet(p)
	return func(e error) {
		var p QuerySessionQueryResultSetDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnSessionQueryRow(t *Query, c *context.Context, call call, session sessionInfo, query string) func(error) {
	var p QuerySessionQueryRowStartInfo
	p.Context = c
	p.Call = call
	p.Session = session
	p.Query = query
	res := t.onSessionQueryRow(p)
	return func(e error) {
		var p QuerySessionQueryRowDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnSessionBegin(t *Query, c *context.Context, call call, session sessionInfo) func(_ error, tx txInfo) {
	var p QuerySessionBeginStartInfo
	p.Context = c
	p.Call = call
	p.Session = session
	res := t.onSessionBegin(p)
	return func(e error, tx txInfo) {
		var p QuerySessionBeginDoneInfo
		p.Error = e
		p.Tx = tx
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnTxCommit(t *Query, c *context.Context, call call, session sessionInfo, tx txInfo) func(error) {
	var p QueryTxCommitStartInfo
	p.Context = c
	p.Call = call
	p.Session = session
	p.Tx = tx
	res := t.onTxCommit(p)
	return func(e error) {
		var p QueryTxCommitDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnTxRollback(t *Query, c *context.Context, call call, session sessionInfo, tx txInfo) func(error) {
	var p QueryTxRollbackStartInfo
	p.Context = c
	p.Call = call
	p.Session = session
	p.Tx = tx
	res := t.onTxRollback(p)
	return func(e error) {
		var p QueryTxRollbackDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnTxExec(t *Query, c *context.Context, call call, session sessionInfo, tx txInfo, query string, label string) func(error) {
	var p QueryTxExecStartInfo
	p.Context = c
	p.Call = call
	p.Session = session
	p.Tx = tx
	p.Query = query
	p.Label = label
	res := t.onTxExec(p)
	return func(e error) {
		var p QueryTxExecDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnTxQuery(t *Query, c *context.Context, call call, session sessionInfo, tx txInfo, query string, label string) func(error) {
	var p QueryTxQueryStartInfo
	p.Context = c
	p.Call = call
	p.Session = session
	p.Tx = tx
	p.Query = query
	p.Label = label
	res := t.onTxQuery(p)
	return func(e error) {
		var p QueryTxQueryDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnTxQueryResultSet(t *Query, c *context.Context, call call, tx txInfo, query string, label string) func(error) {
	var p QueryTxQueryResultSetStartInfo
	p.Context = c
	p.Call = call
	p.Tx = tx
	p.Query = query
	p.Label = label
	res := t.onTxQueryResultSet(p)
	return func(e error) {
		var p QueryTxQueryResultSetDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnTxQueryRow(t *Query, c *context.Context, call call, tx txInfo, query string, label string) func(error) {
	var p QueryTxQueryRowStartInfo
	p.Context = c
	p.Call = call
	p.Tx = tx
	p.Query = query
	p.Label = label
	res := t.onTxQueryRow(p)
	return func(e error) {
		var p QueryTxQueryRowDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnResultNew(t *Query, c *context.Context, call call) func(error) {
	var p QueryResultNewStartInfo
	p.Context = c
	p.Call = call
	res := t.onResultNew(p)
	return func(e error) {
		var p QueryResultNewDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnResultNextPart(t *Query, c *context.Context, call call) func(stats *Ydb_TableStats.QueryStats, _ error) {
	var p QueryResultNextPartStartInfo
	p.Context = c
	p.Call = call
	res := t.onResultNextPart(p)
	return func(stats *Ydb_TableStats.QueryStats, e error) {
		var p QueryResultNextPartDoneInfo
		p.Stats = stats
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnResultNextResultSet(t *Query, c *context.Context, call call) func(error) {
	var p QueryResultNextResultSetStartInfo
	p.Context = c
	p.Call = call
	res := t.onResultNextResultSet(p)
	return func(e error) {
		var p QueryResultNextResultSetDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func QueryOnResultClose(t *Query, c *context.Context, call call) func(error) {
	var p QueryResultCloseStartInfo
	p.Context = c
	p.Call = call
	res := t.onResultClose(p)
	return func(e error) {
		var p QueryResultCloseDoneInfo
		p.Error = e
		res(p)
	}
}
