Documentation ¶
Index ¶
- func CollectDBs(ctx context.Context, mrEnv *env.MultiRepoEnv) ([]sqle.SqlDatabase, error)
- func GetCommitHooks(ctx context.Context, dEnv *env.DoltEnv) ([]doltdb.CommitHook, error)
- func PrettyPrintResults(ctx *sql.Context, resultFormat PrintResultFormat, sqlSch sql.Schema, ...) (rerr error)
- type PrintResultFormat
- type SqlEngine
- func (se *SqlEngine) Analyze(ctx *sql.Context, n sql.Node) (sql.Node, error)
- func (se *SqlEngine) Close() error
- func (se *SqlEngine) Dbddl(ctx *sql.Context, dbddl *sqlparser.DBDDL, query string) (sql.Schema, sql.RowIter, error)
- func (se *SqlEngine) GetReturnFormat() PrintResultFormat
- func (se *SqlEngine) GetRoots(sqlCtx *sql.Context) (map[string]*doltdb.RootValue, error)
- func (se *SqlEngine) GetUnderlyingEngine() *gms.Engine
- func (se *SqlEngine) IterDBs(cb func(name string, db dsqle.SqlDatabase) (stop bool, err error)) error
- func (se *SqlEngine) NewContext(ctx context.Context) (*sql.Context, error)
- func (se *SqlEngine) NewDoltSession(ctx context.Context, mysqlSess *sql.BaseSession) (*dsess.DoltSession, error)
- func (se *SqlEngine) Query(ctx *sql.Context, query string) (sql.Schema, sql.RowIter, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectDBs ¶
func CollectDBs(ctx context.Context, mrEnv *env.MultiRepoEnv) ([]sqle.SqlDatabase, error)
CollectDBs takes a MultiRepoEnv and creates Database objects from each environment and returns a slice of these objects.
func GetCommitHooks ¶
GetCommitHooks creates a list of hooks to execute on database commit. If doltdb.SkipReplicationErrorsKey is set, replace misconfigured hooks with doltdb.LogHook instances that prints a warning when trying to execute.
Types ¶
type PrintResultFormat ¶
type PrintResultFormat byte
const ( FormatTabular PrintResultFormat = iota FormatCsv FormatJson FormatNull // used for profiling FormatVertical )
type SqlEngine ¶
type SqlEngine struct {
// contains filtered or unexported fields
}
SqlEngine packages up the context necessary to run sql queries against dsqle.
func NewRebasedSqlEngine ¶
NewRebasedEngine returns a smalled rebased engine primarily used in filterbranch.
func NewSqlEngine ¶
func NewSqlEngine( ctx context.Context, mrEnv *env.MultiRepoEnv, format PrintResultFormat, initialDb string, isReadOnly bool, tempUsers []gms.TemporaryUser, autocommit bool) (*SqlEngine, error)
NewSqlEngine returns a SqlEngine
func (*SqlEngine) Dbddl ¶
func (se *SqlEngine) Dbddl(ctx *sql.Context, dbddl *sqlparser.DBDDL, query string) (sql.Schema, sql.RowIter, error)
TODO: All of this logic should be moved to the engine...
func (*SqlEngine) GetReturnFormat ¶
func (se *SqlEngine) GetReturnFormat() PrintResultFormat
GetReturnFormat() returns the printing format the engine is associated with.
func (*SqlEngine) GetRoots ¶
GetRoots returns the underlying roots values the engine read/writes to.
func (*SqlEngine) GetUnderlyingEngine ¶
func (*SqlEngine) IterDBs ¶
func (se *SqlEngine) IterDBs(cb func(name string, db dsqle.SqlDatabase) (stop bool, err error)) error
IterDBs iterates over the set of databases the engine wraps.
func (*SqlEngine) NewContext ¶
NewContext converts a context.Context to a sql.Context.
func (*SqlEngine) NewDoltSession ¶
func (se *SqlEngine) NewDoltSession(ctx context.Context, mysqlSess *sql.BaseSession) (*dsess.DoltSession, error)