// Code generated by gtrace. DO NOT EDIT.

package trace

import (
	"context"
	"database/sql/driver"
	"time"
)

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

// DatabaseSQLOption specified DatabaseSQL compose option
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
type DatabaseSQLComposeOption func(o *databaseSQLComposeOptions)

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

// Compose returns a new DatabaseSQL 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 *DatabaseSQL) Compose(x *DatabaseSQL, opts ...DatabaseSQLComposeOption) *DatabaseSQL {
	if t == nil {
		return x
	}
	var ret DatabaseSQL
	options := databaseSQLComposeOptions{}
	for _, opt := range opts {
		if opt != nil {
			opt(&options)
		}
	}
	{
		h1 := t.OnConnectorConnect
		h2 := x.OnConnectorConnect
		ret.OnConnectorConnect = func(d DatabaseSQLConnectorConnectStartInfo) func(DatabaseSQLConnectorConnectDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(DatabaseSQLConnectorConnectDoneInfo)
			if h1 != nil {
				r = h1(d)
			}
			if h2 != nil {
				r1 = h2(d)
			}
			return func(d DatabaseSQLConnectorConnectDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(d)
				}
				if r1 != nil {
					r1(d)
				}
			}
		}
	}
	{
		h1 := t.OnConnPing
		h2 := x.OnConnPing
		ret.OnConnPing = func(d DatabaseSQLConnPingStartInfo) func(DatabaseSQLConnPingDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(DatabaseSQLConnPingDoneInfo)
			if h1 != nil {
				r = h1(d)
			}
			if h2 != nil {
				r1 = h2(d)
			}
			return func(d DatabaseSQLConnPingDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(d)
				}
				if r1 != nil {
					r1(d)
				}
			}
		}
	}
	{
		h1 := t.OnConnPrepare
		h2 := x.OnConnPrepare
		ret.OnConnPrepare = func(d DatabaseSQLConnPrepareStartInfo) func(DatabaseSQLConnPrepareDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(DatabaseSQLConnPrepareDoneInfo)
			if h1 != nil {
				r = h1(d)
			}
			if h2 != nil {
				r1 = h2(d)
			}
			return func(d DatabaseSQLConnPrepareDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(d)
				}
				if r1 != nil {
					r1(d)
				}
			}
		}
	}
	{
		h1 := t.OnConnClose
		h2 := x.OnConnClose
		ret.OnConnClose = func(d DatabaseSQLConnCloseStartInfo) func(DatabaseSQLConnCloseDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(DatabaseSQLConnCloseDoneInfo)
			if h1 != nil {
				r = h1(d)
			}
			if h2 != nil {
				r1 = h2(d)
			}
			return func(d DatabaseSQLConnCloseDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(d)
				}
				if r1 != nil {
					r1(d)
				}
			}
		}
	}
	{
		h1 := t.OnConnBegin
		h2 := x.OnConnBegin
		ret.OnConnBegin = func(d DatabaseSQLConnBeginStartInfo) func(DatabaseSQLConnBeginDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(DatabaseSQLConnBeginDoneInfo)
			if h1 != nil {
				r = h1(d)
			}
			if h2 != nil {
				r1 = h2(d)
			}
			return func(d DatabaseSQLConnBeginDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(d)
				}
				if r1 != nil {
					r1(d)
				}
			}
		}
	}
	{
		h1 := t.OnConnBeginTx
		h2 := x.OnConnBeginTx
		ret.OnConnBeginTx = func(d DatabaseSQLConnBeginTxStartInfo) func(DatabaseSQLConnBeginTxDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(DatabaseSQLConnBeginTxDoneInfo)
			if h1 != nil {
				r = h1(d)
			}
			if h2 != nil {
				r1 = h2(d)
			}
			return func(d DatabaseSQLConnBeginTxDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(d)
				}
				if r1 != nil {
					r1(d)
				}
			}
		}
	}
	{
		h1 := t.OnConnCheckNamedValue
		h2 := x.OnConnCheckNamedValue
		ret.OnConnCheckNamedValue = func(d DatabaseSQLConnCheckNamedValueStartInfo) func(DatabaseSQLConnCheckNamedValueDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(DatabaseSQLConnCheckNamedValueDoneInfo)
			if h1 != nil {
				r = h1(d)
			}
			if h2 != nil {
				r1 = h2(d)
			}
			return func(d DatabaseSQLConnCheckNamedValueDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(d)
				}
				if r1 != nil {
					r1(d)
				}
			}
		}
	}
	{
		h1 := t.OnConnQuery
		h2 := x.OnConnQuery
		ret.OnConnQuery = func(d DatabaseSQLConnQueryStartInfo) func(DatabaseSQLConnQueryDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(DatabaseSQLConnQueryDoneInfo)
			if h1 != nil {
				r = h1(d)
			}
			if h2 != nil {
				r1 = h2(d)
			}
			return func(d DatabaseSQLConnQueryDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(d)
				}
				if r1 != nil {
					r1(d)
				}
			}
		}
	}
	{
		h1 := t.OnConnExec
		h2 := x.OnConnExec
		ret.OnConnExec = func(d DatabaseSQLConnExecStartInfo) func(DatabaseSQLConnExecDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(DatabaseSQLConnExecDoneInfo)
			if h1 != nil {
				r = h1(d)
			}
			if h2 != nil {
				r1 = h2(d)
			}
			return func(d DatabaseSQLConnExecDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(d)
				}
				if r1 != nil {
					r1(d)
				}
			}
		}
	}
	{
		h1 := t.OnConnIsTableExists
		h2 := x.OnConnIsTableExists
		ret.OnConnIsTableExists = func(d DatabaseSQLConnIsTableExistsStartInfo) func(DatabaseSQLConnIsTableExistsDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(DatabaseSQLConnIsTableExistsDoneInfo)
			if h1 != nil {
				r = h1(d)
			}
			if h2 != nil {
				r1 = h2(d)
			}
			return func(d DatabaseSQLConnIsTableExistsDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(d)
				}
				if r1 != nil {
					r1(d)
				}
			}
		}
	}
	{
		h1 := t.OnConnIsColumnExists
		h2 := x.OnConnIsColumnExists
		ret.OnConnIsColumnExists = func(info DatabaseSQLConnIsColumnExistsStartInfo) func(DatabaseSQLConnIsColumnExistsDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(DatabaseSQLConnIsColumnExistsDoneInfo)
			if h1 != nil {
				r = h1(info)
			}
			if h2 != nil {
				r1 = h2(info)
			}
			return func(d DatabaseSQLConnIsColumnExistsDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(d)
				}
				if r1 != nil {
					r1(d)
				}
			}
		}
	}
	{
		h1 := t.OnConnGetIndexColumns
		h2 := x.OnConnGetIndexColumns
		ret.OnConnGetIndexColumns = func(info DatabaseSQLConnGetIndexColumnsStartInfo) func(DatabaseSQLConnGetIndexColumnsDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(DatabaseSQLConnGetIndexColumnsDoneInfo)
			if h1 != nil {
				r = h1(info)
			}
			if h2 != nil {
				r1 = h2(info)
			}
			return func(d DatabaseSQLConnGetIndexColumnsDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(d)
				}
				if r1 != nil {
					r1(d)
				}
			}
		}
	}
	{
		h1 := t.OnTxQuery
		h2 := x.OnTxQuery
		ret.OnTxQuery = func(d DatabaseSQLTxQueryStartInfo) func(DatabaseSQLTxQueryDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(DatabaseSQLTxQueryDoneInfo)
			if h1 != nil {
				r = h1(d)
			}
			if h2 != nil {
				r1 = h2(d)
			}
			return func(d DatabaseSQLTxQueryDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(d)
				}
				if r1 != nil {
					r1(d)
				}
			}
		}
	}
	{
		h1 := t.OnTxExec
		h2 := x.OnTxExec
		ret.OnTxExec = func(d DatabaseSQLTxExecStartInfo) func(DatabaseSQLTxExecDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(DatabaseSQLTxExecDoneInfo)
			if h1 != nil {
				r = h1(d)
			}
			if h2 != nil {
				r1 = h2(d)
			}
			return func(d DatabaseSQLTxExecDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(d)
				}
				if r1 != nil {
					r1(d)
				}
			}
		}
	}
	{
		h1 := t.OnTxPrepare
		h2 := x.OnTxPrepare
		ret.OnTxPrepare = func(d DatabaseSQLTxPrepareStartInfo) func(DatabaseSQLTxPrepareDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(DatabaseSQLTxPrepareDoneInfo)
			if h1 != nil {
				r = h1(d)
			}
			if h2 != nil {
				r1 = h2(d)
			}
			return func(d DatabaseSQLTxPrepareDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(d)
				}
				if r1 != nil {
					r1(d)
				}
			}
		}
	}
	{
		h1 := t.OnTxCommit
		h2 := x.OnTxCommit
		ret.OnTxCommit = func(d DatabaseSQLTxCommitStartInfo) func(DatabaseSQLTxCommitDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(DatabaseSQLTxCommitDoneInfo)
			if h1 != nil {
				r = h1(d)
			}
			if h2 != nil {
				r1 = h2(d)
			}
			return func(d DatabaseSQLTxCommitDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(d)
				}
				if r1 != nil {
					r1(d)
				}
			}
		}
	}
	{
		h1 := t.OnTxRollback
		h2 := x.OnTxRollback
		ret.OnTxRollback = func(d DatabaseSQLTxRollbackStartInfo) func(DatabaseSQLTxRollbackDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(DatabaseSQLTxRollbackDoneInfo)
			if h1 != nil {
				r = h1(d)
			}
			if h2 != nil {
				r1 = h2(d)
			}
			return func(d DatabaseSQLTxRollbackDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(d)
				}
				if r1 != nil {
					r1(d)
				}
			}
		}
	}
	{
		h1 := t.OnStmtQuery
		h2 := x.OnStmtQuery
		ret.OnStmtQuery = func(d DatabaseSQLStmtQueryStartInfo) func(DatabaseSQLStmtQueryDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(DatabaseSQLStmtQueryDoneInfo)
			if h1 != nil {
				r = h1(d)
			}
			if h2 != nil {
				r1 = h2(d)
			}
			return func(d DatabaseSQLStmtQueryDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(d)
				}
				if r1 != nil {
					r1(d)
				}
			}
		}
	}
	{
		h1 := t.OnStmtExec
		h2 := x.OnStmtExec
		ret.OnStmtExec = func(d DatabaseSQLStmtExecStartInfo) func(DatabaseSQLStmtExecDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(DatabaseSQLStmtExecDoneInfo)
			if h1 != nil {
				r = h1(d)
			}
			if h2 != nil {
				r1 = h2(d)
			}
			return func(d DatabaseSQLStmtExecDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(d)
				}
				if r1 != nil {
					r1(d)
				}
			}
		}
	}
	{
		h1 := t.OnStmtClose
		h2 := x.OnStmtClose
		ret.OnStmtClose = func(d DatabaseSQLStmtCloseStartInfo) func(DatabaseSQLStmtCloseDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(DatabaseSQLStmtCloseDoneInfo)
			if h1 != nil {
				r = h1(d)
			}
			if h2 != nil {
				r1 = h2(d)
			}
			return func(d DatabaseSQLStmtCloseDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(d)
				}
				if r1 != nil {
					r1(d)
				}
			}
		}
	}
	{
		h1 := t.OnDoTx
		h2 := x.OnDoTx
		ret.OnDoTx = func(d DatabaseSQLDoTxStartInfo) func(DatabaseSQLDoTxIntermediateInfo) func(DatabaseSQLDoTxDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(DatabaseSQLDoTxIntermediateInfo) func(DatabaseSQLDoTxDoneInfo)
			if h1 != nil {
				r = h1(d)
			}
			if h2 != nil {
				r1 = h2(d)
			}
			return func(d DatabaseSQLDoTxIntermediateInfo) func(DatabaseSQLDoTxDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				var r2, r3 func(DatabaseSQLDoTxDoneInfo)
				if r != nil {
					r2 = r(d)
				}
				if r1 != nil {
					r3 = r1(d)
				}
				return func(d DatabaseSQLDoTxDoneInfo) {
					if options.panicCallback != nil {
						defer func() {
							if e := recover(); e != nil {
								options.panicCallback(e)
							}
						}()
					}
					if r2 != nil {
						r2(d)
					}
					if r3 != nil {
						r3(d)
					}
				}
			}
		}
	}
	return &ret
}
func (t *DatabaseSQL) onConnectorConnect(d DatabaseSQLConnectorConnectStartInfo) func(DatabaseSQLConnectorConnectDoneInfo) {
	fn := t.OnConnectorConnect
	if fn == nil {
		return func(DatabaseSQLConnectorConnectDoneInfo) {
			return
		}
	}
	res := fn(d)
	if res == nil {
		return func(DatabaseSQLConnectorConnectDoneInfo) {
			return
		}
	}
	return res
}
func (t *DatabaseSQL) onConnPing(d DatabaseSQLConnPingStartInfo) func(DatabaseSQLConnPingDoneInfo) {
	fn := t.OnConnPing
	if fn == nil {
		return func(DatabaseSQLConnPingDoneInfo) {
			return
		}
	}
	res := fn(d)
	if res == nil {
		return func(DatabaseSQLConnPingDoneInfo) {
			return
		}
	}
	return res
}
func (t *DatabaseSQL) onConnPrepare(d DatabaseSQLConnPrepareStartInfo) func(DatabaseSQLConnPrepareDoneInfo) {
	fn := t.OnConnPrepare
	if fn == nil {
		return func(DatabaseSQLConnPrepareDoneInfo) {
			return
		}
	}
	res := fn(d)
	if res == nil {
		return func(DatabaseSQLConnPrepareDoneInfo) {
			return
		}
	}
	return res
}
func (t *DatabaseSQL) onConnClose(d DatabaseSQLConnCloseStartInfo) func(DatabaseSQLConnCloseDoneInfo) {
	fn := t.OnConnClose
	if fn == nil {
		return func(DatabaseSQLConnCloseDoneInfo) {
			return
		}
	}
	res := fn(d)
	if res == nil {
		return func(DatabaseSQLConnCloseDoneInfo) {
			return
		}
	}
	return res
}
func (t *DatabaseSQL) onConnBegin(d DatabaseSQLConnBeginStartInfo) func(DatabaseSQLConnBeginDoneInfo) {
	fn := t.OnConnBegin
	if fn == nil {
		return func(DatabaseSQLConnBeginDoneInfo) {
			return
		}
	}
	res := fn(d)
	if res == nil {
		return func(DatabaseSQLConnBeginDoneInfo) {
			return
		}
	}
	return res
}
func (t *DatabaseSQL) onConnBeginTx(d DatabaseSQLConnBeginTxStartInfo) func(DatabaseSQLConnBeginTxDoneInfo) {
	fn := t.OnConnBeginTx
	if fn == nil {
		return func(DatabaseSQLConnBeginTxDoneInfo) {
			return
		}
	}
	res := fn(d)
	if res == nil {
		return func(DatabaseSQLConnBeginTxDoneInfo) {
			return
		}
	}
	return res
}
func (t *DatabaseSQL) onConnCheckNamedValue(d DatabaseSQLConnCheckNamedValueStartInfo) func(DatabaseSQLConnCheckNamedValueDoneInfo) {
	fn := t.OnConnCheckNamedValue
	if fn == nil {
		return func(DatabaseSQLConnCheckNamedValueDoneInfo) {
			return
		}
	}
	res := fn(d)
	if res == nil {
		return func(DatabaseSQLConnCheckNamedValueDoneInfo) {
			return
		}
	}
	return res
}
func (t *DatabaseSQL) onConnQuery(d DatabaseSQLConnQueryStartInfo) func(DatabaseSQLConnQueryDoneInfo) {
	fn := t.OnConnQuery
	if fn == nil {
		return func(DatabaseSQLConnQueryDoneInfo) {
			return
		}
	}
	res := fn(d)
	if res == nil {
		return func(DatabaseSQLConnQueryDoneInfo) {
			return
		}
	}
	return res
}
func (t *DatabaseSQL) onConnExec(d DatabaseSQLConnExecStartInfo) func(DatabaseSQLConnExecDoneInfo) {
	fn := t.OnConnExec
	if fn == nil {
		return func(DatabaseSQLConnExecDoneInfo) {
			return
		}
	}
	res := fn(d)
	if res == nil {
		return func(DatabaseSQLConnExecDoneInfo) {
			return
		}
	}
	return res
}
func (t *DatabaseSQL) onConnIsTableExists(d DatabaseSQLConnIsTableExistsStartInfo) func(DatabaseSQLConnIsTableExistsDoneInfo) {
	fn := t.OnConnIsTableExists
	if fn == nil {
		return func(DatabaseSQLConnIsTableExistsDoneInfo) {
			return
		}
	}
	res := fn(d)
	if res == nil {
		return func(DatabaseSQLConnIsTableExistsDoneInfo) {
			return
		}
	}
	return res
}
func (t *DatabaseSQL) onConnIsColumnExists(info DatabaseSQLConnIsColumnExistsStartInfo) func(DatabaseSQLConnIsColumnExistsDoneInfo) {
	fn := t.OnConnIsColumnExists
	if fn == nil {
		return func(DatabaseSQLConnIsColumnExistsDoneInfo) {
			return
		}
	}
	res := fn(info)
	if res == nil {
		return func(DatabaseSQLConnIsColumnExistsDoneInfo) {
			return
		}
	}
	return res
}
func (t *DatabaseSQL) onConnGetIndexColumns(info DatabaseSQLConnGetIndexColumnsStartInfo) func(DatabaseSQLConnGetIndexColumnsDoneInfo) {
	fn := t.OnConnGetIndexColumns
	if fn == nil {
		return func(DatabaseSQLConnGetIndexColumnsDoneInfo) {
			return
		}
	}
	res := fn(info)
	if res == nil {
		return func(DatabaseSQLConnGetIndexColumnsDoneInfo) {
			return
		}
	}
	return res
}
func (t *DatabaseSQL) onTxQuery(d DatabaseSQLTxQueryStartInfo) func(DatabaseSQLTxQueryDoneInfo) {
	fn := t.OnTxQuery
	if fn == nil {
		return func(DatabaseSQLTxQueryDoneInfo) {
			return
		}
	}
	res := fn(d)
	if res == nil {
		return func(DatabaseSQLTxQueryDoneInfo) {
			return
		}
	}
	return res
}
func (t *DatabaseSQL) onTxExec(d DatabaseSQLTxExecStartInfo) func(DatabaseSQLTxExecDoneInfo) {
	fn := t.OnTxExec
	if fn == nil {
		return func(DatabaseSQLTxExecDoneInfo) {
			return
		}
	}
	res := fn(d)
	if res == nil {
		return func(DatabaseSQLTxExecDoneInfo) {
			return
		}
	}
	return res
}
func (t *DatabaseSQL) onTxPrepare(d DatabaseSQLTxPrepareStartInfo) func(DatabaseSQLTxPrepareDoneInfo) {
	fn := t.OnTxPrepare
	if fn == nil {
		return func(DatabaseSQLTxPrepareDoneInfo) {
			return
		}
	}
	res := fn(d)
	if res == nil {
		return func(DatabaseSQLTxPrepareDoneInfo) {
			return
		}
	}
	return res
}
func (t *DatabaseSQL) onTxCommit(d DatabaseSQLTxCommitStartInfo) func(DatabaseSQLTxCommitDoneInfo) {
	fn := t.OnTxCommit
	if fn == nil {
		return func(DatabaseSQLTxCommitDoneInfo) {
			return
		}
	}
	res := fn(d)
	if res == nil {
		return func(DatabaseSQLTxCommitDoneInfo) {
			return
		}
	}
	return res
}
func (t *DatabaseSQL) onTxRollback(d DatabaseSQLTxRollbackStartInfo) func(DatabaseSQLTxRollbackDoneInfo) {
	fn := t.OnTxRollback
	if fn == nil {
		return func(DatabaseSQLTxRollbackDoneInfo) {
			return
		}
	}
	res := fn(d)
	if res == nil {
		return func(DatabaseSQLTxRollbackDoneInfo) {
			return
		}
	}
	return res
}
func (t *DatabaseSQL) onStmtQuery(d DatabaseSQLStmtQueryStartInfo) func(DatabaseSQLStmtQueryDoneInfo) {
	fn := t.OnStmtQuery
	if fn == nil {
		return func(DatabaseSQLStmtQueryDoneInfo) {
			return
		}
	}
	res := fn(d)
	if res == nil {
		return func(DatabaseSQLStmtQueryDoneInfo) {
			return
		}
	}
	return res
}
func (t *DatabaseSQL) onStmtExec(d DatabaseSQLStmtExecStartInfo) func(DatabaseSQLStmtExecDoneInfo) {
	fn := t.OnStmtExec
	if fn == nil {
		return func(DatabaseSQLStmtExecDoneInfo) {
			return
		}
	}
	res := fn(d)
	if res == nil {
		return func(DatabaseSQLStmtExecDoneInfo) {
			return
		}
	}
	return res
}
func (t *DatabaseSQL) onStmtClose(d DatabaseSQLStmtCloseStartInfo) func(DatabaseSQLStmtCloseDoneInfo) {
	fn := t.OnStmtClose
	if fn == nil {
		return func(DatabaseSQLStmtCloseDoneInfo) {
			return
		}
	}
	res := fn(d)
	if res == nil {
		return func(DatabaseSQLStmtCloseDoneInfo) {
			return
		}
	}
	return res
}
func (t *DatabaseSQL) onDoTx(d DatabaseSQLDoTxStartInfo) func(DatabaseSQLDoTxIntermediateInfo) func(DatabaseSQLDoTxDoneInfo) {
	fn := t.OnDoTx
	if fn == nil {
		return func(DatabaseSQLDoTxIntermediateInfo) func(DatabaseSQLDoTxDoneInfo) {
			return func(DatabaseSQLDoTxDoneInfo) {
				return
			}
		}
	}
	res := fn(d)
	if res == nil {
		return func(DatabaseSQLDoTxIntermediateInfo) func(DatabaseSQLDoTxDoneInfo) {
			return func(DatabaseSQLDoTxDoneInfo) {
				return
			}
		}
	}
	return func(d DatabaseSQLDoTxIntermediateInfo) func(DatabaseSQLDoTxDoneInfo) {
		res := res(d)
		if res == nil {
			return func(DatabaseSQLDoTxDoneInfo) {
				return
			}
		}
		return res
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func DatabaseSQLOnConnectorConnect(t *DatabaseSQL, c *context.Context, call call) func(session sessionInfo, _ error) {
	var p DatabaseSQLConnectorConnectStartInfo
	p.Context = c
	p.Call = call
	res := t.onConnectorConnect(p)
	return func(session sessionInfo, e error) {
		var p DatabaseSQLConnectorConnectDoneInfo
		p.Session = session
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func DatabaseSQLOnConnPing(t *DatabaseSQL, c *context.Context, call call) func(error) {
	var p DatabaseSQLConnPingStartInfo
	p.Context = c
	p.Call = call
	res := t.onConnPing(p)
	return func(e error) {
		var p DatabaseSQLConnPingDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func DatabaseSQLOnConnPrepare(t *DatabaseSQL, c *context.Context, call call, query string) func(error) {
	var p DatabaseSQLConnPrepareStartInfo
	p.Context = c
	p.Call = call
	p.Query = query
	res := t.onConnPrepare(p)
	return func(e error) {
		var p DatabaseSQLConnPrepareDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func DatabaseSQLOnConnClose(t *DatabaseSQL, c *context.Context, call call) func(error) {
	var p DatabaseSQLConnCloseStartInfo
	p.Context = c
	p.Call = call
	res := t.onConnClose(p)
	return func(e error) {
		var p DatabaseSQLConnCloseDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func DatabaseSQLOnConnBegin(t *DatabaseSQL, c *context.Context, call call) func(tx txInfo, _ error) {
	var p DatabaseSQLConnBeginStartInfo
	p.Context = c
	p.Call = call
	res := t.onConnBegin(p)
	return func(tx txInfo, e error) {
		var p DatabaseSQLConnBeginDoneInfo
		p.Tx = tx
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func DatabaseSQLOnConnBeginTx(t *DatabaseSQL, c *context.Context, call call) func(tx txInfo, _ error) {
	var p DatabaseSQLConnBeginTxStartInfo
	p.Context = c
	p.Call = call
	res := t.onConnBeginTx(p)
	return func(tx txInfo, e error) {
		var p DatabaseSQLConnBeginTxDoneInfo
		p.Tx = tx
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func DatabaseSQLOnConnCheckNamedValue(t *DatabaseSQL, c *context.Context, call call, value *driver.NamedValue) func(error) {
	var p DatabaseSQLConnCheckNamedValueStartInfo
	p.Context = c
	p.Call = call
	p.Value = value
	res := t.onConnCheckNamedValue(p)
	return func(e error) {
		var p DatabaseSQLConnCheckNamedValueDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func DatabaseSQLOnConnQuery(t *DatabaseSQL, c *context.Context, call call, query string, mode string, idempotent bool, idleTime time.Duration) func(error) {
	var p DatabaseSQLConnQueryStartInfo
	p.Context = c
	p.Call = call
	p.Query = query
	p.Mode = mode
	p.Idempotent = idempotent
	p.IdleTime = idleTime
	res := t.onConnQuery(p)
	return func(e error) {
		var p DatabaseSQLConnQueryDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func DatabaseSQLOnConnExec(t *DatabaseSQL, c *context.Context, call call, query string, mode string, idempotent bool, idleTime time.Duration) func(error) {
	var p DatabaseSQLConnExecStartInfo
	p.Context = c
	p.Call = call
	p.Query = query
	p.Mode = mode
	p.Idempotent = idempotent
	p.IdleTime = idleTime
	res := t.onConnExec(p)
	return func(e error) {
		var p DatabaseSQLConnExecDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func DatabaseSQLOnConnIsTableExists(t *DatabaseSQL, c *context.Context, call call, tableName string) func(exists bool, _ error) {
	var p DatabaseSQLConnIsTableExistsStartInfo
	p.Context = c
	p.Call = call
	p.TableName = tableName
	res := t.onConnIsTableExists(p)
	return func(exists bool, e error) {
		var p DatabaseSQLConnIsTableExistsDoneInfo
		p.Exists = exists
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func DatabaseSQLOnConnIsColumnExists(t *DatabaseSQL, c *context.Context, call call, tableName string, columnName string) func(exists bool, _ error) {
	var p DatabaseSQLConnIsColumnExistsStartInfo
	p.Context = c
	p.Call = call
	p.TableName = tableName
	p.ColumnName = columnName
	res := t.onConnIsColumnExists(p)
	return func(exists bool, e error) {
		var p DatabaseSQLConnIsColumnExistsDoneInfo
		p.Exists = exists
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func DatabaseSQLOnConnGetIndexColumns(t *DatabaseSQL, c *context.Context, call call, tableName string, indexName string) func(columns []string, _ error) {
	var p DatabaseSQLConnGetIndexColumnsStartInfo
	p.Context = c
	p.Call = call
	p.TableName = tableName
	p.IndexName = indexName
	res := t.onConnGetIndexColumns(p)
	return func(columns []string, e error) {
		var p DatabaseSQLConnGetIndexColumnsDoneInfo
		p.Columns = columns
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func DatabaseSQLOnTxQuery(t *DatabaseSQL, c *context.Context, call call, txContext context.Context, tx txInfo, query string) func(error) {
	var p DatabaseSQLTxQueryStartInfo
	p.Context = c
	p.Call = call
	p.TxContext = txContext
	p.Tx = tx
	p.Query = query
	res := t.onTxQuery(p)
	return func(e error) {
		var p DatabaseSQLTxQueryDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func DatabaseSQLOnTxExec(t *DatabaseSQL, c *context.Context, call call, txContext context.Context, tx txInfo, query string) func(error) {
	var p DatabaseSQLTxExecStartInfo
	p.Context = c
	p.Call = call
	p.TxContext = txContext
	p.Tx = tx
	p.Query = query
	res := t.onTxExec(p)
	return func(e error) {
		var p DatabaseSQLTxExecDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func DatabaseSQLOnTxPrepare(t *DatabaseSQL, c *context.Context, call call, txContext context.Context, tx txInfo, query string) func(error) {
	var p DatabaseSQLTxPrepareStartInfo
	p.Context = c
	p.Call = call
	p.TxContext = txContext
	p.Tx = tx
	p.Query = query
	res := t.onTxPrepare(p)
	return func(e error) {
		var p DatabaseSQLTxPrepareDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func DatabaseSQLOnTxCommit(t *DatabaseSQL, c *context.Context, call call, tx txInfo) func(error) {
	var p DatabaseSQLTxCommitStartInfo
	p.Context = c
	p.Call = call
	p.Tx = tx
	res := t.onTxCommit(p)
	return func(e error) {
		var p DatabaseSQLTxCommitDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func DatabaseSQLOnTxRollback(t *DatabaseSQL, c *context.Context, call call, tx txInfo) func(error) {
	var p DatabaseSQLTxRollbackStartInfo
	p.Context = c
	p.Call = call
	p.Tx = tx
	res := t.onTxRollback(p)
	return func(e error) {
		var p DatabaseSQLTxRollbackDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func DatabaseSQLOnStmtQuery(t *DatabaseSQL, c *context.Context, call call, stmtContext context.Context, query string) func(error) {
	var p DatabaseSQLStmtQueryStartInfo
	p.Context = c
	p.Call = call
	p.StmtContext = stmtContext
	p.Query = query
	res := t.onStmtQuery(p)
	return func(e error) {
		var p DatabaseSQLStmtQueryDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func DatabaseSQLOnStmtExec(t *DatabaseSQL, c *context.Context, call call, stmtContext context.Context, query string) func(error) {
	var p DatabaseSQLStmtExecStartInfo
	p.Context = c
	p.Call = call
	p.StmtContext = stmtContext
	p.Query = query
	res := t.onStmtExec(p)
	return func(e error) {
		var p DatabaseSQLStmtExecDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func DatabaseSQLOnStmtClose(t *DatabaseSQL, stmtContext *context.Context, call call) func(error) {
	var p DatabaseSQLStmtCloseStartInfo
	p.StmtContext = stmtContext
	p.Call = call
	res := t.onStmtClose(p)
	return func(e error) {
		var p DatabaseSQLStmtCloseDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func DatabaseSQLOnDoTx(t *DatabaseSQL, c *context.Context, call call, iD string, idempotent bool) func(error) func(attempts int, _ error) {
	var p DatabaseSQLDoTxStartInfo
	p.Context = c
	p.Call = call
	p.ID = iD
	p.Idempotent = idempotent
	res := t.onDoTx(p)
	return func(e error) func(int, error) {
		var p DatabaseSQLDoTxIntermediateInfo
		p.Error = e
		res := res(p)
		return func(attempts int, e error) {
			var p DatabaseSQLDoTxDoneInfo
			p.Attempts = attempts
			p.Error = e
			res(p)
		}
	}
}
