Documentation ¶
Index ¶
- Constants
- func ApplyDefaults(ctx *sql.Context, tblSch sql.Schema, cols []int, row sql.Row) (sql.Row, error)
- func ResolveDefaults(tableName string, schema []*ColumnWithRawDefault) (sql.Schema, error)
- type ColumnWithRawDefault
- type Config
- type Engine
- func (e *Engine) AnalyzeQuery(ctx *sql.Context, query string) (sql.Schema, error)
- func (e *Engine) Close() 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 sql.Node, ...) (sql.Schema, sql.RowIter, error)
- func (e *Engine) QueryWithBindings(ctx *sql.Context, query string, bindings map[string]sql.Expression) (sql.Schema, sql.RowIter, error)
- func (e *Engine) WithBackgroundThreads(b *sql.BackgroundThreads) *Engine
- type ProcessList
- func (pl *ProcessList) AddPartitionProgress(pid uint64, tableName, partitionName string, total int64)
- func (pl *ProcessList) AddProcess(ctx *sql.Context, query string) (*sql.Context, error)
- func (pl *ProcessList) AddTableProgress(pid uint64, name string, total int64)
- func (pl *ProcessList) Done(pid uint64)
- func (pl *ProcessList) Kill(connID uint32)
- func (pl *ProcessList) Processes() []sql.Process
- 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)
Constants ¶
const ConnectTimeLogKey = "connectTime"
const ConnectionIdLogField = "connectionID"
Variables ¶
This section is empty.
Functions ¶
func ApplyDefaults ¶
ApplyDefaults applies the default values of the given column indices to the given row, and returns a new row with the updated values. This assumes that the given row has placeholder `nil` values for the default entries, and also that each column in a table is present and in the order as represented by the schema. If no columns are given, then the given row is returned. Column indices should be sorted and in ascending order, however this is not enforced.
func ResolveDefaults ¶
func ResolveDefaults(tableName string, schema []*ColumnWithRawDefault) (sql.Schema, error)
ResolveDefaults takes in a schema, along with each column's default value in a string form, and returns the schema with the default values parsed and resolved.
Types ¶
type ColumnWithRawDefault ¶
type Config ¶
type Config struct { // VersionPostfix to display with the `VERSION()` UDF. VersionPostfix string // Auth used for authentication and authorization. Auth auth.Auth }
Config for the Engine.
type Engine ¶
type Engine struct { Analyzer *analyzer.Analyzer Auth auth.Auth LS *sql.LockSubsystem ProcessList sql.ProcessList MemoryManager *sql.MemoryManager BackgroundThreads *sql.BackgroundThreads }
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 Schema.
func (*Engine) Query ¶
Query executes a query. If parsed is non-nil, it will be used instead of parsing the query from text.
func (*Engine) QueryNodeWithBindings ¶
func (e *Engine) QueryNodeWithBindings( ctx *sql.Context, query string, parsed sql.Node, bindings map[string]sql.Expression, ) (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]sql.Expression, ) (sql.Schema, sql.RowIter, error)
QueryWithBindings executes the query given with the bindings provided
func (*Engine) WithBackgroundThreads ¶
func (e *Engine) WithBackgroundThreads(b *sql.BackgroundThreads) *Engine
type ProcessList ¶
type ProcessList struct {
// contains filtered or unexported fields
}
ProcessList is a structure that keeps track of all the processes and their status.
func (*ProcessList) AddPartitionProgress ¶
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) AddProcess ¶
AddProcess adds a new process to the list given a process type and a query
func (*ProcessList) AddTableProgress ¶
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) Done ¶
func (pl *ProcessList) Done(pid uint64)
Done removes the finished process with the given pid from the process list. If the process does not exist, it will do nothing.
func (*ProcessList) Kill ¶
func (pl *ProcessList) Kill(connID uint32)
Kill terminates all queries for a given connection id.
func (*ProcessList) Processes ¶
func (pl *ProcessList) Processes() []sql.Process
Processes returns the list of current running processes.
func (*ProcessList) RemovePartitionProgress ¶
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 ¶
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 ¶
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 ¶
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.
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
|
|