gtids

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2026 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

gtid.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckGtidSetSubset

func CheckGtidSetSubset(db1 *sql.DB, db2 *sql.DB, source string, target string, fix bool, fixReplica bool, fixMissingReplica bool) error

func ConnectToDatabases

func ConnectToDatabases(sourceHost, sourcePort, targetHost, targetPort string) (db1, db2 *sql.DB, err error)

ConnectToDatabases connects to the source and target databases with retry logic

func ReadMyCnf

func ReadMyCnf() (user, password string, err error)

ReadMyCnf reads the ~/.my.cnf file to get the database credentials

Types

type OracleGtidSet

type OracleGtidSet struct {
	GtidEntries [](*OracleGtidSetEntry)
}

OracleGtidSet represents a set of GTID ranges as depicted by Retrieved_Gtid_Set, Executed_Gtid_Set or @@gtid_purged.

func NewOracleGtidSet

func NewOracleGtidSet(gtidSet string) (res *OracleGtidSet, err error)

Example input: `230ea8ea-81e3-11e4-972a-e25ec4bd140a:1-10539, 316d193c-70e5-11e5-adb2-ecf4bb2262ff:1-8935:8984-6124596, 321f5c0d-70e5-11e5-adb2-ecf4bb2262ff:1-56`

func (*OracleGtidSet) Explode

func (ogs *OracleGtidSet) Explode() (result [](*OracleGtidSetEntry))

String returns a user-friendly string representation of this entry

func (*OracleGtidSet) IsEmpty

func (ogs *OracleGtidSet) IsEmpty() bool

func (*OracleGtidSet) RemoveUUID

func (ogs *OracleGtidSet) RemoveUUID(uuid string) (removed bool)

RemoveUUID removes entries that belong to given UUID. By way of how this works there can only be one entry matching our UUID, but we generalize. We keep order of entries.

func (*OracleGtidSet) RetainUUID

func (ogs *OracleGtidSet) RetainUUID(uuid string) (anythingRemoved bool)

RetainUUID retains only entries that belong to given UUID.

func (*OracleGtidSet) RetainUUIDs

func (ogs *OracleGtidSet) RetainUUIDs(uuids []string) (anythingRemoved bool)

RetainUUIDs retains only entries that belong to given UUIDs.

func (*OracleGtidSet) SharedUUIDs

func (ogs *OracleGtidSet) SharedUUIDs(other *OracleGtidSet) (shared []string)

SharedUUIDs returns UUIDs (range-less) that are shared between the two sets

func (*OracleGtidSet) String

func (ogs *OracleGtidSet) String() string

type OracleGtidSetEntry

type OracleGtidSetEntry struct {
	UUID   string
	Ranges string
}

OracleGtidSetEntry represents an entry in a set of GTID ranges, for example, the entry: "316d193c-70e5-11e5-adb2-ecf4bb2262ff:1-8935:8984-6124596" (may include gaps)

func NewOracleGtidSetEntry

func NewOracleGtidSetEntry(gtidRangeString string) (*OracleGtidSetEntry, error)

NewOracleGtidSetEntry parses a single entry text

func (*OracleGtidSetEntry) Explode

func (oge *OracleGtidSetEntry) Explode() (result [](*OracleGtidSetEntry))

String returns a user-friendly string representation of this entry

func (*OracleGtidSetEntry) String

func (oge *OracleGtidSetEntry) String() string

String returns a user-friendly string representation of this entry

Jump to

Keyboard shortcuts

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