Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Session ¶
type Session interface {
sessionctx.Context
// SessionInfoSchema returns information schema of current session
SessionInfoSchema() infoschema.InfoSchema
// ExecuteSQL executes the sql
ExecuteSQL(ctx context.Context, sql string, args ...any) ([]chunk.Row, error)
// RunInTxn executes the specified function in a txn
RunInTxn(ctx context.Context, fn func() error, mode TxnMode) (err error)
// ResetWithGlobalTimeZone resets the session time zone to global time zone
ResetWithGlobalTimeZone(ctx context.Context) error
// GlobalTimeZone returns the global timezone. It is used to compute expire time for TTL
GlobalTimeZone(ctx context.Context) (*time.Location, error)
// KillStmt kills the current statement execution
KillStmt()
// Close closes the session
Close()
// Now returns the current time in location specified by session var
Now() time.Time
}
Session is used to execute queries for TTL case
func NewSession ¶
func NewSession(sctx sessionctx.Context, sqlExec sqlexec.SQLExecutor, closeFn func(Session)) Session
NewSession creates a new Session
Click to show internal directories.
Click to hide internal directories.