Documentation
¶
Index ¶
- type Collection
- func (pgs *Collection) CreateSequence(schema string, seq *Sequence) error
- func (pgs *Collection) DropSequence(schema, name string) error
- func (pgs *Collection) HasSequence(schema, name string) bool
- 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, ourSequence, theirSequence, ancSequence *Collection) (*Collection, error)
Merge handles merging sequences on our root and their root.
func (*Collection) CreateSequence ¶
func (pgs *Collection) CreateSequence(schema string, seq *Sequence) error
CreateSequence creates a new sequence.
func (*Collection) DropSequence ¶
func (pgs *Collection) DropSequence(schema, name string) error
DropSequence drops an existing sequence.
func (*Collection) HasSequence ¶
func (pgs *Collection) HasSequence(schema, name string) bool
HasSequence returns whether the sequence is present.
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.
Click to show internal directories.
Click to hide internal directories.