// Code generated by gtrace. DO NOT EDIT.

package gtrace

import (
	"context"

	"github.com/ydb-platform/ydb-go-sdk/v3/trace"
)

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

// TableOption specified Table compose option
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
type TableComposeOption func(o *tableComposeOptions)

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

// Compose returns a new Table which has functional fields composed both from lhs and rhs.
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func Compose(lhs *trace.Table, rhs *trace.Table, opts ...TableComposeOption) *trace.Table {
	if lhs == nil {
		return rhs
	}
	var ret trace.Table
	options := tableComposeOptions{}
	for _, opt := range opts {
		if opt != nil {
			opt(&options)
		}
	}
	{
		h1 := lhs.OnInit
		h2 := rhs.OnInit
		ret.OnInit = func(t trace.TableInitStartInfo) func(trace.TableInitDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TableInitDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TableInitDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnClose
		h2 := rhs.OnClose
		ret.OnClose = func(t trace.TableCloseStartInfo) func(trace.TableCloseDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TableCloseDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TableCloseDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnDo
		h2 := rhs.OnDo
		ret.OnDo = func(t trace.TableDoStartInfo) func(trace.TableDoDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TableDoDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TableDoDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnDoTx
		h2 := rhs.OnDoTx
		ret.OnDoTx = func(t trace.TableDoTxStartInfo) func(trace.TableDoTxDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TableDoTxDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TableDoTxDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnBulkUpsert
		h2 := rhs.OnBulkUpsert
		ret.OnBulkUpsert = func(t trace.TableBulkUpsertStartInfo) func(trace.TableBulkUpsertDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TableBulkUpsertDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TableBulkUpsertDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnCreateSession
		h2 := rhs.OnCreateSession
		ret.OnCreateSession = func(t trace.TableCreateSessionStartInfo) func(trace.TableCreateSessionDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TableCreateSessionDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TableCreateSessionDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnSessionNew
		h2 := rhs.OnSessionNew
		ret.OnSessionNew = func(t trace.TableSessionNewStartInfo) func(trace.TableSessionNewDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TableSessionNewDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TableSessionNewDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnSessionDelete
		h2 := rhs.OnSessionDelete
		ret.OnSessionDelete = func(t trace.TableSessionDeleteStartInfo) func(trace.TableSessionDeleteDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TableSessionDeleteDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TableSessionDeleteDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnSessionKeepAlive
		h2 := rhs.OnSessionKeepAlive
		ret.OnSessionKeepAlive = func(t trace.TableKeepAliveStartInfo) func(trace.TableKeepAliveDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TableKeepAliveDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TableKeepAliveDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnSessionBulkUpsert
		h2 := rhs.OnSessionBulkUpsert
		ret.OnSessionBulkUpsert = func(t trace.TableSessionBulkUpsertStartInfo) func(trace.TableSessionBulkUpsertDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TableSessionBulkUpsertDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TableSessionBulkUpsertDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnSessionQueryPrepare
		h2 := rhs.OnSessionQueryPrepare
		ret.OnSessionQueryPrepare = func(t trace.TablePrepareDataQueryStartInfo) func(trace.TablePrepareDataQueryDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TablePrepareDataQueryDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TablePrepareDataQueryDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnSessionQueryExecute
		h2 := rhs.OnSessionQueryExecute
		ret.OnSessionQueryExecute = func(t trace.TableExecuteDataQueryStartInfo) func(trace.TableExecuteDataQueryDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TableExecuteDataQueryDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TableExecuteDataQueryDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnSessionQueryExplain
		h2 := rhs.OnSessionQueryExplain
		ret.OnSessionQueryExplain = func(t trace.TableExplainQueryStartInfo) func(trace.TableExplainQueryDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TableExplainQueryDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TableExplainQueryDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnSessionQueryStreamExecute
		h2 := rhs.OnSessionQueryStreamExecute
		ret.OnSessionQueryStreamExecute = func(t trace.TableSessionQueryStreamExecuteStartInfo) func(trace.TableSessionQueryStreamExecuteDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TableSessionQueryStreamExecuteDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TableSessionQueryStreamExecuteDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnSessionQueryStreamRead
		h2 := rhs.OnSessionQueryStreamRead
		ret.OnSessionQueryStreamRead = func(t trace.TableSessionQueryStreamReadStartInfo) func(trace.TableSessionQueryStreamReadDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TableSessionQueryStreamReadDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TableSessionQueryStreamReadDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnTxBegin
		h2 := rhs.OnTxBegin
		ret.OnTxBegin = func(t trace.TableTxBeginStartInfo) func(trace.TableTxBeginDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TableTxBeginDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TableTxBeginDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnTxExecute
		h2 := rhs.OnTxExecute
		ret.OnTxExecute = func(t trace.TableTransactionExecuteStartInfo) func(trace.TableTransactionExecuteDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TableTransactionExecuteDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TableTransactionExecuteDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnTxExecuteStatement
		h2 := rhs.OnTxExecuteStatement
		ret.OnTxExecuteStatement = func(t trace.TableTransactionExecuteStatementStartInfo) func(trace.TableTransactionExecuteStatementDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TableTransactionExecuteStatementDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TableTransactionExecuteStatementDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnTxCommit
		h2 := rhs.OnTxCommit
		ret.OnTxCommit = func(t trace.TableTxCommitStartInfo) func(trace.TableTxCommitDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TableTxCommitDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TableTxCommitDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnTxRollback
		h2 := rhs.OnTxRollback
		ret.OnTxRollback = func(t trace.TableTxRollbackStartInfo) func(trace.TableTxRollbackDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TableTxRollbackDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TableTxRollbackDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnPoolPut
		h2 := rhs.OnPoolPut
		ret.OnPoolPut = func(t trace.TablePoolPutStartInfo) func(trace.TablePoolPutDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TablePoolPutDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TablePoolPutDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnPoolGet
		h2 := rhs.OnPoolGet
		ret.OnPoolGet = func(t trace.TablePoolGetStartInfo) func(trace.TablePoolGetDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TablePoolGetDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TablePoolGetDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnPoolWith
		h2 := rhs.OnPoolWith
		ret.OnPoolWith = func(t trace.TablePoolWithStartInfo) func(trace.TablePoolWithDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TablePoolWithDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TablePoolWithDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnPoolStateChange
		h2 := rhs.OnPoolStateChange
		ret.OnPoolStateChange = func(t trace.TablePoolStateChangeInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(t)
			}
			if h2 != nil {
				h2(t)
			}
		}
	}
	return &ret
}
func onInit(t *trace.Table, t1 trace.TableInitStartInfo) func(trace.TableInitDoneInfo) {
	fn := t.OnInit
	if fn == nil {
		return func(trace.TableInitDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TableInitDoneInfo) {
			return
		}
	}
	return res
}
func onClose(t *trace.Table, t1 trace.TableCloseStartInfo) func(trace.TableCloseDoneInfo) {
	fn := t.OnClose
	if fn == nil {
		return func(trace.TableCloseDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TableCloseDoneInfo) {
			return
		}
	}
	return res
}
func onDo(t *trace.Table, t1 trace.TableDoStartInfo) func(trace.TableDoDoneInfo) {
	fn := t.OnDo
	if fn == nil {
		return func(trace.TableDoDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TableDoDoneInfo) {
			return
		}
	}
	return res
}
func onDoTx(t *trace.Table, t1 trace.TableDoTxStartInfo) func(trace.TableDoTxDoneInfo) {
	fn := t.OnDoTx
	if fn == nil {
		return func(trace.TableDoTxDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TableDoTxDoneInfo) {
			return
		}
	}
	return res
}
func onBulkUpsert(t *trace.Table, t1 trace.TableBulkUpsertStartInfo) func(trace.TableBulkUpsertDoneInfo) {
	fn := t.OnBulkUpsert
	if fn == nil {
		return func(trace.TableBulkUpsertDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TableBulkUpsertDoneInfo) {
			return
		}
	}
	return res
}
func onCreateSession(t *trace.Table, t1 trace.TableCreateSessionStartInfo) func(trace.TableCreateSessionDoneInfo) {
	fn := t.OnCreateSession
	if fn == nil {
		return func(trace.TableCreateSessionDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TableCreateSessionDoneInfo) {
			return
		}
	}
	return res
}
func onSessionNew(t *trace.Table, t1 trace.TableSessionNewStartInfo) func(trace.TableSessionNewDoneInfo) {
	fn := t.OnSessionNew
	if fn == nil {
		return func(trace.TableSessionNewDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TableSessionNewDoneInfo) {
			return
		}
	}
	return res
}
func onSessionDelete(t *trace.Table, t1 trace.TableSessionDeleteStartInfo) func(trace.TableSessionDeleteDoneInfo) {
	fn := t.OnSessionDelete
	if fn == nil {
		return func(trace.TableSessionDeleteDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TableSessionDeleteDoneInfo) {
			return
		}
	}
	return res
}
func onSessionKeepAlive(t *trace.Table, t1 trace.TableKeepAliveStartInfo) func(trace.TableKeepAliveDoneInfo) {
	fn := t.OnSessionKeepAlive
	if fn == nil {
		return func(trace.TableKeepAliveDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TableKeepAliveDoneInfo) {
			return
		}
	}
	return res
}
func onSessionBulkUpsert(t *trace.Table, t1 trace.TableSessionBulkUpsertStartInfo) func(trace.TableSessionBulkUpsertDoneInfo) {
	fn := t.OnSessionBulkUpsert
	if fn == nil {
		return func(trace.TableSessionBulkUpsertDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TableSessionBulkUpsertDoneInfo) {
			return
		}
	}
	return res
}
func onSessionQueryPrepare(t *trace.Table, t1 trace.TablePrepareDataQueryStartInfo) func(trace.TablePrepareDataQueryDoneInfo) {
	fn := t.OnSessionQueryPrepare
	if fn == nil {
		return func(trace.TablePrepareDataQueryDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TablePrepareDataQueryDoneInfo) {
			return
		}
	}
	return res
}
func onSessionQueryExecute(t *trace.Table, t1 trace.TableExecuteDataQueryStartInfo) func(trace.TableExecuteDataQueryDoneInfo) {
	fn := t.OnSessionQueryExecute
	if fn == nil {
		return func(trace.TableExecuteDataQueryDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TableExecuteDataQueryDoneInfo) {
			return
		}
	}
	return res
}
func onSessionQueryExplain(t *trace.Table, t1 trace.TableExplainQueryStartInfo) func(trace.TableExplainQueryDoneInfo) {
	fn := t.OnSessionQueryExplain
	if fn == nil {
		return func(trace.TableExplainQueryDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TableExplainQueryDoneInfo) {
			return
		}
	}
	return res
}
func onSessionQueryStreamExecute(t *trace.Table, t1 trace.TableSessionQueryStreamExecuteStartInfo) func(trace.TableSessionQueryStreamExecuteDoneInfo) {
	fn := t.OnSessionQueryStreamExecute
	if fn == nil {
		return func(trace.TableSessionQueryStreamExecuteDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TableSessionQueryStreamExecuteDoneInfo) {
			return
		}
	}
	return res
}
func onSessionQueryStreamRead(t *trace.Table, t1 trace.TableSessionQueryStreamReadStartInfo) func(trace.TableSessionQueryStreamReadDoneInfo) {
	fn := t.OnSessionQueryStreamRead
	if fn == nil {
		return func(trace.TableSessionQueryStreamReadDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TableSessionQueryStreamReadDoneInfo) {
			return
		}
	}
	return res
}
func onTxBegin(t *trace.Table, t1 trace.TableTxBeginStartInfo) func(trace.TableTxBeginDoneInfo) {
	fn := t.OnTxBegin
	if fn == nil {
		return func(trace.TableTxBeginDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TableTxBeginDoneInfo) {
			return
		}
	}
	return res
}
func onTxExecute(t *trace.Table, t1 trace.TableTransactionExecuteStartInfo) func(trace.TableTransactionExecuteDoneInfo) {
	fn := t.OnTxExecute
	if fn == nil {
		return func(trace.TableTransactionExecuteDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TableTransactionExecuteDoneInfo) {
			return
		}
	}
	return res
}
func onTxExecuteStatement(t *trace.Table, t1 trace.TableTransactionExecuteStatementStartInfo) func(trace.TableTransactionExecuteStatementDoneInfo) {
	fn := t.OnTxExecuteStatement
	if fn == nil {
		return func(trace.TableTransactionExecuteStatementDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TableTransactionExecuteStatementDoneInfo) {
			return
		}
	}
	return res
}
func onTxCommit(t *trace.Table, t1 trace.TableTxCommitStartInfo) func(trace.TableTxCommitDoneInfo) {
	fn := t.OnTxCommit
	if fn == nil {
		return func(trace.TableTxCommitDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TableTxCommitDoneInfo) {
			return
		}
	}
	return res
}
func onTxRollback(t *trace.Table, t1 trace.TableTxRollbackStartInfo) func(trace.TableTxRollbackDoneInfo) {
	fn := t.OnTxRollback
	if fn == nil {
		return func(trace.TableTxRollbackDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TableTxRollbackDoneInfo) {
			return
		}
	}
	return res
}
func onPoolPut(t *trace.Table, t1 trace.TablePoolPutStartInfo) func(trace.TablePoolPutDoneInfo) {
	fn := t.OnPoolPut
	if fn == nil {
		return func(trace.TablePoolPutDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TablePoolPutDoneInfo) {
			return
		}
	}
	return res
}
func onPoolGet(t *trace.Table, t1 trace.TablePoolGetStartInfo) func(trace.TablePoolGetDoneInfo) {
	fn := t.OnPoolGet
	if fn == nil {
		return func(trace.TablePoolGetDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TablePoolGetDoneInfo) {
			return
		}
	}
	return res
}
func onPoolWith(t *trace.Table, t1 trace.TablePoolWithStartInfo) func(trace.TablePoolWithDoneInfo) {
	fn := t.OnPoolWith
	if fn == nil {
		return func(trace.TablePoolWithDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TablePoolWithDoneInfo) {
			return
		}
	}
	return res
}
func onPoolStateChange(t *trace.Table, t1 trace.TablePoolStateChangeInfo) {
	fn := t.OnPoolStateChange
	if fn == nil {
		return
	}
	fn(t1)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TableOnInit(t *trace.Table, c *context.Context, c1 trace.Call) func(limit int) {
	var p trace.TableInitStartInfo
	p.Context = c
	p.Call = c1
	res := onInit(t, p)
	return func(limit int) {
		var p trace.TableInitDoneInfo
		p.Limit = limit
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TableOnClose(t *trace.Table, c *context.Context, c1 trace.Call) func(error) {
	var p trace.TableCloseStartInfo
	p.Context = c
	p.Call = c1
	res := onClose(t, p)
	return func(e error) {
		var p trace.TableCloseDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TableOnDo(t *trace.Table, c *context.Context, c1 trace.Call, label string, idempotent bool, nestedCall bool) func(attempts int, _ error) {
	var p trace.TableDoStartInfo
	p.Context = c
	p.Call = c1
	p.Label = label
	p.Idempotent = idempotent
	p.NestedCall = nestedCall
	res := onDo(t, p)
	return func(attempts int, e error) {
		var p trace.TableDoDoneInfo
		p.Attempts = attempts
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TableOnDoTx(t *trace.Table, c *context.Context, c1 trace.Call, label string, idempotent bool, nestedCall bool) func(attempts int, _ error) {
	var p trace.TableDoTxStartInfo
	p.Context = c
	p.Call = c1
	p.Label = label
	p.Idempotent = idempotent
	p.NestedCall = nestedCall
	res := onDoTx(t, p)
	return func(attempts int, e error) {
		var p trace.TableDoTxDoneInfo
		p.Attempts = attempts
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TableOnBulkUpsert(t *trace.Table, c *context.Context, c1 trace.Call) func(_ error, attempts int) {
	var p trace.TableBulkUpsertStartInfo
	p.Context = c
	p.Call = c1
	res := onBulkUpsert(t, p)
	return func(e error, attempts int) {
		var p trace.TableBulkUpsertDoneInfo
		p.Error = e
		p.Attempts = attempts
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TableOnCreateSession(t *trace.Table, c *context.Context, c1 trace.Call) func(session trace.SessionInfo, attempts int, _ error) {
	var p trace.TableCreateSessionStartInfo
	p.Context = c
	p.Call = c1
	res := onCreateSession(t, p)
	return func(session trace.SessionInfo, attempts int, e error) {
		var p trace.TableCreateSessionDoneInfo
		p.Session = session
		p.Attempts = attempts
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TableOnSessionNew(t *trace.Table, c *context.Context, c1 trace.Call) func(session trace.SessionInfo, _ error) {
	var p trace.TableSessionNewStartInfo
	p.Context = c
	p.Call = c1
	res := onSessionNew(t, p)
	return func(session trace.SessionInfo, e error) {
		var p trace.TableSessionNewDoneInfo
		p.Session = session
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TableOnSessionDelete(t *trace.Table, c *context.Context, c1 trace.Call, session trace.SessionInfo) func(error) {
	var p trace.TableSessionDeleteStartInfo
	p.Context = c
	p.Call = c1
	p.Session = session
	res := onSessionDelete(t, p)
	return func(e error) {
		var p trace.TableSessionDeleteDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TableOnSessionKeepAlive(t *trace.Table, c *context.Context, c1 trace.Call, session trace.SessionInfo) func(error) {
	var p trace.TableKeepAliveStartInfo
	p.Context = c
	p.Call = c1
	p.Session = session
	res := onSessionKeepAlive(t, p)
	return func(e error) {
		var p trace.TableKeepAliveDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TableOnSessionBulkUpsert(t *trace.Table, c *context.Context, c1 trace.Call, session trace.SessionInfo) func(error) {
	var p trace.TableSessionBulkUpsertStartInfo
	p.Context = c
	p.Call = c1
	p.Session = session
	res := onSessionBulkUpsert(t, p)
	return func(e error) {
		var p trace.TableSessionBulkUpsertDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TableOnSessionQueryPrepare(t *trace.Table, c *context.Context, c1 trace.Call, session trace.SessionInfo, query string) func(result trace.TableDataQuery, _ error) {
	var p trace.TablePrepareDataQueryStartInfo
	p.Context = c
	p.Call = c1
	p.Session = session
	p.Query = query
	res := onSessionQueryPrepare(t, p)
	return func(result trace.TableDataQuery, e error) {
		var p trace.TablePrepareDataQueryDoneInfo
		p.Result = result
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TableOnSessionQueryExecute(t *trace.Table, c *context.Context, c1 trace.Call, session trace.SessionInfo, query trace.TableDataQuery, parameters trace.TableQueryParameters, keepInCache bool) func(tx trace.TxInfo, prepared bool, result trace.TableResult, _ error) {
	var p trace.TableExecuteDataQueryStartInfo
	p.Context = c
	p.Call = c1
	p.Session = session
	p.Query = query
	p.Parameters = parameters
	p.KeepInCache = keepInCache
	res := onSessionQueryExecute(t, p)
	return func(tx trace.TxInfo, prepared bool, result trace.TableResult, e error) {
		var p trace.TableExecuteDataQueryDoneInfo
		p.Tx = tx
		p.Prepared = prepared
		p.Result = result
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TableOnSessionQueryExplain(t *trace.Table, c *context.Context, c1 trace.Call, session trace.SessionInfo, query string) func(aST string, plan string, _ error) {
	var p trace.TableExplainQueryStartInfo
	p.Context = c
	p.Call = c1
	p.Session = session
	p.Query = query
	res := onSessionQueryExplain(t, p)
	return func(aST string, plan string, e error) {
		var p trace.TableExplainQueryDoneInfo
		p.AST = aST
		p.Plan = plan
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TableOnSessionQueryStreamExecute(t *trace.Table, c *context.Context, c1 trace.Call, session trace.SessionInfo, query trace.TableDataQuery, parameters trace.TableQueryParameters) func(error) {
	var p trace.TableSessionQueryStreamExecuteStartInfo
	p.Context = c
	p.Call = c1
	p.Session = session
	p.Query = query
	p.Parameters = parameters
	res := onSessionQueryStreamExecute(t, p)
	return func(e error) {
		var p trace.TableSessionQueryStreamExecuteDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TableOnSessionQueryStreamRead(t *trace.Table, c *context.Context, c1 trace.Call, session trace.SessionInfo) func(error) {
	var p trace.TableSessionQueryStreamReadStartInfo
	p.Context = c
	p.Call = c1
	p.Session = session
	res := onSessionQueryStreamRead(t, p)
	return func(e error) {
		var p trace.TableSessionQueryStreamReadDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TableOnTxBegin(t *trace.Table, c *context.Context, c1 trace.Call, session trace.SessionInfo) func(tx trace.TxInfo, _ error) {
	var p trace.TableTxBeginStartInfo
	p.Context = c
	p.Call = c1
	p.Session = session
	res := onTxBegin(t, p)
	return func(tx trace.TxInfo, e error) {
		var p trace.TableTxBeginDoneInfo
		p.Tx = tx
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TableOnTxExecute(t *trace.Table, c *context.Context, c1 trace.Call, session trace.SessionInfo, tx trace.TxInfo, query trace.TableDataQuery, parameters trace.TableQueryParameters) func(result trace.TableResult, _ error) {
	var p trace.TableTransactionExecuteStartInfo
	p.Context = c
	p.Call = c1
	p.Session = session
	p.Tx = tx
	p.Query = query
	p.Parameters = parameters
	res := onTxExecute(t, p)
	return func(result trace.TableResult, e error) {
		var p trace.TableTransactionExecuteDoneInfo
		p.Result = result
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TableOnTxExecuteStatement(t *trace.Table, c *context.Context, c1 trace.Call, session trace.SessionInfo, tx trace.TxInfo, statementQuery trace.TableDataQuery, parameters trace.TableQueryParameters) func(result trace.TableResult, _ error) {
	var p trace.TableTransactionExecuteStatementStartInfo
	p.Context = c
	p.Call = c1
	p.Session = session
	p.Tx = tx
	p.StatementQuery = statementQuery
	p.Parameters = parameters
	res := onTxExecuteStatement(t, p)
	return func(result trace.TableResult, e error) {
		var p trace.TableTransactionExecuteStatementDoneInfo
		p.Result = result
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TableOnTxCommit(t *trace.Table, c *context.Context, c1 trace.Call, session trace.SessionInfo, tx trace.TxInfo) func(error) {
	var p trace.TableTxCommitStartInfo
	p.Context = c
	p.Call = c1
	p.Session = session
	p.Tx = tx
	res := onTxCommit(t, p)
	return func(e error) {
		var p trace.TableTxCommitDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TableOnTxRollback(t *trace.Table, c *context.Context, c1 trace.Call, session trace.SessionInfo, tx trace.TxInfo) func(error) {
	var p trace.TableTxRollbackStartInfo
	p.Context = c
	p.Call = c1
	p.Session = session
	p.Tx = tx
	res := onTxRollback(t, p)
	return func(e error) {
		var p trace.TableTxRollbackDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TableOnPoolPut(t *trace.Table, c *context.Context, c1 trace.Call, session trace.SessionInfo) func(error) {
	var p trace.TablePoolPutStartInfo
	p.Context = c
	p.Call = c1
	p.Session = session
	res := onPoolPut(t, p)
	return func(e error) {
		var p trace.TablePoolPutDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TableOnPoolGet(t *trace.Table, c *context.Context, c1 trace.Call) func(session trace.SessionInfo, attempts int, _ *trace.NodeHintInfo, _ error) {
	var p trace.TablePoolGetStartInfo
	p.Context = c
	p.Call = c1
	res := onPoolGet(t, p)
	return func(session trace.SessionInfo, attempts int, n *trace.NodeHintInfo, e error) {
		var p trace.TablePoolGetDoneInfo
		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 TableOnPoolWith(t *trace.Table, c *context.Context, c1 trace.Call) func(attempts int, _ error) {
	var p trace.TablePoolWithStartInfo
	p.Context = c
	p.Call = c1
	res := onPoolWith(t, p)
	return func(attempts int, e error) {
		var p trace.TablePoolWithDoneInfo
		p.Attempts = attempts
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TableOnPoolStateChange(t *trace.Table, limit int, idle int, createInProgress int, concurrency int, size int) {
	var p trace.TablePoolStateChangeInfo
	p.Limit = limit
	p.Idle = idle
	p.CreateInProgress = createInProgress
	p.Concurrency = concurrency
	p.Size = size
	onPoolStateChange(t, p)
}
