Documentation ¶
Index ¶
- type Collection
- func (pgs *Collection) Clone() *Collection
- func (pgs *Collection) CreateSequence(schema string, seq *Sequence) error
- func (pgs *Collection) DropSequence(name doltdb.TableName) error
- func (pgs *Collection) GetAllSequences() (sequences map[string][]*Sequence, schemaNames []string, totalCount int)
- func (pgs *Collection) GetSequence(name doltdb.TableName) *Sequence
- func (pgs *Collection) GetSequencesWithTable(name doltdb.TableName) []*Sequence
- func (pgs *Collection) HasSequence(name doltdb.TableName) bool
- func (pgs *Collection) IterateSequences(f func(schema string, seq *Sequence) error) error
- func (pgs *Collection) NextVal(schema, name string) (int64, error)
- func (pgs *Collection) Serialize(ctx context.Context) ([]byte, error)
- func (pgs *Collection) SetVal(schema, name string, newValue int64, autoAdvance bool) error
- type Persistence
- type Sequence
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
Collection contains a collection of sequences.
func Deserialize ¶
func Deserialize(ctx context.Context, data []byte) (*Collection, error)
Deserialize returns the Collection that was serialized in the byte slice. Returns an empty Collection if data is nil or empty.
func Merge ¶
func Merge(ctx context.Context, ourCollection, theirCollection, ancCollection *Collection) (*Collection, error)
Merge handles merging sequences on our root and their root.
func (*Collection) Clone ¶ added in v0.8.0
func (pgs *Collection) Clone() *Collection
Clone returns a new *Collection with the same contents as the original.
func (*Collection) CreateSequence ¶
func (pgs *Collection) CreateSequence(schema string, seq *Sequence) error
CreateSequence creates a new sequence.
func (*Collection) DropSequence ¶
func (pgs *Collection) DropSequence(name doltdb.TableName) error
DropSequence drops an existing sequence.
func (*Collection) GetAllSequences ¶ added in v0.10.0
func (pgs *Collection) GetAllSequences() (sequences map[string][]*Sequence, schemaNames []string, totalCount int)
GetAllSequences returns a map containing all sequences in the collection, grouped by the schema they're contained in. Each sequence array is also sorted by the sequence name.
func (*Collection) GetSequence ¶ added in v0.8.0
func (pgs *Collection) GetSequence(name doltdb.TableName) *Sequence
GetSequence returns the sequence with the given schema and name. Returns nil if the sequence cannot be found.
func (*Collection) GetSequencesWithTable ¶ added in v0.8.0
func (pgs *Collection) GetSequencesWithTable(name doltdb.TableName) []*Sequence
GetSequencesWithTable returns all sequences with the given table as the owner.
func (*Collection) HasSequence ¶
func (pgs *Collection) HasSequence(name doltdb.TableName) bool
HasSequence returns whether the sequence is present.
func (*Collection) IterateSequences ¶ added in v0.8.0
func (pgs *Collection) IterateSequences(f func(schema string, seq *Sequence) error) error
IterateSequences iterates over all sequences in the collection.
func (*Collection) NextVal ¶
func (pgs *Collection) NextVal(schema, name string) (int64, error)
NextVal returns the next value in the sequence.
type Persistence ¶
type Persistence uint8
Persistence controls the persistence of a Sequence.
const ( Persistence_Permanent Persistence = 0 Persistence_Temporary Persistence = 1 Persistence_Unlogged Persistence = 2 )
type Sequence ¶
type Sequence struct { Name string DataTypeOID uint32 Persistence Persistence Start int64 Current int64 Increment int64 Minimum int64 Maximum int64 Cache int64 Cycle bool IsAtEnd bool OwnerUser string OwnerTable string OwnerColumn string }
Sequence represents a single sequence within the pg_sequence table.