Versions in this module Expand all Collapse all v0 v0.0.37 Sep 10, 2023 v0.0.36 Sep 8, 2023 v0.0.35 Sep 7, 2023 v0.0.34 Sep 7, 2023 v0.0.33 Sep 4, 2023 v0.0.32 Sep 4, 2023 v0.0.31 Sep 3, 2023 v0.0.30 Sep 1, 2023 v0.0.29 Aug 26, 2023 v0.0.28 Aug 25, 2023 v0.0.27 Aug 23, 2023 v0.0.26 Aug 21, 2023 v0.0.25 Aug 19, 2023 v0.0.24 Aug 18, 2023 v0.0.23 Aug 17, 2023 v0.0.22 Aug 15, 2023 v0.0.21 Aug 15, 2023 Changes in this version + const CommentPreventingIndexBuilding + const IndexDriverId + var ExternalStoredProcedures = []sql.ExternalStoredProcedureDetails + func EncodeIndexValue(value *IndexValue) ([]byte, error) + func NewDBProvider(dbs ...sql.Database) sql.MutableDatabaseProvider + func NewDBProviderWithOpts(opts ...ProviderOption) sql.MutableDatabaseProvider + func NewHistogramMapFromTable(ctx *sql.Context, t sql.Table) (sql.HistogramMap, error) + func NewTableEditAccumulator(t *Table) tableEditAccumulator + type BaseDatabase struct + func NewViewlessDatabase(name string) *BaseDatabase + func (d *BaseDatabase) AddTable(name string, t sql.Table) + func (d *BaseDatabase) CreateFulltextTableNames(ctx *sql.Context, parentTableName string, parentIndexName string) (fulltext.IndexTableNames, error) + func (d *BaseDatabase) CreateIndexedTable(ctx *sql.Context, name string, sch sql.PrimaryKeySchema, idxDef sql.IndexDef, ...) error + func (d *BaseDatabase) CreateTable(ctx *sql.Context, name string, schema sql.PrimaryKeySchema, ...) error + func (d *BaseDatabase) CreateTrigger(ctx *sql.Context, definition sql.TriggerDefinition) error + func (d *BaseDatabase) DropEvent(ctx *sql.Context, name string) error + func (d *BaseDatabase) DropStoredProcedure(ctx *sql.Context, name string) error + func (d *BaseDatabase) DropTable(ctx *sql.Context, name string) error + func (d *BaseDatabase) DropTrigger(ctx *sql.Context, name string) error + func (d *BaseDatabase) EnablePrimaryKeyIndexes() + func (d *BaseDatabase) GetCollation(ctx *sql.Context) sql.CollationID + func (d *BaseDatabase) GetEvent(ctx *sql.Context, name string) (sql.EventDefinition, bool, error) + func (d *BaseDatabase) GetEvents(ctx *sql.Context) ([]sql.EventDefinition, error) + func (d *BaseDatabase) GetForeignKeyCollection() *ForeignKeyCollection + func (d *BaseDatabase) GetStoredProcedure(ctx *sql.Context, name string) (sql.StoredProcedureDetails, bool, error) + func (d *BaseDatabase) GetStoredProcedures(ctx *sql.Context) ([]sql.StoredProcedureDetails, error) + func (d *BaseDatabase) GetTableInsensitive(ctx *sql.Context, tblName string) (sql.Table, bool, error) + func (d *BaseDatabase) GetTableNames(ctx *sql.Context) ([]string, error) + func (d *BaseDatabase) GetTriggers(ctx *sql.Context) ([]sql.TriggerDefinition, error) + func (d *BaseDatabase) Name() string + func (d *BaseDatabase) RenameTable(ctx *sql.Context, oldName, newName string) error + func (d *BaseDatabase) SaveEvent(ctx *sql.Context, ed sql.EventDefinition) error + func (d *BaseDatabase) SaveStoredProcedure(ctx *sql.Context, spd sql.StoredProcedureDetails) error + func (d *BaseDatabase) SetCollation(ctx *sql.Context, collation sql.CollationID) error + func (d *BaseDatabase) Tables() map[string]sql.Table + func (d *BaseDatabase) UpdateEvent(ctx *sql.Context, originalName string, ed sql.EventDefinition) error + type Database struct + func NewDatabase(name string) *Database + func (d *Database) AllViews(ctx *sql.Context) ([]sql.ViewDefinition, error) + func (d *Database) CreateView(ctx *sql.Context, name string, selectStatement, createViewStmt string) error + func (d *Database) DropView(ctx *sql.Context, name string) error + func (d *Database) GetViewDefinition(ctx *sql.Context, viewName string) (sql.ViewDefinition, bool, error) + type DbProvider struct + func (pro *DbProvider) AllDatabases(*sql.Context) []sql.Database + func (pro *DbProvider) CreateDatabase(_ *sql.Context, name string) (err error) + func (pro *DbProvider) Database(_ *sql.Context, name string) (sql.Database, error) + func (pro *DbProvider) DropDatabase(_ *sql.Context, name string) (err error) + func (pro *DbProvider) ExternalStoredProcedure(_ *sql.Context, name string, numOfParams int) (*sql.ExternalStoredProcedureDetails, error) + func (pro *DbProvider) ExternalStoredProcedures(_ *sql.Context, name string) ([]sql.ExternalStoredProcedureDetails, error) + func (pro *DbProvider) HasDatabase(_ *sql.Context, name string) bool + func (pro *DbProvider) TableFunction(_ *sql.Context, name string) (sql.TableFunction, error) + func (pro *DbProvider) WithOption(opt ProviderOption) + type ExpressionsIndex interface + ColumnExpressions func() []sql.Expression + MemTable func() *Table + type FilteredTable struct + func NewFilteredTable(name string, schema sql.PrimaryKeySchema, fkColl *ForeignKeyCollection) *FilteredTable + func (t *FilteredTable) Projections() []string + func (t *FilteredTable) WithFilters(ctx *sql.Context, filters []sql.Expression) sql.Table + func (t *FilteredTable) WithProjections(schema []string) sql.Table + type ForeignKeyCollection struct + func (fkc *ForeignKeyCollection) AddFK(fk sql.ForeignKeyConstraint) + func (fkc *ForeignKeyCollection) DropFK(fkName string) bool + func (fkc *ForeignKeyCollection) Keys() []sql.ForeignKeyConstraint + func (fkc *ForeignKeyCollection) SetResolved(fkName string) bool + type GlobalsMap = map[string]interface + type HistoryDatabase struct + Revisions map[string]map[interface{}]sql.Table + func NewHistoryDatabase(name string) *HistoryDatabase + func (db *HistoryDatabase) AddTableAsOf(name string, t sql.Table, asOf interface{}) + func (db *HistoryDatabase) GetTableInsensitiveAsOf(ctx *sql.Context, tblName string, time interface{}) (sql.Table, bool, error) + func (db *HistoryDatabase) GetTableNamesAsOf(ctx *sql.Context, time interface{}) ([]string, error) + type InMemoryPersistedSession struct + func NewInMemoryPersistedSession(sess sql.Session, persistedGlobals GlobalsMap) *InMemoryPersistedSession + func NewInMemoryPersistedSessionWithValidationCallback(sess sql.Session, validateCb func()) *InMemoryPersistedSession + func (s *InMemoryPersistedSession) GetPersistedValue(k string) (interface{}, error) + func (s *InMemoryPersistedSession) PersistGlobal(sysVarName string, value interface{}) error + func (s *InMemoryPersistedSession) RemoveAllPersistedGlobals() error + func (s *InMemoryPersistedSession) RemovePersistedGlobal(sysVarName string) error + func (s *InMemoryPersistedSession) ValidateSession(ctx *sql.Context) error + type Index struct + CommentStr string + DB string + DriverName string + Exprs []sql.Expression + Fulltext bool + Name string + PrefixLens []uint16 + Spatial bool + TableName string + Tbl *Table + Unique bool + func (idx *Index) CanSupport(...sql.Range) bool + func (idx *Index) ColumnExpressionTypes() []sql.ColumnExpressionType + func (idx *Index) ColumnExpressions() []sql.Expression + func (idx *Index) Comment() string + func (idx *Index) Database() string + func (idx *Index) Driver() string + func (idx *Index) Expressions() []string + func (idx *Index) ExtendedColumnExpressionTypes() []sql.ColumnExpressionType + func (idx *Index) ExtendedExpressions() []string + func (idx *Index) FullTextKeyColumns(ctx *sql.Context) (fulltext.KeyColumns, error) + func (idx *Index) FullTextTableNames(ctx *sql.Context) (fulltext.IndexTableNames, error) + func (idx *Index) HandledFilters(filters []sql.Expression) []sql.Expression + func (idx *Index) ID() string + func (idx *Index) IndexType() string + func (idx *Index) IsFullText() bool + func (idx *Index) IsGenerated() bool + func (idx *Index) IsSpatial() bool + func (idx *Index) IsUnique() bool + func (idx *Index) MemTable() *Table + func (idx *Index) Order() sql.IndexOrder + func (idx *Index) PrefixLengths() []uint16 + func (idx *Index) Reversible() bool + func (idx *Index) Table() string + type IndexValue struct + Key string + Pos int + func DecodeIndexValue(data []byte) (*IndexValue, error) + type IndexedTable struct + Lookup sql.IndexLookup + func (t *IndexedTable) LookupPartitions(ctx *sql.Context, lookup sql.IndexLookup) (sql.PartitionIter, error) + func (t *IndexedTable) PartitionRows(ctx *sql.Context, partition sql.Partition) (sql.RowIter, error) + type IntSequenceTable struct + Len int + func (IntSequenceTable) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte) + func (s IntSequenceTable) CheckPrivileges(_ *sql.Context, _ sql.PrivilegedOperationChecker) bool + func (s IntSequenceTable) Children() []sql.Node + func (s IntSequenceTable) Database() sql.Database + func (s IntSequenceTable) DebugString() string + func (s IntSequenceTable) Description() string + func (s IntSequenceTable) Expressions() []sql.Expression + func (s IntSequenceTable) Name() string + func (s IntSequenceTable) NewInstance(_ *sql.Context, _ sql.Database, args []sql.Expression) (sql.Node, error) + func (s IntSequenceTable) Resolved() bool + func (s IntSequenceTable) RowIter(_ *sql.Context, _ sql.Row) (sql.RowIter, error) + func (s IntSequenceTable) Schema() sql.Schema + func (s IntSequenceTable) String() string + func (s IntSequenceTable) WithChildren(_ ...sql.Node) (sql.Node, error) + func (s IntSequenceTable) WithDatabase(_ sql.Database) (sql.Node, error) + func (s IntSequenceTable) WithExpressions(e ...sql.Expression) (sql.Node, error) + type MemoryDatabase interface + AddTable func(name string, t sql.Table) + type Partition struct + func NewPartition(key []byte) *Partition + func (p *Partition) Key() []byte + type ProviderOption func(*DbProvider) + func HistoryProvider(enableHistory bool) ProviderOption + func NativeIndexProvider(useNativeIndexes bool) ProviderOption + func ReadOnlyProvider(enableReadOnly bool) ProviderOption + func WithDbsOption(dbs []sql.Database) ProviderOption + type ReadOnlyDatabase struct + func NewReadOnlyDatabase(name string) ReadOnlyDatabase + func (d ReadOnlyDatabase) IsReadOnly() bool + type SequenceTableFnRowIter struct + func NewSequenceTableFnRowIter(n int) *SequenceTableFnRowIter + func (i *SequenceTableFnRowIter) Close(_ *sql.Context) error + func (i *SequenceTableFnRowIter) Next(_ *sql.Context) (sql.Row, error) + type Table struct + func NewPartitionedTable(name string, schema sql.PrimaryKeySchema, fkColl *ForeignKeyCollection, ...) *Table + func NewPartitionedTableWithCollation(name string, schema sql.PrimaryKeySchema, fkColl *ForeignKeyCollection, ...) *Table + func NewTable(name string, schema sql.PrimaryKeySchema, fkColl *ForeignKeyCollection) *Table + func NewTableWithCollation(name string, schema sql.PrimaryKeySchema, fkColl *ForeignKeyCollection, ...) *Table + func (t *Table) AddColumn(ctx *sql.Context, column *sql.Column, order *sql.ColumnOrder) error + func (t *Table) AddForeignKey(ctx *sql.Context, fk sql.ForeignKeyConstraint) error + func (t *Table) AnalyzeTable(ctx *sql.Context) error + func (t *Table) AutoIncrementSetter(ctx *sql.Context) sql.AutoIncrementSetter + func (t *Table) Collation() sql.CollationID + func (t *Table) CreateCheck(_ *sql.Context, check *sql.CheckDefinition) error + func (t *Table) CreateFulltextIndex(ctx *sql.Context, indexDef sql.IndexDef, keyCols fulltext.KeyColumns, ...) error + func (t *Table) CreateIndex(ctx *sql.Context, idx sql.IndexDef) error + func (t *Table) CreateIndexForForeignKey(ctx *sql.Context, idx sql.IndexDef) error + func (t *Table) CreatePrimaryKey(ctx *sql.Context, columns []sql.IndexColumn) error + func (t *Table) DataLength(ctx *sql.Context) (uint64, error) + func (t *Table) DebugString() string + func (t *Table) Deleter(ctx *sql.Context) sql.RowDeleter + func (t *Table) DropCheck(ctx *sql.Context, chName string) error + func (t *Table) DropColumn(ctx *sql.Context, columnName string) error + func (t *Table) DropForeignKey(ctx *sql.Context, fkName string) error + func (t *Table) DropIndex(ctx *sql.Context, indexName string) error + func (t *Table) DropPrimaryKey(ctx *sql.Context) error + func (t *Table) EnablePrimaryKeyIndexes() + func (t *Table) Filters() []sql.Expression + func (t *Table) GetChecks(_ *sql.Context) ([]sql.CheckDefinition, error) + func (t *Table) GetDeclaredForeignKeys(ctx *sql.Context) ([]sql.ForeignKeyConstraint, error) + func (t *Table) GetForeignKeyEditor(ctx *sql.Context) sql.ForeignKeyEditor + func (t *Table) GetIndexes(ctx *sql.Context) ([]sql.Index, error) + func (t *Table) GetNextAutoIncrementValue(ctx *sql.Context, insertVal interface{}) (uint64, error) + func (t *Table) GetPartition(key string) []sql.Row + func (t *Table) GetReferencedForeignKeys(ctx *sql.Context) ([]sql.ForeignKeyConstraint, error) + func (t *Table) HandledFilters(filters []sql.Expression) []sql.Expression + func (t *Table) IndexKeyValues(ctx *sql.Context, colNames []string) (sql.PartitionIndexKeyValueIter, error) + func (t *Table) IndexedAccess(i sql.IndexLookup) sql.IndexedTable + func (t *Table) Insert(ctx *sql.Context, row sql.Row) error + func (t *Table) Inserter(ctx *sql.Context) sql.RowInserter + func (t *Table) ModifyColumn(ctx *sql.Context, columnName string, column *sql.Column, ...) error + func (t *Table) ModifyDefaultCollation(ctx *sql.Context, collation sql.CollationID) error + func (t *Table) ModifyStoredCollation(ctx *sql.Context, collation sql.CollationID) error + func (t *Table) PartitionCount(ctx *sql.Context) (int64, error) + func (t *Table) PartitionRows(ctx *sql.Context, partition sql.Partition) (sql.RowIter, error) + func (t *Table) Partitions(ctx *sql.Context) (sql.PartitionIter, error) + func (t *Table) PeekNextAutoIncrementValue(*sql.Context) (uint64, error) + func (t *Table) PrimaryKeySchema() sql.PrimaryKeySchema + func (t *Table) Projections() []string + func (t *Table) RenameIndex(ctx *sql.Context, fromIndexName string, toIndexName string) error + func (t *Table) Replacer(ctx *sql.Context) sql.RowReplacer + func (t *Table) RowCount(ctx *sql.Context) (uint64, error) + func (t *Table) Schema() sql.Schema + func (t *Table) SetForeignKeyResolved(ctx *sql.Context, fkName string) error + func (t *Table) String() string + func (t *Table) Truncate(ctx *sql.Context) (int, error) + func (t *Table) UpdateForeignKey(ctx *sql.Context, fkName string, fk sql.ForeignKeyConstraint) error + func (t *Table) Updater(ctx *sql.Context) sql.RowUpdater + func (t *Table) WithDriverIndexLookup(lookup sql.DriverIndexLookup) sql.Table + func (t *Table) WithProjections(cols []string) sql.Table + func (t Table) Name() string + type TestIndexDriver struct + func NewIndexDriver(db string, indexes map[string][]sql.DriverIndex) *TestIndexDriver + func (d *TestIndexDriver) Create(db, table, id string, expressions []sql.Expression, config map[string]string) (sql.DriverIndex, error) + func (d *TestIndexDriver) Delete(sql.DriverIndex, sql.PartitionIter) error + func (d *TestIndexDriver) ID() string + func (d *TestIndexDriver) LoadAll(ctx *sql.Context, db, table string) ([]sql.DriverIndex, error) + func (d *TestIndexDriver) Save(*sql.Context, sql.DriverIndex, sql.PartitionIndexKeyValueIter) error