conflicts

package
v0.52.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClearContextValues = func(ctx *sql.Context) {
	panic("ClearContextValues was never initialized")
}

ClearContextValues clears context values, and is declared in a different package. It is assigned here by an Init function to get around import cycles.

View Source
var DeserializeRootObject = func(ctx context.Context, rootObjID objinterface.RootObjectID, data []byte) (objinterface.RootObject, error) {
	return nil, errors.New("DeserializeRootObject was never initialized")
}

DeserializeRootObject handles root object deserialization, and is declared in a different package. It is assigned here by an Init function to get around import cycles.

View Source
var DiffRootObjects = func(ctx context.Context, rootObjID objinterface.RootObjectID, fromHash string, ours, theirs, ancestor objinterface.RootObject) ([]objinterface.RootObjectDiff, objinterface.RootObject, error) {
	return nil, nil, errors.New("DiffRootObjects was never initialized")
}

DiffRootObjects handles conflict diffs, and is declared in a different package. It is assigned here by an Init function to get around import cycles.

View Source
var GetFieldType = func(ctx context.Context, rootObjID objinterface.RootObjectID, fieldName string) *pgtypes.DoltgresType {
	panic("GetFieldType was never initialized")
}

GetFieldType handles type fetching for fields, and is declared in a different package. It is assigned here by an Init function to get around import cycles.

View Source
var ResolveNameExternal = func(ctx context.Context, name doltdb.TableName, rootObjects []objinterface.RootObject) (doltdb.TableName, id.Id, error) {
	panic("ResolveNameExternal was never initialized")
}

ResolveNameExternal handles name resolution across all collection types, and is declared in a different package. It is assigned here by an Init function to get around import cycles.

View Source
var UpdateField = func(ctx context.Context, rootObjID objinterface.RootObjectID, rootObject objinterface.RootObject, fieldName string, newValue any) (objinterface.RootObject, error) {
	return nil, errors.New("UpdateField was never initialized")
}

UpdateField handles updating fields in a root object, and is declared in a different package. It is assigned here by an Init function to get around import cycles.

Functions

This section is empty.

Types

type Collection

type Collection struct {
	// contains filtered or unexported fields
}

Collection contains a collection of conflicts.

func LoadConflicts

func LoadConflicts(ctx context.Context, root objinterface.RootValue) (*Collection, error)

LoadConflicts loads the conflicts collection from the given root.

func NewCollection

func NewCollection(ctx context.Context, underlyingMap prolly.AddressMap, ns tree.NodeStore) (*Collection, error)

NewCollection returns a new Collection.

func (*Collection) AddConflict

func (pgc *Collection) AddConflict(ctx context.Context, conflict Conflict) error

AddConflict adds a new conflict.

func (*Collection) Clone

func (pgc *Collection) Clone(ctx context.Context) *Collection

Clone returns a new *Collection with the same contents as the original.

func (*Collection) DeserializeRootObject

func (pgc *Collection) DeserializeRootObject(ctx context.Context, data []byte) (objinterface.RootObject, error)

DeserializeRootObject implements the interface objinterface.Collection.

func (*Collection) DiffRootObjects

DiffRootObjects implements the interface objinterface.Collection.

func (*Collection) DiffersFrom

func (pgc *Collection) DiffersFrom(ctx context.Context, root objinterface.RootValue) bool

DiffersFrom returns true when the hash that is associated with the underlying map for this collection is different from the hash in the given root.

func (*Collection) DropConflict

func (pgc *Collection) DropConflict(ctx context.Context, conflictIDs ...id.Id) error

DropConflict drops an existing conflict.

func (*Collection) DropRootObject

func (pgc *Collection) DropRootObject(ctx context.Context, identifier id.Id) error

DropRootObject implements the interface objinterface.Collection.

func (*Collection) GetConflict

func (pgc *Collection) GetConflict(ctx context.Context, conflictID id.Id) (Conflict, error)

GetConflict returns the conflict with the given ID. Returns a conflict with an invalid ID if it cannot be found (Conflict.ID.IsValid() == false).

func (*Collection) GetFieldType

func (pgc *Collection) GetFieldType(ctx context.Context, fieldName string) *pgtypes.DoltgresType

GetFieldType implements the interface objinterface.Collection.

func (*Collection) GetID

func (pgc *Collection) GetID() objinterface.RootObjectID

GetID implements the interface objinterface.Collection.

func (*Collection) GetRootObject

func (pgc *Collection) GetRootObject(ctx context.Context, identifier id.Id) (objinterface.RootObject, bool, error)

GetRootObject implements the interface objinterface.Collection.

func (*Collection) HandleMerge

HandleMerge implements the interface objinterface.Collection.

func (*Collection) HasConflict

func (pgc *Collection) HasConflict(ctx context.Context, conflictID id.Id) bool

HasConflict returns whether the conflict is present.

func (*Collection) HasRootObject

func (pgc *Collection) HasRootObject(ctx context.Context, identifier id.Id) (bool, error)

HasRootObject implements the interface objinterface.Collection.

func (*Collection) IDToTableName

func (pgc *Collection) IDToTableName(identifier id.Id) doltdb.TableName

IDToTableName implements the interface objinterface.Collection.

func (*Collection) IterAll

