Documentation ¶
Index ¶
- Constants
- Variables
- func AddDoltSystemVariables()
- func CompressRow(sch schema.Schema, r row.Row) row.Row
- func CompressRows(sch schema.Schema, rs ...row.Row) []row.Row
- func CompressSchema(sch schema.Schema, colNames ...string) schema.Schema
- func CompressSchemas(schs ...schema.Schema) schema.Schema
- func CreateEmptyTestDatabase(dEnv *env.DoltEnv, t *testing.T)
- func CreateTestDatabase(dEnv *env.DoltEnv, t *testing.T)
- func DatetimeStrToTimestamp(datetime string) time.Time
- func DoltProceduresAddProcedure(ctx *sql.Context, db Database, spd sql.StoredProcedureDetails) (retErr error)
- func DoltProceduresDropProcedure(ctx *sql.Context, db Database, name string) (retErr error)
- func DoltProceduresGetAll(ctx *sql.Context, db Database) ([]sql.StoredProcedureDetails, error)
- func DoltProceduresGetDetails(ctx *sql.Context, tbl *WritableDoltTable, name string) (sql.StoredProcedureDetails, bool, error)
- func DoltSchemaFromAlterableTable(t *AlterableDoltTable) schema.Schema
- func DoltTableFromAlterableTable(ctx *sql.Context, t *AlterableDoltTable) *doltdb.Table
- func ExecuteSelect(t *testing.T, dEnv *env.DoltEnv, ddb *doltdb.DoltDB, root *doltdb.RootValue, ...) ([]sql.Row, error)
- func ExecuteSql(t *testing.T, dEnv *env.DoltEnv, root *doltdb.RootValue, statements string) (*doltdb.RootValue, error)
- func FindRowIndex(find row.Row, rows []row.Row) int
- func GetAllRows(root *doltdb.RootValue, tableName string) ([]row.Row, error)
- func GetCommitHooks(ctx context.Context, bThreads *sql.BackgroundThreads, dEnv *env.DoltEnv, ...) ([]doltdb.CommitHook, error)
- func GetCreateTableStmt(ctx *sql.Context, engine *sqle.Engine, tableName string) (string, error)
- func GetInitialDBState(ctx context.Context, db SqlDatabase) (dsess.InitialDbState, error)
- func InitializeWithHistory(t *testing.T, ctx context.Context, dEnv *env.DoltEnv, ...)
- func MutateRow(sch schema.Schema, r row.Row, tagsAndVals ...interface{}) row.Row
- func NewDiffTableFunctionRowIter(partitions *dtables.DiffPartitions, ddb *doltdb.DoltDB, joiner *rowconv.Joiner) *diffTableFunctionRowIter
- func NewDiffTableFunctionRowIterForSinglePartition(partition sql.Partition, ddb *doltdb.DoltDB, joiner *rowconv.Joiner) *diffTableFunctionRowIter
- func NewPeopleRow(id int, first, last string, isMarried bool, age int, rating float64) row.Row
- func NewPeopleRowWithOptionalFields(id int, first, last string, isMarried bool, age int, rating float64, ...) row.Row
- func NewTestEngine(t *testing.T, dEnv *env.DoltEnv, ctx context.Context, db Database, ...) (*sqle.Engine, *sql.Context, error)
- func NewTestSQLCtx(ctx context.Context) *sql.Context
- func NewTestSQLCtxWithProvider(ctx context.Context, pro dsess.RevisionDatabaseProvider) *sql.Context
- func PrepareCreateTableStmt(ctx context.Context, sqlDb sql.Database) (*sql.Context, *sqle.Engine, *dsess.Session)
- func ProceduresTableSchema() schema.Schema
- func ProceduresTableSqlSchema() sql.PrimaryKeySchema
- func ProllyRowIterFromPartition(ctx context.Context, tbl *doltdb.Table, projections []string, ...) (sql.RowIter, error)
- func Rs(rows ...row.Row) []row.Row
- func SchemasTableSchema() schema.Schema
- func SkipReplicationWarnings() bool
- func SubsetSchema(sch schema.Schema, colNames ...string) schema.Schema
- func TableToRowIter(ctx *sql.Context, table *WritableDoltTable, columns []string) (sql.RowIter, error)
- func ToSqlRows(sch schema.Schema, rs ...row.Row) []sql.Row
- func UpdateTables(t *testing.T, ctx context.Context, root *doltdb.RootValue, ...) *doltdb.RootValue
- type AlterableDoltTable
- func (t *AlterableDoltTable) AddColumn(ctx *sql.Context, column *sql.Column, order *sql.ColumnOrder) error
- func (t *AlterableDoltTable) AddForeignKey(ctx *sql.Context, sqlFk sql.ForeignKeyConstraint) error
- func (t *AlterableDoltTable) CreateCheck(ctx *sql.Context, check *sql.CheckDefinition) error
- func (t *AlterableDoltTable) CreateIndex(ctx *sql.Context, indexName string, using sql.IndexUsing, ...) error
- func (t *AlterableDoltTable) CreateIndexForForeignKey(ctx *sql.Context, indexName string, using sql.IndexUsing, ...) error
- func (t *AlterableDoltTable) CreatePrimaryKey(ctx *sql.Context, columns []sql.IndexColumn) error
- func (t *AlterableDoltTable) DropCheck(ctx *sql.Context, chName string) error
- func (t *AlterableDoltTable) DropColumn(ctx *sql.Context, columnName string) error
- func (t *AlterableDoltTable) DropForeignKey(ctx *sql.Context, fkName string) error
- func (t *AlterableDoltTable) DropIndex(ctx *sql.Context, indexName string) error
- func (t *AlterableDoltTable) DropPrimaryKey(ctx *sql.Context) error
- func (t *AlterableDoltTable) GetForeignKeyUpdater(ctx *sql.Context) sql.ForeignKeyUpdater
- func (t *AlterableDoltTable) ModifyColumn(ctx *sql.Context, columnName string, column *sql.Column, ...) error
- func (t *AlterableDoltTable) PrimaryKeySchema() sql.PrimaryKeySchema
- func (t *AlterableDoltTable) RenameIndex(ctx *sql.Context, fromIndexName string, toIndexName string) error
- func (t *AlterableDoltTable) RewriteInserter(ctx *sql.Context, newSchema sql.PrimaryKeySchema) (sql.RowInserter, error)
- func (t *AlterableDoltTable) ShouldRewriteTable(ctx *sql.Context, oldSchema sql.PrimaryKeySchema, ...) bool
- func (t *AlterableDoltTable) UpdateForeignKey(ctx *sql.Context, fkName string, sqlFk sql.ForeignKeyConstraint) error
- func (t *AlterableDoltTable) WithProjections(colNames []string) sql.Table
- type Database
- func (db Database) AllViews(ctx *sql.Context) ([]sql.ViewDefinition, error)
- func (db Database) CommitTransaction(ctx *sql.Context, tx sql.Transaction) error
- func (db Database) CreateSavepoint(ctx *sql.Context, tx sql.Transaction, name string) error
- func (db Database) CreateTable(ctx *sql.Context, tableName string, sch sql.PrimaryKeySchema) error
- func (db Database) CreateTemporaryTable(ctx *sql.Context, tableName string, pkSch sql.PrimaryKeySchema) error
- func (db Database) CreateTrigger(ctx *sql.Context, definition sql.TriggerDefinition) error
- func (db Database) CreateView(ctx *sql.Context, name string, definition string) error
- func (db Database) DbData() env.DbData
- func (db Database) DropStoredProcedure(ctx *sql.Context, name string) error
- func (db Database) DropTable(ctx *sql.Context, tableName string) error
- func (db Database) DropTrigger(ctx *sql.Context, name string) error
- func (db Database) DropView(ctx *sql.Context, name string) error
- func (db Database) EditOptions() editor.Options
- func (db Database) Flush(ctx *sql.Context) error
- func (db Database) GetAllTableNames(ctx *sql.Context) ([]string, error)
- func (db Database) GetAllTemporaryTables(ctx *sql.Context) ([]sql.Table, error)
- func (db Database) GetDocsReadWriter() env.DocsReadWriter
- func (db Database) GetDoltDB() *doltdb.DoltDB
- func (db Database) GetExternalStoredProcedures(ctx *sql.Context) ([]sql.ExternalStoredProcedureDetails, error)
- func (db Database) GetGlobalState() globalstate.GlobalState
- func (db Database) GetHeadRoot(ctx *sql.Context) (*doltdb.RootValue, error)
- func (db Database) GetRoot(ctx *sql.Context) (*doltdb.RootValue, error)
- func (db Database) GetStateReader() env.RepoStateReader
- func (db Database) GetStateWriter() env.RepoStateWriter
- func (db Database) GetStoredProcedures(ctx *sql.Context) ([]sql.StoredProcedureDetails, error)
- func (db Database) GetTableInsensitive(ctx *sql.Context, tblName string) (sql.Table, bool, error)
- func (db Database) GetTableInsensitiveAsOf(ctx *sql.Context, tableName string, asOf interface{}) (sql.Table, bool, error)
- func (db Database) GetTableInsensitiveWithRoot(ctx *sql.Context, root *doltdb.RootValue, tblName string) (sql.Table, bool, error)
- func (db Database) GetTableNames(ctx *sql.Context) ([]string, error)
- func (db Database) GetTableNamesAsOf(ctx *sql.Context, time interface{}) ([]string, error)
- func (db Database) GetTriggers(ctx *sql.Context) ([]sql.TriggerDefinition, error)
- func (db Database) GetView(ctx *sql.Context, viewName string) (string, bool, error)
- func (db Database) GetWorkingSet(ctx *sql.Context) (*doltdb.WorkingSet, error)
- func (db Database) Name() string
- func (db Database) ReleaseSavepoint(ctx *sql.Context, tx sql.Transaction, name string) error
- func (db Database) RenameTable(ctx *sql.Context, oldName, newName string) error
- func (db Database) Rollback(ctx *sql.Context, tx sql.Transaction) error
- func (db Database) RollbackToSavepoint(ctx *sql.Context, tx sql.Transaction, name string) error
- func (db Database) SaveStoredProcedure(ctx *sql.Context, spd sql.StoredProcedureDetails) error
- func (db Database) SetRoot(ctx *sql.Context, newRoot *doltdb.RootValue) error
- func (db Database) StartTransaction(ctx *sql.Context, tCharacteristic sql.TransactionCharacteristic) (sql.Transaction, error)
- func (db Database) TableEditSession(ctx *sql.Context) (writer.WriteSession, error)
- type DiffTableFunction
- func (dtf *DiffTableFunction) CheckPrivileges(ctx *sql.Context, opChecker sql.PrivilegedOperationChecker) bool
- func (dtf *DiffTableFunction) Children() []sql.Node
- func (dtf *DiffTableFunction) Database() sql.Database
- func (dtf *DiffTableFunction) Expressions() []sql.Expression
- func (dtf *DiffTableFunction) FunctionName() string
- func (dtf *DiffTableFunction) NewInstance(ctx *sql.Context, database sql.Database, expressions []sql.Expression) (sql.Node, error)
- func (dtf *DiffTableFunction) Resolved() bool
- func (dtf *DiffTableFunction) RowIter(ctx *sql.Context, _ sql.Row) (sql.RowIter, error)
- func (dtf *DiffTableFunction) Schema() sql.Schema
- func (dtf *DiffTableFunction) String() string
- func (dtf *DiffTableFunction) WithChildren(node ...sql.Node) (sql.Node, error)
- func (dtf *DiffTableFunction) WithDatabase(database sql.Database) (sql.Node, error)
- func (dtf *DiffTableFunction) WithExpressions(expression ...sql.Expression) (sql.Node, error)
- type DoltDatabaseProvider
- func (p DoltDatabaseProvider) AllDatabases(ctx *sql.Context) (all []sql.Database)
- func (p DoltDatabaseProvider) CreateDatabase(ctx *sql.Context, name string) error
- func (p DoltDatabaseProvider) Database(ctx *sql.Context, name string) (db sql.Database, err error)
- func (p DoltDatabaseProvider) DropDatabase(ctx *sql.Context, name string) error
- func (p DoltDatabaseProvider) Function(_ *sql.Context, name string) (sql.Function, error)
- func (p DoltDatabaseProvider) HasDatabase(ctx *sql.Context, name string) bool
- func (p DoltDatabaseProvider) RevisionDbState(ctx context.Context, revDB string) (dsess.InitialDbState, error)
- func (p DoltDatabaseProvider) TableFunction(ctx *sql.Context, name string) (sql.TableFunction, error)
- func (p DoltDatabaseProvider) WithDbFactoryUrl(url string) DoltDatabaseProvider
- func (p DoltDatabaseProvider) WithFunctions(fns []sql.Function) DoltDatabaseProvider
- type DoltTable
- func (t DoltTable) AddForeignKey(ctx *sql.Context, fk sql.ForeignKeyConstraint) error
- func (t DoltTable) CreateIndexForForeignKey(ctx *sql.Context, indexName string, using sql.IndexUsing, ...) error
- func (t *DoltTable) DataLength(ctx *sql.Context) (uint64, error)
- func (t DoltTable) DropForeignKey(ctx *sql.Context, fkName string) error
- func (t *DoltTable) Format() *types.NomsBinFormat
- func (t *DoltTable) GetAutoIncrementValue(ctx *sql.Context) (interface{}, error)
- func (t *DoltTable) GetChecks(ctx *sql.Context) ([]sql.CheckDefinition, error)
- func (t *DoltTable) GetDeclaredForeignKeys(ctx *sql.Context) ([]sql.ForeignKeyConstraint, error)
- func (t DoltTable) GetForeignKeyUpdater(ctx *sql.Context) sql.ForeignKeyUpdater
- func (t *DoltTable) GetIndexes(ctx *sql.Context) ([]sql.Index, error)
- func (t *DoltTable) GetReferencedForeignKeys(ctx *sql.Context) ([]sql.ForeignKeyConstraint, error)
- func (t *DoltTable) IsTemporary() bool
- func (t DoltTable) LockedToRoot(rootValue *doltdb.RootValue) *DoltTable
- func (t *DoltTable) Name() string
- func (t *DoltTable) NumRows(ctx *sql.Context) (uint64, error)
- func (t *DoltTable) PartitionRows(ctx *sql.Context, partition sql.Partition) (sql.RowIter, error)
- func (t DoltTable) PartitionRows2(ctx *sql.Context, part sql.Partition) (sql.RowIter2, error)
- func (t *DoltTable) Partitions(ctx *sql.Context) (sql.PartitionIter, error)
- func (t *DoltTable) PrimaryKeySchema() sql.PrimaryKeySchema
- func (t *DoltTable) Projections() []string
- func (t *DoltTable) Schema() sql.Schema
- func (t *DoltTable) String() string
- func (t DoltTable) UpdateForeignKey(ctx *sql.Context, fkName string, fk sql.ForeignKeyConstraint) error
- func (t *DoltTable) WithIndexLookup(lookup sql.IndexLookup) sql.Table
- func (t *DoltTable) WithProjections(colNames []string) sql.Table
- type Extra
- type HistoryNode
- type IndexedDoltTable
- func (idt *IndexedDoltTable) GetIndexes(ctx *sql.Context) ([]sql.Index, error)
- func (idt *IndexedDoltTable) IsTemporary() bool
- func (idt *IndexedDoltTable) Name() string
- func (idt *IndexedDoltTable) PartitionRows(ctx *sql.Context, part sql.Partition) (sql.RowIter, error)
- func (idt *IndexedDoltTable) PartitionRows2(ctx *sql.Context, part sql.Partition) (sql.RowIter, error)
- func (idt *IndexedDoltTable) Partitions(ctx *sql.Context) (sql.PartitionIter, error)
- func (idt *IndexedDoltTable) Schema() sql.Schema
- func (idt *IndexedDoltTable) String() string
- func (idt *IndexedDoltTable) WithIndexLookup(lookup sql.IndexLookup) sql.Table
- type Nullable
- type ReadOnlyDatabase
- type ReadReplicaDatabase
- type SingleTableInfoDatabase
- func (db *SingleTableInfoDatabase) AddForeignKey(ctx *sql.Context, fk sql.ForeignKeyConstraint) error
- func (db *SingleTableInfoDatabase) CreateIndexForForeignKey(ctx *sql.Context, indexName string, using sql.IndexUsing, ...) error
- func (db *SingleTableInfoDatabase) DataLength(ctx *sql.Context) (uint64, error)
- func (db *SingleTableInfoDatabase) DropForeignKey(ctx *sql.Context, fkName string) error
- func (db *SingleTableInfoDatabase) GetChecks(ctx *sql.Context) ([]sql.CheckDefinition, error)
- func (db *SingleTableInfoDatabase) GetDeclaredForeignKeys(ctx *sql.Context) ([]sql.ForeignKeyConstraint, error)
- func (db *SingleTableInfoDatabase) GetForeignKeyUpdater(ctx *sql.Context) sql.ForeignKeyUpdater
- func (db *SingleTableInfoDatabase) GetIndexes(ctx *sql.Context) ([]sql.Index, error)
- func (db *SingleTableInfoDatabase) GetReferencedForeignKeys(ctx *sql.Context) ([]sql.ForeignKeyConstraint, error)
- func (db *SingleTableInfoDatabase) GetTableInsensitive(ctx *sql.Context, tableName string) (sql.Table, bool, error)
- func (db *SingleTableInfoDatabase) GetTableNames(ctx *sql.Context) ([]string, error)
- func (db *SingleTableInfoDatabase) IsTemporary() bool
- func (db *SingleTableInfoDatabase) Name() string
- func (db *SingleTableInfoDatabase) NumRows(context *sql.Context) (uint64, error)
- func (db *SingleTableInfoDatabase) PartitionRows(*sql.Context, sql.Partition) (sql.RowIter, error)
- func (db *SingleTableInfoDatabase) PartitionRows2(ctx *sql.Context, part sql.Partition) (sql.RowIter2, error)
- func (db *SingleTableInfoDatabase) Partitions(*sql.Context) (sql.PartitionIter, error)
- func (db *SingleTableInfoDatabase) PrimaryKeySchema() sql.PrimaryKeySchema
- func (db *SingleTableInfoDatabase) Schema() sql.Schema
- func (db *SingleTableInfoDatabase) String() string
- func (db *SingleTableInfoDatabase) UpdateForeignKey(ctx *sql.Context, fkName string, fk sql.ForeignKeyConstraint) error
- func (db *SingleTableInfoDatabase) WithIndexLookup(sql.IndexLookup) sql.Table
- type SqlDatabase
- type TableUpdate
- type TempTable
- func (t *TempTable) AddForeignKey(ctx *sql.Context, fk sql.ForeignKeyConstraint) error
- func (t *TempTable) Close(ctx *sql.Context) error
- func (t *TempTable) CreateCheck(ctx *sql.Context, check *sql.CheckDefinition) error
- func (t *TempTable) CreateIndex(ctx *sql.Context, indexName string, using sql.IndexUsing, ...) error
- func (t *TempTable) CreateIndexForForeignKey(ctx *sql.Context, indexName string, using sql.IndexUsing, ...) error
- func (t *TempTable) DataLength(ctx *sql.Context) (uint64, error)
- func (t *TempTable) Delete(ctx *sql.Context, sqlRow sql.Row) error
- func (t *TempTable) Deleter(*sql.Context) sql.RowDeleter
- func (t *TempTable) DiscardChanges(ctx *sql.Context, errorEncountered error) error
- func (t *TempTable) DropCheck(ctx *sql.Context, chName string) error
- func (t *TempTable) DropForeignKey(ctx *sql.Context, fkName string) error
- func (t *TempTable) DropIndex(ctx *sql.Context, indexName string) error
- func (t *TempTable) Format() *types.NomsBinFormat
- func (t *TempTable) GetChecks(*sql.Context) ([]sql.CheckDefinition, error)
- func (t *TempTable) GetDeclaredForeignKeys(ctx *sql.Context) ([]sql.ForeignKeyConstraint, error)
- func (t *TempTable) GetForeignKeyUpdater(ctx *sql.Context) sql.ForeignKeyUpdater
- func (t *TempTable) GetIndexes(ctx *sql.Context) ([]sql.Index, error)
- func (t *TempTable) GetReferencedForeignKeys(ctx *sql.Context) ([]sql.ForeignKeyConstraint, error)
- func (t *TempTable) Insert(ctx *sql.Context, sqlRow sql.Row) error
- func (t *TempTable) Inserter(*sql.Context) sql.RowInserter
- func (t *TempTable) IsTemporary() bool
- func (t *TempTable) Name() string
- func (t *TempTable) NumRows(ctx *sql.Context) (uint64, error)
- func (t *TempTable) PartitionRows(ctx *sql.Context, partition sql.Partition) (sql.RowIter, error)
- func (t *TempTable) Partitions(ctx *sql.Context) (sql.PartitionIter, error)
- func (t *TempTable) PrimaryKeySchema() sql.PrimaryKeySchema
- func (t *TempTable) RenameIndex(ctx *sql.Context, fromIndexName string, toIndexName string) error
- func (t *TempTable) Replacer(*sql.Context) sql.RowReplacer
- func (t *TempTable) Schema() sql.Schema
- func (t *TempTable) StatementBegin(ctx *sql.Context)
- func (t *TempTable) StatementComplete(ctx *sql.Context) error
- func (t *TempTable) String() string
- func (t *TempTable) Update(ctx *sql.Context, oldRow sql.Row, newRow sql.Row) error
- func (t *TempTable) UpdateForeignKey(ctx *sql.Context, fkName string, fk sql.ForeignKeyConstraint) error
- func (t *TempTable) Updater(*sql.Context) sql.RowUpdater
- func (t *TempTable) WithIndexLookup(lookup sql.IndexLookup) sql.Table
- type UserSpaceDatabase
- func (db *UserSpaceDatabase) DbData() env.DbData
- func (db *UserSpaceDatabase) EditOptions() editor.Options
- func (db *UserSpaceDatabase) Flush(ctx *sql.Context) error
- func (db *UserSpaceDatabase) GetRoot(*sql.Context) (*doltdb.RootValue, error)
- func (db *UserSpaceDatabase) GetTableInsensitive(ctx *sql.Context, tableName string) (sql.Table, bool, error)
- func (db *UserSpaceDatabase) GetTableNames(ctx *sql.Context) ([]string, error)
- func (db *UserSpaceDatabase) GetTemporaryTablesRoot(*sql.Context) (*doltdb.RootValue, bool)
- func (db *UserSpaceDatabase) Name() string
- func (db *UserSpaceDatabase) StartTransaction(ctx *sql.Context, tCharacteristic sql.TransactionCharacteristic) (sql.Transaction, error)
- type WritableDoltTable
- func (t *WritableDoltTable) AutoIncrementSetter(ctx *sql.Context) sql.AutoIncrementSetter
- func (t *WritableDoltTable) Deleter(ctx *sql.Context) sql.RowDeleter
- func (t *WritableDoltTable) GetNextAutoIncrementValue(ctx *sql.Context, potentialVal interface{}) (uint64, error)
- func (t *WritableDoltTable) Inserter(ctx *sql.Context) sql.RowInserter
- func (t *WritableDoltTable) PeekNextAutoIncrementValue(ctx *sql.Context) (interface{}, error)
- func (t *WritableDoltTable) Replacer(ctx *sql.Context) sql.RowReplacer
- func (t *WritableDoltTable) Truncate(ctx *sql.Context) (int, error)
- func (t *WritableDoltTable) Updater(ctx *sql.Context) sql.RowUpdater
- func (t *WritableDoltTable) WithIndexLookup(lookup sql.IndexLookup) sql.Table
- func (t *WritableDoltTable) WithProjections(colNames []string) sql.Table
- type WritableIndexedDoltTable
- func (t *WritableIndexedDoltTable) PartitionRows(ctx *sql.Context, part sql.Partition) (sql.RowIter, error)
- func (t *WritableIndexedDoltTable) PartitionRows2(ctx *sql.Context, part sql.Partition) (sql.RowIter2, error)
- func (t *WritableIndexedDoltTable) Partitions(ctx *sql.Context) (sql.PartitionIter, error)
- func (t *WritableIndexedDoltTable) Projections() []string
- func (t *WritableIndexedDoltTable) WithProjections(colNames []string) sql.Table
Constants ¶
const ( ADD = "add" AGAINST = "against" ALL = "all" ALTER = "alter" ANALYZE = "analyze" AND = "and" AS = "as" ASC = "asc" AUTO_INCREMENT = "auto_increment" BEGIN = "begin" BETWEEN = "between" BIGINT = "bigint" BINARY = "binary" BIT = "bit" BLOB = "blob" BOOL = "bool" BOOLEAN = "boolean" BY = "by" CASE = "case" CAST = "cast" CHAR = "char" CHARACTER = "character" CHARSET = "charset" COLLATE = "collate" COLUMN = "column" COMMENT = "comment" COMMIT = "commit" COMMITTED = "committed" CONSTRAINT = "constraint" CONVERT = "convert" CREATE = "create" CROSS = "cross" CURRENT_DATE = "current_date" CURRENT_TIME = "current_time" CURRENT_TIMESTAMP = "current_timestamp" DATABASE = "database" DATABASES = "databases" DATE = "date" DATETIME = "datetime" DECIMAL = "decimal" DEFAULT = "default" DELETE = "delete" DESC = "desc" DESCRIBE = "describe" DISTINCT = "distinct" DIV = "div" DOUBLE = "double" DROP = "drop" DUAL = "dual" DUPLICATE = "duplicate" ELSE = "else" END = "end" ENUM = "enum" ESCAPE = "escape" EXISTS = "exists" EXPANSION = "expansion" EXPLAIN = "explain" EXTENDED = "extended" FALSE = "false" FLOAT_TYPE = "float" FOR = "for" FORCE = "force" FOREIGN = "foreign" FROM = "from" FULL = "full" FULLTEXT = "fulltext" GEOMETRY = "geometry" GEOMETRYCOLLECTION = "geometrycollection" GLOBAL = "global" GROUP = "group" GROUP_CONCAT = "group_concat" HAVING = "having" IF = "if" IGNORE = "ignore" IN = "in" INDEX = "index" INNER = "inner" INSERT = "insert" INT = "int" INTEGER = "integer" INTERVAL = "interval" INTO = "into" IS = "is" ISOLATION = "isolation" JOIN = "join" JSON = "json" KEY = "key" KEYS = "keys" KEY_BLOCK_SIZE = "key_block_size" LANGUAGE = "language" LAST_INSERT_ID = "last_insert_id" LEFT = "left" LESS = "less" LEVEL = "level" LIKE = "like" LIMIT = "limit" LINESTRING = "linestring" LOCALTIME = "localtime" LOCALTIMESTAMP = "localtimestamp" LOCK = "lock" LONGBLOB = "longblob" LONGTEXT = "longtext" MATCH = "match" MAXVALUE = "maxvalue" MEDIUMBLOB = "mediumblob" MEDIUMINT = "mediumint" MEDIUMTEXT = "mediumtext" MOD = "mod" MODE = "mode" MULTILINESTRING = "multilinestring" MULTIPOINT = "multipoint" MULTIPOLYGON = "multipolygon" NAMES = "names" NATURAL = "natural" NCHAR = "nchar" NEXT = "next" NOT = "not" NULL = "null" NUMERIC = "numeric" OFFSET = "offset" ON = "on" ONLY = "only" OPTIMIZE = "optimize" OR = "or" ORDER = "order" OUTER = "outer" PARTITION = "partition" POINT = "point" POLYGON = "polygon" PRIMARY = "primary" PROCEDURE = "procedure" PROCESSLIST = "processlist" QUERY = "query" READ = "read" REAL = "real" REGEXP = "regexp" RLIKE = "rlike" RENAME = "rename" REORGANIZE = "reorganize" REPAIR = "repair" REPEATABLE = "repeatable" REPLACE = "replace" RIGHT = "right" ROLLBACK = "rollback" SCHEMA = "schema" SELECT = "select" SEPARATOR = "separator" SERIALIZABLE = "serializable" SESSION = "session" SET = "set" SHARE = "share" SHOW = "show" SIGNED = "signed" SMALLINT = "smallint" SPATIAL = "spatial" SQL_CACHE = "sql_cache" SQL_NO_CACHE = "sql_no_cache" START = "start" STATUS = "status" STRAIGHT_JOIN = "straight_join" STREAM = "stream" SUBSTR = "substr" SUBSTRING = "substring" TABLE = "table" TABLES = "tables" TEXT = "text" THAN = "than" THEN = "then" TIME = "time" TIMESTAMP = "timestamp" TINYBLOB = "tinyblob" TINYINT = "tinyint" TINYTEXT = "tinytext" TO = "to" TRANSACTION = "transaction" TRIGGER = "trigger" TRUE = "true" TRUNCATE = "truncate" UNCOMMITTED = "uncommitted" UNDERSCORE_BINARY = "_binary" UNION = "union" UNIQUE = "unique" UNSIGNED = "unsigned" UPDATE = "update" USE = "use" USING = "using" UTC_DATE = "utc_date" UTC_TIME = "utc_time" UTC_TIMESTAMP = "utc_timestamp" UUID = "uuid" VALUES = "values" VARBINARY = "varbinary" VARCHAR = "varchar" VARIABLES = "variables" VIEW = "view" WHEN = "when" WHERE = "where" WITH = "with" WRITE = "write" YEAR = "year" ZEROFILL = "zerofill" )
SQL keyword constants for use in switches and comparisons
const ( // ProceduresTableName is the name of the dolt stored procedures table. ProceduresTableName = "dolt_procedures" // ProceduresTableNameCol is the name of the stored procedure. Using CREATE PROCEDURE, will always be lowercase. ProceduresTableNameCol = "name" // ProceduresTableCreateStmtCol is the CREATE PROCEDURE statement for this stored procedure. ProceduresTableCreateStmtCol = "create_stmt" // ProceduresTableCreatedAtCol is the time that the stored procedure was created at, in UTC. ProceduresTableCreatedAtCol = "created_at" // ProceduresTableModifiedAtCol is the time that the stored procedure was last modified, in UTC. ProceduresTableModifiedAtCol = "modified_at" )
const ( ReplicateToRemoteKey = "dolt_replicate_to_remote" ReadReplicaRemoteKey = "dolt_read_replica_remote" SkipReplicationErrorsKey = "dolt_skip_replication_errors" ReplicateHeadsKey = "dolt_replicate_heads" ReplicateAllHeadsKey = "dolt_replicate_all_heads" AsyncReplicationKey = "dolt_async_replication" )
const ( SysVarFalse = int8(0) SysVarTrue = int8(1) )
const ( IdTag = iota + 200 FirstNameTag LastNameTag IsMarriedTag AgeTag RatingTag UuidTag NumEpisodesTag )
const ( EpisodeIdTag = iota + 300 EpNameTag EpAirDateTag EpRatingTag )
const ( AppCharacterTag = iota + 400 AppEpTag AppCommentsTag )
const ( HomerId = iota MargeId BartId LisaId MoeId BarneyId )
const NoUpperBound = 0xffffffffffffffff
const TableWithHistoryName = "test_table"
Variables ¶
var AddAddrAt3HistSch = dtestutils.MustSchema(idColTag0TypeUUID, firstColTag1TypeStr, lastColTag2TypeStr, addrColTag3TypeStr)
var AddAgeAt4HistSch = dtestutils.MustSchema(idColTag0TypeUUID, firstColTag1TypeStr, lastColTag2TypeStr, ageColTag4TypeInt)
var AllAppsRows = Rs(app1, app2, app3, app4, app5, app6, app7, app8, app9, app10)
nobody in episode 4, that one was terrible Unlike the other tables, you can't count on the order of these rows matching the insertion order.
var AllKeywords = []string{}/* 201 elements not displayed */
All SQL keywords that we treat as reserved words
var AppearancesTableName = "appearances"
var AppearancesTestSchema = createAppearancesTestSchema()
var Barney = NewPeopleRowWithOptionalFields(BarneyId, "Barney", "Gumble", false, 40, 4, uuid.MustParse("00000000-0000-0000-0000-000000000005"), 555)
var Bart = NewPeopleRowWithOptionalFields(BartId, "Bart", "Simpson", false, 10, 9, uuid.MustParse("00000000-0000-0000-0000-000000000002"), 222)
var CommonKeywords = []string{ ADD, ALTER, AND, AS, ASC, BIGINT, BINARY, BIT, BLOB, BOOL, BOOLEAN, BY, CHAR, CHARACTER, COLUMN, COMMENT, CREATE, DECIMAL, DEFAULT, DELETE, DESC, DESCRIBE, DISTINCT, DOUBLE, DROP, EXISTS, FALSE, FLOAT_TYPE, FROM, FULL, IGNORE, IN, INSERT, INT, INTEGER, INTO, IS, JOIN, KEY, KEYS, LIMIT, LONGBLOB, LONGTEXT, MEDIUMBLOB, MEDIUMINT, MEDIUMTEXT, NOT, NULL, NUMERIC, OFFSET, ON, OR, ORDER, PRIMARY, RENAME, SCHEMA, SELECT, SET, SHOW, SIGNED, SMALLINT, TABLE, TABLES, TEXT, TINYINT, TINYTEXT, TRUE, UNSIGNED, UPDATE, UUID, VALUES, VARCHAR, WHERE, }
Well-supported keywords that are likely to be useful in e.g. autocompletion
var DiffSchema = dtestutils.MustSchema( schema.NewColumn("to_id", 0, types.IntKind, false), schema.NewColumn("to_first_name", 1, types.StringKind, false), schema.NewColumn("to_last_name", 2, types.StringKind, false), schema.NewColumn("to_addr", 3, types.StringKind, false), schema.NewColumn("from_id", 7, types.IntKind, false), schema.NewColumn("from_first_name", 8, types.StringKind, false), schema.NewColumn("from_last_name", 9, types.StringKind, false), schema.NewColumn("from_addr", 10, types.StringKind, false), schema.NewColumn("diff_type", 14, types.StringKind, false), )
var EmptyReadReplica = ReadReplicaDatabase{}
var Ep1 = newEpsRow2(1, "Simpsons Roasting On an Open Fire", "1989-12-18 03:00:00", 8.0)
Actually the first 4 episodes of the show
var Ep2 = newEpsRow2(2, "Bart the Genius", "1990-01-15 03:00:00", 9.0)
var Ep3 = newEpsRow2(3, "Homer's Odyssey", "1990-01-22 03:00:00", 7.0)
var Ep4 = newEpsRow2(4, "There's No Disgrace Like Home", "1990-01-29 03:00:00", 8.5)
var EpisodesTableName = "episodes"
var EpisodesTestSchema = createEpisodesTestSchema()
var ErrCannotCreateReplicaRevisionDbForCommit = errors.New("cannot create replica revision db for commit")
var ErrFailedToCastToReplicaDb = errors.New("failed to cast to ReadReplicaDatabase")
var ErrFailedToLoadReplicaDB = errors.New("failed to load replica database")
var ErrInvalidNonLiteralArgument = errors.NewKind("Invalid argument to %s: %s – only literal values supported")
var ErrInvalidReplicateHeadsSetting = errors.New("invalid replicate heads setting")
var ErrInvalidTableName = errors.NewKind("Invalid table name %s. Table names must match the regular expression " + doltdb.TableNameRegexStr)
var ErrKeylessAltTbl = errors.New("schema alterations not supported for keyless tables")
var ErrPrimaryKeySetsIncompatible = errors.New("primary key sets incompatible")
var ErrReservedTableName = errors.NewKind("Invalid table name %s. Table names beginning with `dolt_` are reserved for internal use")
var ErrSystemTableAlter = errors.NewKind("Cannot alter table %s: system tables cannot be dropped or altered")
var Homer = NewPeopleRow(HomerId, "Homer", "Simpson", true, 40, 8.5)
6 characters
var InitialHistSch = dtestutils.MustSchema(idColTag0TypeUUID, firstColTag1TypeStr, lastColTag2TypeStr)
var Lisa = NewPeopleRowWithOptionalFields(LisaId, "Lisa", "Simpson", false, 8, 10, uuid.MustParse("00000000-0000-0000-0000-000000000003"), 333)
var Marge = NewPeopleRowWithOptionalFields(MargeId, "Marge", "Simpson", true, 38, 8, uuid.MustParse("00000000-0000-0000-0000-000000000001"), 111)
var MaxRowsPerPartition uint64 = 32 * 1024
var MinRowsPerPartition uint64 = 1024
var Moe = NewPeopleRowWithOptionalFields(MoeId, "Moe", "Szyslak", false, 48, 6.5, uuid.MustParse("00000000-0000-0000-0000-000000000004"), 444)
var PeopleTableName = "people"
var PeopleTestSchema = createPeopleTestSchema()
var ReaddAgeAt5HistSch = dtestutils.MustSchema(idColTag0TypeUUID, firstColTag1TypeStr, lastColTag2TypeStr, addrColTag3TypeStr, ageColTag5TypeUint)
Functions ¶
func AddDoltSystemVariables ¶
func AddDoltSystemVariables()
func CompressRow ¶
Rewrites the tag numbers for the row given to begin at zero and be contiguous, just like result set schemas. We don't want to just use the field mappings in the result set schema used by sqlselect, since that would only demonstrate that the code was consistent with itself, not actually correct.
func CompressRows ¶
Compresses each of the rows given ala compressRow
func CompressSchema ¶
Rewrites the tag numbers for the schema given to start at 0, just like result set schemas. If one or more column names are given, only those column names are included in the compressed schema. The column list can also be used to reorder the columns as necessary.
func CompressSchemas ¶
Rewrites the tag numbers for the schemas given to start at 0, just like result set schemas.
func CreateEmptyTestDatabase ¶
Creates a test database without any data in it
func CreateTestDatabase ¶
Creates a test database with the test data set in it
func DatetimeStrToTimestamp ¶
func DoltProceduresAddProcedure ¶
func DoltProceduresAddProcedure(ctx *sql.Context, db Database, spd sql.StoredProcedureDetails) (retErr error)
DoltProceduresAddProcedure adds the stored procedure to the `dolt_procedures` table in the given db, creating it if it does not exist.
func DoltProceduresDropProcedure ¶
DoltProceduresDropProcedure removes the stored procedure from the `dolt_procedures` table. The procedure named must exist.
func DoltProceduresGetAll ¶
func DoltProceduresGetDetails ¶
func DoltProceduresGetDetails(ctx *sql.Context, tbl *WritableDoltTable, name string) (sql.StoredProcedureDetails, bool, error)
DoltProceduresGetDetails returns the stored procedure with the given name from `dolt_procedures` if it exists.
func DoltSchemaFromAlterableTable ¶
func DoltSchemaFromAlterableTable(t *AlterableDoltTable) schema.Schema
DoltSchemaFromAlterableTable is a utility for integration tests
func DoltTableFromAlterableTable ¶
func DoltTableFromAlterableTable(ctx *sql.Context, t *AlterableDoltTable) *doltdb.Table
DoltTableFromAlterableTable is a utility for integration tests
func ExecuteSelect ¶
func ExecuteSelect(t *testing.T, dEnv *env.DoltEnv, ddb *doltdb.DoltDB, root *doltdb.RootValue, query string) ([]sql.Row, error)
ExecuteSelect executes the select statement given and returns the resulting rows, or an error if one is encountered.
func ExecuteSql ¶
func ExecuteSql(t *testing.T, dEnv *env.DoltEnv, root *doltdb.RootValue, statements string) (*doltdb.RootValue, error)
ExecuteSql executes all the SQL non-select statements given in the string against the root value given and returns the updated root, or an error. Statements in the input string are split by `;\n`
func FindRowIndex ¶
Returns the index of the first row in the list that has the same primary key as the one given, or -1 otherwise.
func GetCommitHooks ¶
func GetCommitHooks(ctx context.Context, bThreads *sql.BackgroundThreads, dEnv *env.DoltEnv, logger io.Writer) ([]doltdb.CommitHook, error)
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.
func GetCreateTableStmt ¶
func GetInitialDBState ¶
func GetInitialDBState(ctx context.Context, db SqlDatabase) (dsess.InitialDbState, error)
GetInitialDBState returns the InitialDbState for |db|.
func InitializeWithHistory ¶
func InitializeWithHistory(t *testing.T, ctx context.Context, dEnv *env.DoltEnv, historyNodes ...HistoryNode)
InitializeWithHistory will go through the provided historyNodes and create the intended commit graph
func MutateRow ¶
Mutates the row given with pairs of {tag,value} given in the varargs param. Converts built-in types to noms types.
func NewPeopleRow ¶
func NewPeopleRowWithOptionalFields ¶
func NewPeopleRowWithOptionalFields(id int, first, last string, isMarried bool, age int, rating float64, uid uuid.UUID, numEpisodes uint64) row.Row
Most rows don't have these optional fields set, as they aren't needed for basic testing
func NewTestEngine ¶
func NewTestEngine(t *testing.T, dEnv *env.DoltEnv, ctx context.Context, db Database, root *doltdb.RootValue) (*sqle.Engine, *sql.Context, error)
NewTestEngine creates a new default engine, and a *sql.Context and initializes indexes and schema fragments.
func NewTestSQLCtx ¶
NewTestSQLCtx returns a new *sql.Context with a default DoltSession, a new IndexRegistry, and a new ViewRegistry
func PrepareCreateTableStmt ¶
func ProceduresTableSchema ¶
The fixed dolt schema for the `dolt_procedures` table.
func ProceduresTableSqlSchema ¶
func ProceduresTableSqlSchema() sql.PrimaryKeySchema
The fixed SQL schema for the `dolt_procedures` table.
func SchemasTableSchema ¶
The fixed dolt schema for the `dolt_schemas` table.
func SkipReplicationWarnings ¶
func SkipReplicationWarnings() bool
func SubsetSchema ¶
SubsetSchema returns a schema that is a subset of the schema given, with keys and constraints removed. Column names must be verified before subsetting. Unrecognized column names will cause a panic.
func TableToRowIter ¶
func TableToRowIter(ctx *sql.Context, table *WritableDoltTable, columns []string) (sql.RowIter, error)
TableToRowIter returns a |sql.RowIter| for a full table scan for the given |table|. If |columns| is not empty, only columns with names appearing in |columns| will have non-|nil| values in the resulting |sql.Row|s. If |columns| is empty, values for all columns in the table are populated in each returned Row. The returned rows always have the schema of the table, regardless of the value of |columns|. Providing a column name which does not appear in the schema is not an error, but no corresponding column will appear in the results.
Types ¶
type AlterableDoltTable ¶
type AlterableDoltTable struct {
WritableDoltTable
}
AlterableDoltTable allows altering the schema of the table. It implements sql.AlterableTable.
func (*AlterableDoltTable) AddColumn ¶
func (t *AlterableDoltTable) AddColumn(ctx *sql.Context, column *sql.Column, order *sql.ColumnOrder) error
AddColumn implements sql.AlterableTable
func (*AlterableDoltTable) AddForeignKey ¶
func (t *AlterableDoltTable) AddForeignKey(ctx *sql.Context, sqlFk sql.ForeignKeyConstraint) error
AddForeignKey implements sql.ForeignKeyTable
func (*AlterableDoltTable) CreateCheck ¶
func (t *AlterableDoltTable) CreateCheck(ctx *sql.Context, check *sql.CheckDefinition) error
func (*AlterableDoltTable) CreateIndex ¶
func (t *AlterableDoltTable) CreateIndex( ctx *sql.Context, indexName string, using sql.IndexUsing, constraint sql.IndexConstraint, indexColumns []sql.IndexColumn, comment string, ) error
CreateIndex implements sql.IndexAlterableTable
func (*AlterableDoltTable) CreateIndexForForeignKey ¶
func (t *AlterableDoltTable) CreateIndexForForeignKey(ctx *sql.Context, indexName string, using sql.IndexUsing, constraint sql.IndexConstraint, indexColumns []sql.IndexColumn) error
CreateIndexForForeignKey implements sql.ForeignKeyTable
func (*AlterableDoltTable) CreatePrimaryKey ¶
func (t *AlterableDoltTable) CreatePrimaryKey(ctx *sql.Context, columns []sql.IndexColumn) error
func (*AlterableDoltTable) DropCheck ¶
func (t *AlterableDoltTable) DropCheck(ctx *sql.Context, chName string) error
func (*AlterableDoltTable) DropColumn ¶
func (t *AlterableDoltTable) DropColumn(ctx *sql.Context, columnName string) error
DropColumn implements sql.AlterableTable
func (*AlterableDoltTable) DropForeignKey ¶
func (t *AlterableDoltTable) DropForeignKey(ctx *sql.Context, fkName string) error
DropForeignKey implements sql.ForeignKeyTable
func (*AlterableDoltTable) DropIndex ¶
func (t *AlterableDoltTable) DropIndex(ctx *sql.Context, indexName string) error
DropIndex implements sql.IndexAlterableTable
func (*AlterableDoltTable) DropPrimaryKey ¶
func (t *AlterableDoltTable) DropPrimaryKey(ctx *sql.Context) error
func (*AlterableDoltTable) GetForeignKeyUpdater ¶
func (t *AlterableDoltTable) GetForeignKeyUpdater(ctx *sql.Context) sql.ForeignKeyUpdater
GetForeignKeyUpdater implements sql.ForeignKeyTable
func (*AlterableDoltTable) ModifyColumn ¶
func (t *AlterableDoltTable) ModifyColumn(ctx *sql.Context, columnName string, column *sql.Column, order *sql.ColumnOrder) error
ModifyColumn implements sql.AlterableTable
func (*AlterableDoltTable) PrimaryKeySchema ¶
func (t *AlterableDoltTable) PrimaryKeySchema() sql.PrimaryKeySchema
func (*AlterableDoltTable) RenameIndex ¶
func (t *AlterableDoltTable) RenameIndex(ctx *sql.Context, fromIndexName string, toIndexName string) error
RenameIndex implements sql.IndexAlterableTable
func (*AlterableDoltTable) RewriteInserter ¶
func (t *AlterableDoltTable) RewriteInserter(ctx *sql.Context, newSchema sql.PrimaryKeySchema) (sql.RowInserter, error)
func (*AlterableDoltTable) ShouldRewriteTable ¶
func (t *AlterableDoltTable) ShouldRewriteTable( ctx *sql.Context, oldSchema sql.PrimaryKeySchema, newSchema sql.PrimaryKeySchema, modifiedColumn *sql.Column, ) bool
func (*AlterableDoltTable) UpdateForeignKey ¶
func (t *AlterableDoltTable) UpdateForeignKey(ctx *sql.Context, fkName string, sqlFk sql.ForeignKeyConstraint) error
UpdateForeignKey implements sql.ForeignKeyTable
func (*AlterableDoltTable) WithProjections ¶
func (t *AlterableDoltTable) WithProjections(colNames []string) sql.Table
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database implements sql.Database for a dolt DB.
func NewDatabase ¶
NewDatabase returns a new dolt database to use in queries.
func (Database) CommitTransaction ¶
func (Database) CreateSavepoint ¶
func (Database) CreateTable ¶
CreateTable creates a table with the name and schema given.
func (Database) CreateTemporaryTable ¶
func (db Database) CreateTemporaryTable(ctx *sql.Context, tableName string, pkSch sql.PrimaryKeySchema) error
CreateTemporaryTable creates a table that only exists the length of a session.
func (Database) CreateTrigger ¶
CreateTrigger implements sql.TriggerDatabase.
func (Database) CreateView ¶
CreateView implements sql.ViewCreator. Persists the view in the dolt database, so it can exist in a sql session later. Returns sql.ErrExistingView if a view with that name already exists.
func (Database) DropStoredProcedure ¶
DropStoredProcedure implements sql.StoredProcedureDatabase.
func (Database) DropTable ¶
DropTable drops the table with the name given. The planner returns the correct case sensitive name in tableName
func (Database) DropTrigger ¶
DropTrigger implements sql.TriggerDatabase.
func (Database) DropView ¶
DropView implements sql.ViewDropper. Removes a view from persistence in the dolt database. Returns sql.ErrNonExistingView if the view did not exist.
func (Database) EditOptions ¶
func (Database) Flush ¶
Flush flushes the current batch of outstanding changes and returns any errors.
func (Database) GetAllTableNames ¶
GetAllTableNames returns all user-space tables, including system tables in user space (e.g. dolt_docs, dolt_query_catalog).
func (Database) GetAllTemporaryTables ¶
GetAllTemporaryTables returns all temporary tables
func (Database) GetDocsReadWriter ¶
func (db Database) GetDocsReadWriter() env.DocsReadWriter
func (Database) GetExternalStoredProcedures ¶
func (db Database) GetExternalStoredProcedures(ctx *sql.Context) ([]sql.ExternalStoredProcedureDetails, error)
GetExternalStoredProcedures implements sql.ExternalStoredProcedureDatabase.
func (Database) GetGlobalState ¶
func (db Database) GetGlobalState() globalstate.GlobalState
func (Database) GetHeadRoot ¶
GetHeadRoot returns root value for the current session head
func (Database) GetStateReader ¶
func (db Database) GetStateReader() env.RepoStateReader
GetStateReader gets the RepoStateReader for a Database
func (Database) GetStateWriter ¶
func (db Database) GetStateWriter() env.RepoStateWriter
GetStateWriter gets the RepoStateWriter for a Database
func (Database) GetStoredProcedures ¶
GetStoredProcedures implements sql.StoredProcedureDatabase.
func (Database) GetTableInsensitive ¶
GetTableInsensitive is used when resolving tables in queries. It returns a best-effort case-insensitive match for the table name given.
func (Database) GetTableInsensitiveAsOf ¶
func (db Database) GetTableInsensitiveAsOf(ctx *sql.Context, tableName string, asOf interface{}) (sql.Table, bool, error)
GetTableInsensitiveAsOf implements sql.VersionedDatabase
func (Database) GetTableInsensitiveWithRoot ¶
func (Database) GetTableNames ¶
GetTableNames returns the names of all user tables. System tables in user space (e.g. dolt_docs, dolt_query_catalog) are filtered out. This method is used for queries that examine the schema of the database, e.g. show tables. Table name resolution in queries is handled by GetTableInsensitive. Use GetAllTableNames for an unfiltered list of all tables in user space.
func (Database) GetTableNamesAsOf ¶
GetTableNamesAsOf implements sql.VersionedDatabase
func (Database) GetTriggers ¶
GetTriggers implements sql.TriggerDatabase.
func (Database) GetWorkingSet ¶
func (Database) ReleaseSavepoint ¶
func (Database) RenameTable ¶
renameTable implements sql.TableRenamer
func (Database) RollbackToSavepoint ¶
func (Database) SaveStoredProcedure ¶
SaveStoredProcedure implements sql.StoredProcedureDatabase.
func (Database) SetRoot ¶
SetRoot should typically be called on the Session, which is where this state lives. But it's available here as a convenience.
func (Database) StartTransaction ¶
func (db Database) StartTransaction(ctx *sql.Context, tCharacteristic sql.TransactionCharacteristic) (sql.Transaction, error)
func (Database) TableEditSession ¶
TableEditSession returns the TableEditSession for this database from the given context.
type DiffTableFunction ¶
type DiffTableFunction struct {
// contains filtered or unexported fields
}
func (*DiffTableFunction) CheckPrivileges ¶
func (dtf *DiffTableFunction) CheckPrivileges(ctx *sql.Context, opChecker sql.PrivilegedOperationChecker) bool
CheckPrivileges implements the sql.Node interface
func (*DiffTableFunction) Children ¶
func (dtf *DiffTableFunction) Children() []sql.Node
Children implements the sql.Node interface
func (*DiffTableFunction) Database ¶
func (dtf *DiffTableFunction) Database() sql.Database
Database implements the sql.Databaser interface
func (*DiffTableFunction) Expressions ¶
func (dtf *DiffTableFunction) Expressions() []sql.Expression
Expressions implements the sql.Expressioner interface
func (*DiffTableFunction) FunctionName ¶
func (dtf *DiffTableFunction) FunctionName() string
FunctionName implements the sql.TableFunction interface
func (*DiffTableFunction) NewInstance ¶
func (dtf *DiffTableFunction) NewInstance(ctx *sql.Context, database sql.Database, expressions []sql.Expression) (sql.Node, error)
NewInstance implements the TableFunction interface
func (*DiffTableFunction) Resolved ¶
func (dtf *DiffTableFunction) Resolved() bool
Resolved implements the sql.Resolvable interface
func (*DiffTableFunction) Schema ¶
func (dtf *DiffTableFunction) Schema() sql.Schema
Schema implements the sql.Node interface
func (*DiffTableFunction) String ¶
func (dtf *DiffTableFunction) String() string
String implements the Stringer interface
func (*DiffTableFunction) WithChildren ¶
WithChildren implements the sql.Node interface
func (*DiffTableFunction) WithDatabase ¶
WithDatabase implements the sql.Databaser interface
func (*DiffTableFunction) WithExpressions ¶
func (dtf *DiffTableFunction) WithExpressions(expression ...sql.Expression) (sql.Node, error)
WithExpressions implements the sql.Expressioner interface
type DoltDatabaseProvider ¶
type DoltDatabaseProvider struct {
// contains filtered or unexported fields
}
func NewDoltDatabaseProvider ¶
func NewDoltDatabaseProvider(defaultBranch string, fs filesys.Filesys, databases ...sql.Database) DoltDatabaseProvider
NewDoltDatabaseProvider returns a provider for the databases given
func (DoltDatabaseProvider) AllDatabases ¶
func (p DoltDatabaseProvider) AllDatabases(ctx *sql.Context) (all []sql.Database)
func (DoltDatabaseProvider) CreateDatabase ¶
func (p DoltDatabaseProvider) CreateDatabase(ctx *sql.Context, name string) error
func (DoltDatabaseProvider) DropDatabase ¶
func (p DoltDatabaseProvider) DropDatabase(ctx *sql.Context, name string) error
func (DoltDatabaseProvider) HasDatabase ¶
func (p DoltDatabaseProvider) HasDatabase(ctx *sql.Context, name string) bool
func (DoltDatabaseProvider) RevisionDbState ¶
func (p DoltDatabaseProvider) RevisionDbState(ctx context.Context, revDB string) (dsess.InitialDbState, error)
func (DoltDatabaseProvider) TableFunction ¶
func (p DoltDatabaseProvider) TableFunction(ctx *sql.Context, name string) (sql.TableFunction, error)
TableFunction implements the TableFunctionProvider interface
func (DoltDatabaseProvider) WithDbFactoryUrl ¶
func (p DoltDatabaseProvider) WithDbFactoryUrl(url string) DoltDatabaseProvider
WithDbFactoryUrl returns a copy of this provider with the DbFactoryUrl set as provided. The URL is used when creating new databases. See doltdb.InMemDoltDB, doltdb.LocalDirDoltDB
func (DoltDatabaseProvider) WithFunctions ¶
func (p DoltDatabaseProvider) WithFunctions(fns []sql.Function) DoltDatabaseProvider
WithFunctions returns a copy of this provider with the functions given. Any previous functions are removed.
type DoltTable ¶
type DoltTable struct {
// contains filtered or unexported fields
}
DoltTable implements the sql.Table interface and gives access to dolt table rows and schema.
func NewDoltTable ¶
func (DoltTable) AddForeignKey ¶
AddForeignKey implements sql.ForeignKeyTable
func (DoltTable) CreateIndexForForeignKey ¶
func (t DoltTable) CreateIndexForForeignKey(ctx *sql.Context, indexName string, using sql.IndexUsing, constraint sql.IndexConstraint, columns []sql.IndexColumn) error
CreateIndexForForeignKey implements sql.ForeignKeyTable
func (DoltTable) DropForeignKey ¶
DropForeignKey implements sql.ForeignKeyTable
func (*DoltTable) Format ¶
func (t *DoltTable) Format() *types.NomsBinFormat
Format returns the NomsBinFormat for the underlying table
func (*DoltTable) GetAutoIncrementValue ¶
GetAutoIncrementValue gets the last AUTO_INCREMENT value
func (*DoltTable) GetDeclaredForeignKeys ¶
GetDeclaredForeignKeys implements sql.ForeignKeyTable
func (DoltTable) GetForeignKeyUpdater ¶
func (t DoltTable) GetForeignKeyUpdater(ctx *sql.Context) sql.ForeignKeyUpdater
GetForeignKeyUpdater implements sql.ForeignKeyTable
func (*DoltTable) GetIndexes ¶
GetIndexes implements sql.IndexedTable
func (*DoltTable) GetReferencedForeignKeys ¶
GetReferencedForeignKeys implements sql.ForeignKeyTable
func (*DoltTable) IsTemporary ¶
func (DoltTable) LockedToRoot ¶
LockedToRoot returns a version of this table with its root value locked to the given value. The table's values will not change as the session's root value changes. Appropriate for AS OF queries, or other use cases where the table's values should not change throughout execution of a session.
func (*DoltTable) PartitionRows ¶
PartitionRows returns the table rows for the partition given
func (DoltTable) PartitionRows2 ¶
func (*DoltTable) Partitions ¶
Partitions returns the partitions for this table.
func (*DoltTable) PrimaryKeySchema ¶
func (t *DoltTable) PrimaryKeySchema() sql.PrimaryKeySchema
func (*DoltTable) Projections ¶
Projections implements sql.ProjectedTable
func (*DoltTable) String ¶
String returns a human-readable string to display the name of this SQL node.
func (DoltTable) UpdateForeignKey ¶
func (t DoltTable) UpdateForeignKey(ctx *sql.Context, fkName string, fk sql.ForeignKeyConstraint) error
UpdateForeignKey implements sql.ForeignKeyTable
func (*DoltTable) WithIndexLookup ¶
func (t *DoltTable) WithIndexLookup(lookup sql.IndexLookup) sql.Table
WithIndexLookup implements sql.IndexedTable
type HistoryNode ¶
type HistoryNode struct { // Branch the branch that the commit should be on Branch string // CommitMessag is the commit message that should be applied CommitMsg string // Updates are the changes that should be made to the table's states before committing Updates map[string]TableUpdate // Children are the child commits of this commit Children []HistoryNode }
HistoryNode represents a commit to be made
func CreateHistory ¶
type IndexedDoltTable ¶
type IndexedDoltTable struct {
// contains filtered or unexported fields
}
IndexedDoltTable is a wrapper for a DoltTable and a doltIndexLookup. It implements the sql.Table interface like DoltTable, but its RowIter function returns values that match the indexLookup, instead of all rows. It's returned by the DoltTable WithIndexLookup function.
func (*IndexedDoltTable) GetIndexes ¶
func (*IndexedDoltTable) IsTemporary ¶
func (idt *IndexedDoltTable) IsTemporary() bool
func (*IndexedDoltTable) Name ¶
func (idt *IndexedDoltTable) Name() string
func (*IndexedDoltTable) PartitionRows ¶
func (*IndexedDoltTable) PartitionRows2 ¶
func (*IndexedDoltTable) Partitions ¶
func (idt *IndexedDoltTable) Partitions(ctx *sql.Context) (sql.PartitionIter, error)
func (*IndexedDoltTable) Schema ¶
func (idt *IndexedDoltTable) Schema() sql.Schema
func (*IndexedDoltTable) String ¶
func (idt *IndexedDoltTable) String() string
func (*IndexedDoltTable) WithIndexLookup ¶
func (idt *IndexedDoltTable) WithIndexLookup(lookup sql.IndexLookup) sql.Table
type ReadOnlyDatabase ¶
type ReadOnlyDatabase struct {
Database
}
func (ReadOnlyDatabase) IsReadOnly ¶
func (r ReadOnlyDatabase) IsReadOnly() bool
type ReadReplicaDatabase ¶
type ReadReplicaDatabase struct { Database // contains filtered or unexported fields }
func NewReadReplicaDatabase ¶
func (ReadReplicaDatabase) PullFromRemote ¶
func (rrd ReadReplicaDatabase) PullFromRemote(ctx context.Context) error
func (ReadReplicaDatabase) SetHeadRef ¶
func (rrd ReadReplicaDatabase) SetHeadRef(head ref.DoltRef) (ReadReplicaDatabase, error)
func (ReadReplicaDatabase) StartTransaction ¶
func (rrd ReadReplicaDatabase) StartTransaction(ctx *sql.Context, tCharacteristic sql.TransactionCharacteristic) (sql.Transaction, error)
type SingleTableInfoDatabase ¶
type SingleTableInfoDatabase struct {
// contains filtered or unexported fields
}
SingleTableInfoDatabase is intended to allow a sole schema to make use of any display functionality in `go-mysql-server`. For example, you may have constructed a schema that you want a CREATE TABLE statement for, but the schema is not persisted or is temporary. This allows `go-mysql-server` to interact with that sole schema as though it were a database. No write operations will work with this database.
func NewSingleTableDatabase ¶
func NewSingleTableDatabase(tableName string, sch schema.Schema, foreignKeys []doltdb.ForeignKey, parentSchs map[string]schema.Schema) *SingleTableInfoDatabase
func (*SingleTableInfoDatabase) AddForeignKey ¶
func (db *SingleTableInfoDatabase) AddForeignKey(ctx *sql.Context, fk sql.ForeignKeyConstraint) error
AddForeignKey implements sql.ForeignKeyTable.
func (*SingleTableInfoDatabase) CreateIndexForForeignKey ¶
func (db *SingleTableInfoDatabase) CreateIndexForForeignKey(ctx *sql.Context, indexName string, using sql.IndexUsing, constraint sql.IndexConstraint, columns []sql.IndexColumn) error
CreateIndexForForeignKey implements sql.ForeignKeyTable.
func (*SingleTableInfoDatabase) DataLength ¶
func (db *SingleTableInfoDatabase) DataLength(ctx *sql.Context) (uint64, error)
func (*SingleTableInfoDatabase) DropForeignKey ¶
func (db *SingleTableInfoDatabase) DropForeignKey(ctx *sql.Context, fkName string) error
DropForeignKey implements sql.ForeignKeyTable.
func (*SingleTableInfoDatabase) GetChecks ¶
func (db *SingleTableInfoDatabase) GetChecks(ctx *sql.Context) ([]sql.CheckDefinition, error)
func (*SingleTableInfoDatabase) GetDeclaredForeignKeys ¶
func (db *SingleTableInfoDatabase) GetDeclaredForeignKeys(ctx *sql.Context) ([]sql.ForeignKeyConstraint, error)
GetDeclaredForeignKeys implements sql.ForeignKeyTable.
func (*SingleTableInfoDatabase) GetForeignKeyUpdater ¶
func (db *SingleTableInfoDatabase) GetForeignKeyUpdater(ctx *sql.Context) sql.ForeignKeyUpdater
GetForeignKeyUpdater implements sql.ForeignKeyTable.
func (*SingleTableInfoDatabase) GetIndexes ¶
GetIndexes implements sql.IndexedTable.
func (*SingleTableInfoDatabase) GetReferencedForeignKeys ¶
func (db *SingleTableInfoDatabase) GetReferencedForeignKeys(ctx *sql.Context) ([]sql.ForeignKeyConstraint, error)
GetReferencedForeignKeys implements sql.ForeignKeyTable.
func (*SingleTableInfoDatabase) GetTableInsensitive ¶
func (db *SingleTableInfoDatabase) GetTableInsensitive(ctx *sql.Context, tableName string) (sql.Table, bool, error)
GetTableInsensitive implements sql.Database.
func (*SingleTableInfoDatabase) GetTableNames ¶
func (db *SingleTableInfoDatabase) GetTableNames(ctx *sql.Context) ([]string, error)
GetTableNames implements sql.Database.
func (*SingleTableInfoDatabase) IsTemporary ¶
func (db *SingleTableInfoDatabase) IsTemporary() bool
func (*SingleTableInfoDatabase) Name ¶
func (db *SingleTableInfoDatabase) Name() string
Name implements sql.Table and sql.Database.
func (*SingleTableInfoDatabase) NumRows ¶
func (db *SingleTableInfoDatabase) NumRows(context *sql.Context) (uint64, error)
func (*SingleTableInfoDatabase) PartitionRows ¶
PartitionRows implements sql.Table.
func (*SingleTableInfoDatabase) PartitionRows2 ¶
func (*SingleTableInfoDatabase) Partitions ¶
func (db *SingleTableInfoDatabase) Partitions(*sql.Context) (sql.PartitionIter, error)
Partitions implements sql.Table.
func (*SingleTableInfoDatabase) PrimaryKeySchema ¶
func (db *SingleTableInfoDatabase) PrimaryKeySchema() sql.PrimaryKeySchema
func (*SingleTableInfoDatabase) Schema ¶
func (db *SingleTableInfoDatabase) Schema() sql.Schema
Schema implements sql.Table.
func (*SingleTableInfoDatabase) String ¶
func (db *SingleTableInfoDatabase) String() string
String implements sql.Table.
func (*SingleTableInfoDatabase) UpdateForeignKey ¶
func (db *SingleTableInfoDatabase) UpdateForeignKey(ctx *sql.Context, fkName string, fk sql.ForeignKeyConstraint) error
UpdateForeignKey implements sql.ForeignKeyTable.
func (*SingleTableInfoDatabase) WithIndexLookup ¶
func (db *SingleTableInfoDatabase) WithIndexLookup(sql.IndexLookup) sql.Table
WithIndexLookup implements sql.IndexedTable.
type SqlDatabase ¶
type SqlDatabase interface { sql.Database GetRoot(*sql.Context) (*doltdb.RootValue, error) DbData() env.DbData Name() string StartTransaction(ctx *sql.Context, tCharacteristic sql.TransactionCharacteristic) (sql.Transaction, error) Flush(*sql.Context) error EditOptions() editor.Options }
func ApplyReplicationConfig ¶
func ApplyReplicationConfig(ctx context.Context, bThreads *sql.BackgroundThreads, mrEnv *env.MultiRepoEnv, logger io.Writer, dbs ...SqlDatabase) ([]SqlDatabase, error)
func DbsAsDSQLDBs ¶
func DbsAsDSQLDBs(dbs []sql.Database) []SqlDatabase
type TableUpdate ¶
type TableUpdate struct { // NewSch is an updated schema for this table. It overwrites the existing value. If not provided the existing value // will not change NewSch schema.Schema // NewRowData if provided overwrites the entirety of the row data in the table. NewRowData *types.Map // RowUpdates are new values for rows that should be set in the map. They can be updates or inserts. RowUpdates []row.Row }
TableUpdate defines a list of modifications that should be made to a table
type TempTable ¶
type TempTable struct {
// contains filtered or unexported fields
}
func NewTempTable ¶
func (*TempTable) AddForeignKey ¶
func (*TempTable) CreateCheck ¶
func (*TempTable) CreateIndex ¶
func (t *TempTable) CreateIndex(ctx *sql.Context, indexName string, using sql.IndexUsing, constraint sql.IndexConstraint, columns []sql.IndexColumn, comment string) error
func (*TempTable) CreateIndexForForeignKey ¶
func (t *TempTable) CreateIndexForForeignKey(ctx *sql.Context, indexName string, using sql.IndexUsing, constraint sql.IndexConstraint, columns []sql.IndexColumn) error
func (*TempTable) DiscardChanges ¶
func (*TempTable) DropForeignKey ¶
func (*TempTable) Format ¶
func (t *TempTable) Format() *types.NomsBinFormat
func (*TempTable) GetDeclaredForeignKeys ¶
func (*TempTable) GetForeignKeyUpdater ¶
func (t *TempTable) GetForeignKeyUpdater(ctx *sql.Context) sql.ForeignKeyUpdater
func (*TempTable) GetIndexes ¶
func (*TempTable) GetReferencedForeignKeys ¶
func (*TempTable) IsTemporary ¶
func (*TempTable) PartitionRows ¶
func (*TempTable) Partitions ¶
func (*TempTable) PrimaryKeySchema ¶
func (t *TempTable) PrimaryKeySchema() sql.PrimaryKeySchema
func (*TempTable) RenameIndex ¶
func (*TempTable) StatementBegin ¶
func (*TempTable) UpdateForeignKey ¶
func (*TempTable) WithIndexLookup ¶
func (t *TempTable) WithIndexLookup(lookup sql.IndexLookup) sql.Table
type UserSpaceDatabase ¶
UserSpaceDatabase in an implementation of sql.Database for root values. Does not expose any of the internal dolt tables.
func NewUserSpaceDatabase ¶
func NewUserSpaceDatabase(root *doltdb.RootValue, editOpts editor.Options) *UserSpaceDatabase
func (*UserSpaceDatabase) DbData ¶
func (db *UserSpaceDatabase) DbData() env.DbData
func (*UserSpaceDatabase) EditOptions ¶
func (db *UserSpaceDatabase) EditOptions() editor.Options
func (*UserSpaceDatabase) GetTableInsensitive ¶
func (*UserSpaceDatabase) GetTableNames ¶
func (db *UserSpaceDatabase) GetTableNames(ctx *sql.Context) ([]string, error)
func (*UserSpaceDatabase) GetTemporaryTablesRoot ¶
func (*UserSpaceDatabase) Name ¶
func (db *UserSpaceDatabase) Name() string
func (*UserSpaceDatabase) StartTransaction ¶
func (db *UserSpaceDatabase) StartTransaction(ctx *sql.Context, tCharacteristic sql.TransactionCharacteristic) (sql.Transaction, error)
type WritableDoltTable ¶
type WritableDoltTable struct { *DoltTable // contains filtered or unexported fields }
WritableDoltTable allows updating, deleting, and inserting new rows. It implements sql.UpdatableTable and friends.
func DoltProceduresGetOrCreateTable ¶
func DoltProceduresGetOrCreateTable(ctx *sql.Context, db Database) (*WritableDoltTable, error)
DoltProceduresGetOrCreateTable returns the `dolt_procedures` table from the given db, creating it in the db's current root if it doesn't exist
func DoltProceduresGetTable ¶
func DoltProceduresGetTable(ctx *sql.Context, db Database) (*WritableDoltTable, error)
DoltProceduresGetTable returns the `dolt_procedures` table from the given db, or nil if the table doesn't exist
func GetOrCreateDoltSchemasTable ¶
func GetOrCreateDoltSchemasTable(ctx *sql.Context, db Database) (retTbl *WritableDoltTable, retErr error)
GetOrCreateDoltSchemasTable returns the `dolt_schemas` table in `db`, creating it if it does not already exist.
func (*WritableDoltTable) AutoIncrementSetter ¶
func (t *WritableDoltTable) AutoIncrementSetter(ctx *sql.Context) sql.AutoIncrementSetter
AutoIncrementSetter implements sql.AutoIncrementTable
func (*WritableDoltTable) Deleter ¶
func (t *WritableDoltTable) Deleter(ctx *sql.Context) sql.RowDeleter
Deleter implements sql.DeletableTable
func (*WritableDoltTable) GetNextAutoIncrementValue ¶
func (t *WritableDoltTable) GetNextAutoIncrementValue(ctx *sql.Context, potentialVal interface{}) (uint64, error)
GetNextAutoIncrementValue implements sql.AutoIncrementTable
func (*WritableDoltTable) Inserter ¶
func (t *WritableDoltTable) Inserter(ctx *sql.Context) sql.RowInserter
Inserter implements sql.InsertableTable
func (*WritableDoltTable) PeekNextAutoIncrementValue ¶
func (t *WritableDoltTable) PeekNextAutoIncrementValue(ctx *sql.Context) (interface{}, error)
PeekNextAutoIncrementValue implements sql.AutoIncrementTable
func (*WritableDoltTable) Replacer ¶
func (t *WritableDoltTable) Replacer(ctx *sql.Context) sql.RowReplacer
Replacer implements sql.ReplaceableTable
func (*WritableDoltTable) Truncate ¶
func (t *WritableDoltTable) Truncate(ctx *sql.Context) (int, error)
Truncate implements sql.TruncateableTable
func (*WritableDoltTable) Updater ¶
func (t *WritableDoltTable) Updater(ctx *sql.Context) sql.RowUpdater
Updater implements sql.UpdatableTable
func (*WritableDoltTable) WithIndexLookup ¶
func (t *WritableDoltTable) WithIndexLookup(lookup sql.IndexLookup) sql.Table
func (*WritableDoltTable) WithProjections ¶
func (t *WritableDoltTable) WithProjections(colNames []string) sql.Table
WithProjections implements sql.ProjectedTable
type WritableIndexedDoltTable ¶
type WritableIndexedDoltTable struct { *WritableDoltTable // contains filtered or unexported fields }
func (*WritableIndexedDoltTable) PartitionRows ¶
func (*WritableIndexedDoltTable) PartitionRows2 ¶
func (*WritableIndexedDoltTable) Partitions ¶
func (t *WritableIndexedDoltTable) Partitions(ctx *sql.Context) (sql.PartitionIter, error)
func (*WritableIndexedDoltTable) Projections ¶
func (t *WritableIndexedDoltTable) Projections() []string
Projections implements sql.ProjectedTable
func (*WritableIndexedDoltTable) WithProjections ¶
func (t *WritableIndexedDoltTable) WithProjections(colNames []string) sql.Table
WithProjections implements sql.ProjectedTable
Source Files ¶
- alterschema.go
- constants.go
- database.go
- database_provider.go
- dolt_diff_table_function.go
- indexed_dolt_table.go
- procedures_table.go
- read_replica_database.go
- replication.go
- rows.go
- schema_table.go
- show_create_table.go
- single_table_info_db.go
- system_variables.go
- tables.go
- temp_table.go
- testdata.go
- testutil.go
- user_space_database.go
Directories ¶
Path | Synopsis |
---|---|
Package expreval provides go-mysql-server expression evaluation logic that works directly on noms types.
|
Package expreval provides go-mysql-server expression evaluation logic that works directly on noms types. |
logictest
|
|
Package setalgebra provides the ability to perform algebraic set operations on mathematical sets built directly on noms types.
|
Package setalgebra provides the ability to perform algebraic set operations on mathematical sets built directly on noms types. |