Documentation ¶
Index ¶
- Variables
- type ColumnWithRawDefault
- type Config
- type Engine
- func (e *Engine) AnalyzeQuery(ctx *sql.Context, query string) (sql.Node, error)
- func (e *Engine) Close() error
- func (e *Engine) CloseSession(connID uint32)
- func (e *Engine) IsReadOnly() bool
- func (e *Engine) PrepareQuery(ctx *sql.Context, query string) (sql.Node, error)
- func (e *Engine) Query(ctx *sql.Context, query string) (sql.Schema, sql.RowIter, error)
- func (e *Engine) QueryNodeWithBindings(ctx *sql.Context, query string, parsed sqlparser.Statement, ...) (sql.Schema, sql.RowIter, error)
- func (e *Engine) QueryWithBindings(ctx *sql.Context, query string, bindings map[string]*querypb.BindVariable) (sql.Schema, sql.RowIter, error)
- func (e *Engine) WithBackgroundThreads(b *sql.BackgroundThreads) *Engine
- type PreparedDataCache
- func (p *PreparedDataCache) CacheStmt(sessId uint32, query string, stmt sqlparser.Statement)
- func (p *PreparedDataCache) DeleteSessionData(sessId uint32)
- func (p *PreparedDataCache) GetCachedStmt(sessId uint32, query string) (*sqlparser.ParsedQuery, bool)
- func (p *PreparedDataCache) GetSessionData(sessId uint32) map[string]*sqlparser.ParsedQuery
- func (p *PreparedDataCache) UncacheStmt(sessId uint32, query string)
- type ProcessList
- func (pl *ProcessList) AddConnection(id uint32, addr string)
- func (pl *ProcessList) AddPartitionProgress(pid uint64, tableName, partitionName string, total int64)
- func (pl *ProcessList) AddTableProgress(pid uint64, name string, total int64)
- func (pl *ProcessList) BeginQuery(ctx *sql.Context, query string) (*sql.Context, error)
- func (pl *ProcessList) ConnectionReady(sess sql.Session)
- func (pl *ProcessList) EndQuery(ctx *sql.Context)
- func (pl *ProcessList) Kill(connID uint32)
- func (pl *ProcessList) Processes() []sql.Process
- func (pl *ProcessList) RemoveConnection(connID uint32)
- func (pl *ProcessList) RemovePartitionProgress(pid uint64, tableName, partitionName string)
- func (pl *ProcessList) RemoveTableProgress(pid uint64, name string)
- func (pl *ProcessList) UpdatePartitionProgress(pid uint64, tableName, partitionName string, delta int64)
- func (pl *ProcessList) UpdateTableProgress(pid uint64, name string, delta int64)
- type TemporaryUser
Constants ¶
This section is empty.
Variables ¶
var ExperimentalGMS bool
Functions ¶
This section is empty.
Types ¶
type ColumnWithRawDefault ¶
type Config ¶
type Config struct { // VersionPostfix to display with the `VERSION()` UDF. VersionPostfix string // IsReadOnly sets the engine to disallow modification queries. IsReadOnly bool IsServerLocked bool // IncludeRootAccount adds the root account (with no password) to the list of accounts, and also enables // authentication. IncludeRootAccount bool // TemporaryUsers adds any users that should be included when the engine is created. By default, authentication is // disabled, and including any users here will enable authentication. All users in this list will have full access. // This field is only temporary, and will be removed as development on users and authentication continues. TemporaryUsers []TemporaryUser }
Config for the Engine.
type Engine ¶
type Engine struct { Analyzer *analyzer.Analyzer LS *sql.LockSubsystem ProcessList sql.ProcessList MemoryManager *sql.MemoryManager BackgroundThreads *sql.BackgroundThreads ReadOnly atomic.Bool IsServerLocked bool PreparedDataCache *PreparedDataCache // contains filtered or unexported fields }
Engine is a SQL engine.
func New ¶
New creates a new Engine with custom configuration. To create an Engine with the default settings use `NewDefault`. Should call Engine.Close() to finalize dependency lifecycles.
func NewDefault ¶
func NewDefault(pro sql.DatabaseProvider) *Engine
NewDefault creates a new default Engine.
func (*Engine) AnalyzeQuery ¶
AnalyzeQuery analyzes a query and returns its sql.Node
func (*Engine) CloseSession ¶ added in v0.12.0
CloseSession deletes session specific prepared statement data
func (*Engine) IsReadOnly ¶ added in v0.12.0
func (*Engine) PrepareQuery ¶ added in v0.12.0
PrepareQuery returns a partially analyzed query
func (*Engine) QueryNodeWithBindings ¶ added in v0.10.0
func (e *Engine) QueryNodeWithBindings(ctx *sql.Context, query string, parsed sqlparser.Statement, bindings map[string]*querypb.BindVariable) (sql.Schema, sql.RowIter, error)
QueryNodeWithBindings executes the query given with the bindings provided. If parsed is non-nil, it will be used instead of parsing the query from text.
func (*Engine) QueryWithBindings ¶
func (e *Engine) QueryWithBindings(ctx *sql.Context, query string, bindings map[string]*querypb.BindVariable) (sql.Schema, sql.RowIter, error)
QueryWithBindings executes the query given with the bindings provided
func (*Engine) WithBackgroundThreads ¶ added in v0.12.0
func (e *Engine) WithBackgroundThreads(b *sql.BackgroundThreads) *Engine
type PreparedDataCache ¶ added in v0.15.0
type PreparedDataCache struct {
// contains filtered or unexported fields
}
PreparedDataCache manages all the prepared data for every session for every query for an engine
func NewPreparedDataCache ¶ added in v0.15.0
func NewPreparedDataCache() *PreparedDataCache
func (*PreparedDataCache) CacheStmt ¶ added in v0.15.0
func (p *PreparedDataCache) CacheStmt(sessId uint32, query string, stmt sqlparser.Statement)
CacheStmt saves the prepared node and associates a ctx.SessionId and query to it
func (*PreparedDataCache) DeleteSessionData ¶ added in v0.15.0
func (p *PreparedDataCache) DeleteSessionData(sessId uint32)
DeleteSessionData clears a session along with all prepared queries for that session
func (*PreparedDataCache) GetCachedStmt ¶ added in v0.15.0
func (p *PreparedDataCache) GetCachedStmt(sessId uint32, query string) (*sqlparser.ParsedQuery, bool)
GetCachedStmt will retrieve the prepared sql.Node associated with the ctx.SessionId and query if it exists it will return nil, false if the query does not exist
func (*PreparedDataCache) GetSessionData ¶ added in v0.15.0
func (p *PreparedDataCache) GetSessionData(sessId uint32) map[string]*sqlparser.ParsedQuery
GetSessionData returns all the prepared queries for a particular session
func (*PreparedDataCache) UncacheStmt ¶ added in v0.15.0
func (p *PreparedDataCache) UncacheStmt(sessId uint32, query string)
UncacheStmt removes the prepared node associated with a ctx.SessionId and query to it
type ProcessList ¶ added in v0.11.0
type ProcessList struct {
// contains filtered or unexported fields
}
ProcessList is a structure that keeps track of all the processes and their status.
func NewProcessList ¶ added in v0.11.0
func NewProcessList() *ProcessList
NewProcessList creates a new process list.
func (*ProcessList) AddConnection ¶ added in v0.15.0
func (pl *ProcessList) AddConnection(id uint32, addr string)
func (*ProcessList) AddPartitionProgress ¶ added in v0.11.0
func (pl *ProcessList) AddPartitionProgress(pid uint64, tableName, partitionName string, total int64)
AddPartitionProgress adds a new item to track progress from to the process with the given pid. If the pid or the table does not exist, it will do nothing.
func (*ProcessList) AddTableProgress ¶ added in v0.11.0
func (pl *ProcessList) AddTableProgress(pid uint64, name string, total int64)
AddTableProgress adds a new item to track progress from to the process with the given pid. If the pid does not exist, it will do nothing.
func (*ProcessList) BeginQuery ¶ added in v0.15.0
func (*ProcessList) ConnectionReady ¶ added in v0.15.0
func (pl *ProcessList) ConnectionReady(sess sql.Session)
func (*ProcessList) EndQuery ¶ added in v0.15.0
func (pl *ProcessList) EndQuery(ctx *sql.Context)
func (*ProcessList) Kill ¶ added in v0.11.0
func (pl *ProcessList) Kill(connID uint32)
Kill terminates all queries for a given connection id.
func (*ProcessList) Processes ¶ added in v0.11.0
func (pl *ProcessList) Processes() []sql.Process
Processes returns the list of current running processes.
func (*ProcessList) RemoveConnection ¶ added in v0.15.0
func (pl *ProcessList) RemoveConnection(connID uint32)
func (*ProcessList) RemovePartitionProgress ¶ added in v0.11.0
func (pl *ProcessList) RemovePartitionProgress(pid uint64, tableName, partitionName string)
RemovePartitionProgress removes an existing item tracking progress from the process with the given pid, if it exists.
func (*ProcessList) RemoveTableProgress ¶ added in v0.11.0
func (pl *ProcessList) RemoveTableProgress(pid uint64, name string)
RemoveTableProgress removes an existing item tracking progress from the process with the given pid, if it exists.
func (*ProcessList) UpdatePartitionProgress ¶ added in v0.11.0
func (pl *ProcessList) UpdatePartitionProgress(pid uint64, tableName, partitionName string, delta int64)
UpdatePartitionProgress updates the progress of the table partition with the given name for the process with the given pid.
func (*ProcessList) UpdateTableProgress ¶ added in v0.11.0
func (pl *ProcessList) UpdateTableProgress(pid uint64, name string, delta int64)
UpdateTableProgress updates the progress of the table with the given name for the process with the given pid.
type TemporaryUser ¶ added in v0.12.0
TemporaryUser is a user that will be added to the engine. This is for temporary use while the remaining features are implemented. Replaces the old "auth.New..." functions for adding a user.
Directories ¶
Path | Synopsis |
---|---|
Package driver implements a driver for Go's database/sql support.
|
Package driver implements a driver for Go's database/sql support. |
internal
|
|
time
Package time contains low-level utility functions for working with time.Time values and timezones.
|
Package time contains low-level utility functions for working with time.Time values and timezones. |
optgen
|
|