func (pgc *Collection) IterAll(ctx context.Context, callback func(rootObj objinterface.RootObject) (stop bool, err error)) error

IterAll implements the interface objinterface.Collection.

func (*Collection) IterIDs

func (pgc *Collection) IterIDs(ctx context.Context, callback func(identifier id.Id) (stop bool, err error)) error

IterIDs implements the interface objinterface.Collection.

func (*Collection) IterateConflicts

func (pgc *Collection) IterateConflicts(ctx context.Context, callback func(conflict Conflict) (stop bool, err error)) error

IterateConflicts iterates over all conflicts in the collection.

func (*Collection) LoadCollection

LoadCollection implements the interface objinterface.Collection.

func (*Collection) LoadCollectionHash

func (*Collection) LoadCollectionHash(ctx context.Context, root objinterface.RootValue) (hash.Hash, error)

LoadCollectionHash implements the interface objinterface.Collection.

func (*Collection) Map

func (pgc *Collection) Map(ctx context.Context) (prolly.AddressMap, error)

Map writes any cached sequences to the underlying map, and then returns the underlying map.

func (*Collection) PutRootObject

func (pgc *Collection) PutRootObject(ctx context.Context, rootObj objinterface.RootObject) error

PutRootObject implements the interface objinterface.Collection.

func (*Collection) RenameRootObject

func (pgc *Collection) RenameRootObject(ctx context.Context, oldName id.Id, newName id.Id) error

RenameRootObject implements the interface objinterface.Collection.

func (*Collection) ResolveName

func (pgc *Collection) ResolveName(ctx context.Context, name doltdb.TableName) (doltdb.TableName, id.Id, error)

ResolveName implements the interface objinterface.Collection.

func (*Collection) ResolveNameFromObjects

func (*Collection) ResolveNameFromObjects(ctx context.Context, name doltdb.TableName, rootObjects []objinterface.RootObject) (doltdb.TableName, id.Id, error)

ResolveNameFromObjects implements the interface objinterface.Collection.

func (*Collection) Serializer

Serializer implements the interface objinterface.Collection.

func (*Collection) TableNameToID

func (pgc *Collection) TableNameToID(name doltdb.TableName) id.Id

TableNameToID implements the interface objinterface.Collection.

func (*Collection) UpdateField

func (pgc *Collection) UpdateField(ctx context.Context, rootObject objinterface.RootObject, fieldName string, newValue any) (objinterface.RootObject, error)

UpdateField implements the interface objinterface.Collection.

func (*Collection) UpdateRoot

UpdateRoot implements the interface objinterface.Collection.

type Conflict

type Conflict struct {
	ID           id.Id
	FromHash     string
	RootObjectID objinterface.RootObjectID
	Ours         objinterface.RootObject
	Theirs       objinterface.RootObject
	Ancestor     objinterface.RootObject
}

Conflict represents a root object conflict.

func DeserializeConflict

func DeserializeConflict(ctx context.Context, data []byte) (_ Conflict, err error)

DeserializeConflict returns the Conflict that was serialized in the byte slice. Returns an empty Conflict (invalid ID) if data is nil or empty.

func (Conflict) DiffCount

func (conflict Conflict) DiffCount(ctx *sql.Context) (int, error)

DiffCount implements the interface objinterface.Conflict.

func (Conflict) Diffs

Diffs implements the interface objinterface.Conflict.

func (Conflict) FieldType

func (conflict Conflict) FieldType(ctx context.Context, name string) *pgtypes.DoltgresType

FieldType implements the interface objinterface.Conflict.

func (Conflict) GetContainedRootObjectID

func (conflict Conflict) GetContainedRootObjectID() objinterface.RootObjectID

GetContainedRootObjectID implements the interface objinterface.RootObject.

func (Conflict) GetID

func (conflict Conflict) GetID() id.Id

GetID implements the interface objinterface.RootObject.

func (Conflict) GetRootObjectID

func (conflict Conflict) GetRootObjectID() objinterface.RootObjectID

GetRootObjectID implements the interface objinterface.RootObject.

func (Conflict) HashOf

func (conflict Conflict) HashOf(ctx context.Context) (hash.Hash, error)

HashOf implements the interface objinterface.RootObject.

func (Conflict) Name

func (conflict Conflict) Name() doltdb.TableName

Name implements the interface objinterface.RootObject.

func (Conflict) RemoveDiffs

func (conflict Conflict) RemoveDiffs(ctx *sql.Context, diffs []doltdb.RootObjectDiff) (doltdb.ConflictRootObject, error)

RemoveDiffs implements the interface doltdb.ConflictRootObject.

func (Conflict) Rows

func (conflict Conflict) Rows(ctx *sql.Context) (sql.RowIter, error)

Rows implements the interface doltdb.ConflictRootObject.

func (Conflict) Schema

func (conflict Conflict) Schema(originatingTableName string) sql.Schema

Schema implements the interface doltdb.ConflictRootObject.

func (Conflict) Serialize

func (conflict Conflict) Serialize(ctx context.Context) (_ []byte, err error)

Serialize returns the Conflict as a byte slice. If the Conflict is invalid, then this returns a nil slice.

func (Conflict) UpdateField

UpdateField implements the interface doltdb.ConflictRootObject.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL