Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Session ¶
type Session interface {
variable.SessionVarsProvider
// GetStore returns the kv store
GetStore() kv.Storage
// GetLatestInfoSchema returns information schema of latest info schema.
GetLatestInfoSchema() infoschema.MetaOnlyInfoSchema
// SessionInfoSchema returns information schema of current session
SessionInfoSchema() infoschema.MetaOnlyInfoSchema
// GetSQLExecutor returns the sql executor
GetSQLExecutor() sqlexec.SQLExecutor
// 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()
// Now returns the current time in location specified by session var
Now() time.Time
// AvoidReuse is used to avoid reuse the session
AvoidReuse()
}
Session is used to execute queries for TTL case
func NewSession ¶
func NewSession(sctx sessionctx.Context, avoidReuse func()) Session
NewSession creates a new Session
Click to show internal directories.
Click to hide internal directories.