Documentation
¶
Index ¶
- Variables
- func CloseContextRootFinalizer(ctx *sql.Context) error
- func GetCollectionFromContext(ctx *sql.Context) (*sequences.Collection, error)
- func GetCurrentSchema(ctx *sql.Context) (string, error)
- func GetTableFromContext(ctx *sql.Context, tableName doltdb.TableName) (*doltdb.Table, error)
- func Init()
- type RelationType
- type RootValue
- func (root *RootValue) CreateDatabaseSchema(ctx context.Context, dbSchema schema.DatabaseSchema) (doltdb.RootValue, error)
- func (root *RootValue) DebugString(ctx context.Context, transitive bool) string
- func (root *RootValue) GetCollation(ctx context.Context) (schema.Collation, error)
- func (root *RootValue) GetDatabaseSchemas(ctx context.Context) ([]schema.DatabaseSchema, error)
- func (root *RootValue) GetFeatureVersion(ctx context.Context) (ver doltdb.FeatureVersion, ok bool, err error)
- func (root *RootValue) GetForeignKeyCollection(ctx context.Context) (*doltdb.ForeignKeyCollection, error)
- func (root *RootValue) GetSequences(ctx context.Context) (*sequences.Collection, error)
- func (root *RootValue) GetTable(ctx context.Context, tName doltdb.TableName) (*doltdb.Table, bool, error)
- func (root *RootValue) GetTableHash(ctx context.Context, tName doltdb.TableName) (hash.Hash, bool, error)
- func (root *RootValue) GetTableNames(ctx context.Context, schemaName string) ([]string, error)
- func (root *RootValue) GetTableSchemaHash(ctx context.Context, tName doltdb.TableName) (hash.Hash, error)
- func (root *RootValue) HandlePostMerge(ctx context.Context, ourRoot, theirRoot, ancRoot doltdb.RootValue) (doltdb.RootValue, error)
- func (root *RootValue) HasTable(ctx context.Context, tName doltdb.TableName) (bool, error)
- func (root *RootValue) HashOf() (hash.Hash, error)
- func (root *RootValue) IterTables(ctx context.Context, ...) error
- func (root *RootValue) NodeStore() tree.NodeStore
- func (root *RootValue) NomsValue() types.Value
- func (root *RootValue) PutForeignKeyCollection(ctx context.Context, fkc *doltdb.ForeignKeyCollection) (doltdb.RootValue, error)
- func (root *RootValue) PutSequences(ctx context.Context, seq *sequences.Collection) (*RootValue, error)
- func (root *RootValue) PutTable(ctx context.Context, tName doltdb.TableName, table *doltdb.Table) (doltdb.RootValue, error)
- func (root *RootValue) RemoveTables(ctx context.Context, skipFKHandling bool, allowDroppingFKReferenced bool, ...) (doltdb.RootValue, error)
- func (root *RootValue) RenameTable(ctx context.Context, oldName, newName doltdb.TableName) (doltdb.RootValue, error)
- func (root *RootValue) ResolveRootValue(ctx context.Context) (doltdb.RootValue, error)
- func (root *RootValue) ResolveTableName(ctx context.Context, tName doltdb.TableName) (string, bool, error)
- func (root *RootValue) SetCollation(ctx context.Context, collation schema.Collation) (doltdb.RootValue, error)
- func (root *RootValue) SetFeatureVersion(v doltdb.FeatureVersion) (doltdb.RootValue, error)
- func (root *RootValue) SetTableHash(ctx context.Context, tName string, h hash.Hash) (doltdb.RootValue, error)
- func (root *RootValue) TableListHash() uint64
- func (root *RootValue) VRW() types.ValueReadWriter
Constants ¶
This section is empty.
Variables ¶
var DoltgresFeatureVersion = doltdb.DoltFeatureVersion + 0
DoltgresFeatureVersion is Doltgres' feature version. We use Dolt's feature version added to our own.
Functions ¶
func CloseContextRootFinalizer ¶ added in v0.8.0
CloseContextRootFinalizer finalizes any changes persisted within the context by writing them to the working root. This should ONLY be called by the ContextRootFinalizer node.
func GetCollectionFromContext ¶ added in v0.8.0
func GetCollectionFromContext(ctx *sql.Context) (*sequences.Collection, error)
GetCollectionFromContext returns the given sequence collection from the context. Will always return a collection if no error is returned.
func GetCurrentSchema ¶ added in v0.7.5
GetCurrentSchema returns the current schema used by the context. Defaults to "public" if the context does not specify a schema.
func GetTableFromContext ¶ added in v0.8.0
GetTableFromContext returns the table from the context. Returns nil if no table was found.
Types ¶
type RelationType ¶ added in v0.8.0
type RelationType byte
RelationType states the type of the relation.
const ( RelationType_DoesNotExist RelationType = iota RelationType_Table RelationType_Sequence )
func GetRelationType ¶ added in v0.8.0
GetRelationType returns whether the working root has the given relation, and what type of relation it is. According to the Postgres docs, a relation may be one of: table, sequence, index, view, materialized view, foreign table. This may also include composite types and partitions, but this hasn't been confirmed.
func GetRelationTypeFromRoot ¶ added in v0.8.0
func GetRelationTypeFromRoot(ctx *sql.Context, schema string, relation string, root *RootValue) (RelationType, error)
GetRelationTypeFromRoot performs the same function as GetRelationType, except that it uses the given root rather than the working session's root.
type RootValue ¶ added in v0.7.5
type RootValue struct {
// contains filtered or unexported fields
}
RootValue is Doltgres' implementation of doltdb.RootValue.
func (*RootValue) CreateDatabaseSchema ¶ added in v0.7.5
func (root *RootValue) CreateDatabaseSchema(ctx context.Context, dbSchema schema.DatabaseSchema) (doltdb.RootValue, error)
CreateDatabaseSchema implements the interface doltdb.RootValue.
func (*RootValue) DebugString ¶ added in v0.7.5
DebugString implements the interface doltdb.RootValue.
func (*RootValue) GetCollation ¶ added in v0.7.5
GetCollation implements the interface doltdb.RootValue.
func (*RootValue) GetDatabaseSchemas ¶ added in v0.7.5
GetDatabaseSchemas implements the interface doltdb.RootValue.
func (*RootValue) GetFeatureVersion ¶ added in v0.7.5
func (root *RootValue) GetFeatureVersion(ctx context.Context) (ver doltdb.FeatureVersion, ok bool, err error)
GetFeatureVersion implements the interface doltdb.RootValue.
func (*RootValue) GetForeignKeyCollection ¶ added in v0.7.5
func (root *RootValue) GetForeignKeyCollection(ctx context.Context) (*doltdb.ForeignKeyCollection, error)
GetForeignKeyCollection implements the interface doltdb.RootValue.
func (*RootValue) GetSequences ¶ added in v0.7.5
GetSequences returns all sequences that are on the root.
func (*RootValue) GetTable ¶ added in v0.7.5
func (root *RootValue) GetTable(ctx context.Context, tName doltdb.TableName) (*doltdb.Table, bool, error)
GetTable implements the interface doltdb.RootValue.
func (*RootValue) GetTableHash ¶ added in v0.7.5
func (root *RootValue) GetTableHash(ctx context.Context, tName doltdb.TableName) (hash.Hash, bool, error)
GetTableHash implements the interface doltdb.RootValue.
func (*RootValue) GetTableNames ¶ added in v0.7.5
GetTableNames implements the interface doltdb.RootValue.
func (*RootValue) GetTableSchemaHash ¶ added in v0.11.0
func (root *RootValue) GetTableSchemaHash(ctx context.Context, tName doltdb.TableName) (hash.Hash, error)
GetTableSchemaHash implements the interface doltdb.RootValue.
func (*RootValue) HandlePostMerge ¶ added in v0.7.5
func (root *RootValue) HandlePostMerge(ctx context.Context, ourRoot, theirRoot, ancRoot doltdb.RootValue) (doltdb.RootValue, error)
HandlePostMerge implements the interface doltdb.RootValue.
func (*RootValue) IterTables ¶ added in v0.7.5
func (root *RootValue) IterTables(ctx context.Context, cb func(name doltdb.TableName, table *doltdb.Table, sch schema.Schema) (stop bool, err error)) error
IterTables implements the interface doltdb.RootValue.
func (*RootValue) PutForeignKeyCollection ¶ added in v0.7.5
func (root *RootValue) PutForeignKeyCollection(ctx context.Context, fkc *doltdb.ForeignKeyCollection) (doltdb.RootValue, error)
PutForeignKeyCollection implements the interface doltdb.RootValue.
func (*RootValue) PutSequences ¶ added in v0.7.5
func (root *RootValue) PutSequences(ctx context.Context, seq *sequences.Collection) (*RootValue, error)
PutSequences writes the given sequences to the returned root value.
func (*RootValue) PutTable ¶ added in v0.7.5
func (root *RootValue) PutTable(ctx context.Context, tName doltdb.TableName, table *doltdb.Table) (doltdb.RootValue, error)
PutTable implements the interface doltdb.RootValue.
func (*RootValue) RemoveTables ¶ added in v0.7.5
func (root *RootValue) RemoveTables( ctx context.Context, skipFKHandling bool, allowDroppingFKReferenced bool, tables ...doltdb.TableName, ) (doltdb.RootValue, error)
RemoveTables implements the interface doltdb.RootValue.
func (*RootValue) RenameTable ¶ added in v0.7.5
func (root *RootValue) RenameTable(ctx context.Context, oldName, newName doltdb.TableName) (doltdb.RootValue, error)
RenameTable implements the interface doltdb.RootValue.
func (*RootValue) ResolveRootValue ¶ added in v0.7.5
ResolveRootValue implements the interface doltdb.RootValue.
func (*RootValue) ResolveTableName ¶ added in v0.7.5
func (root *RootValue) ResolveTableName(ctx context.Context, tName doltdb.TableName) (string, bool, error)
ResolveTableName implements the interface doltdb.RootValue.
func (*RootValue) SetCollation ¶ added in v0.7.5
func (root *RootValue) SetCollation(ctx context.Context, collation schema.Collation) (doltdb.RootValue, error)
SetCollation implements the interface doltdb.RootValue.
func (*RootValue) SetFeatureVersion ¶ added in v0.7.5
SetFeatureVersion implements the interface doltdb.RootValue.
func (*RootValue) SetTableHash ¶ added in v0.7.5
func (root *RootValue) SetTableHash(ctx context.Context, tName string, h hash.Hash) (doltdb.RootValue, error)
SetTableHash implements the interface doltdb.RootValue.
func (*RootValue) TableListHash ¶ added in v0.11.0
func (*RootValue) VRW ¶ added in v0.7.5
func (root *RootValue) VRW() types.ValueReadWriter
VRW implements the interface doltdb.RootValue.