Documentation
¶
Index ¶
Constants ¶
const MaxSeqValue = 9223372036854775807
MaxSeqValue represents default maximum sequence value
Variables ¶
This section is empty.
Functions ¶
func UpdateMySQLSequence ¶
func UpdateMySQLSequence(ctx context.Context, db *sql.DB, target interface{}, iopts ...interface{}) (doNext bool, err error)
UpdateMySQLSequence updates for all passed sink.Sequences theirs Value or StartValue getting autoincrement metadata by: SHOW CREATE TABLE ..., @@SESSION.auto_increment_increment, @@SESSION.auto_increment_offset
Warning! Until we don't use autoincrement in the table (by insert at least one row with 0-value id), "show create table" and "information_schema.tables" show wrong autoincrement value if @@SESSION.auto_increment_increment > 1
Types ¶
type ReservationLock ¶ added in v0.26.1
type ReservationLock struct{}
ReservationLock defers row locking until native column identity is known. The InnoDB reservation uses a current locking read, including under RR.
func (*ReservationLock) CanUse ¶ added in v0.26.1
func (*ReservationLock) CanUse(...interface{}) bool
type ReservationMetadata ¶ added in v0.26.1
type ReservationMetadata struct{}
ReservationMetadata validates the physical AUTO_INCREMENT column rather than inferring an allocator from a product name or an authored primary-key tag.
func (*ReservationMetadata) CanUse ¶ added in v0.26.1
func (*ReservationMetadata) CanUse(opts ...interface{}) bool
type ReservationRange ¶ added in v0.26.1
type ReservationRange struct{}
func (*ReservationRange) CanUse ¶ added in v0.26.1
func (*ReservationRange) CanUse(opts ...interface{}) bool
type Store ¶ added in v0.26.1
type Store struct{}
Store provisions native allocator metadata outside application transactions. MySQL DDL implicitly commits: allocation never invokes Install, creates source objects, modifies source schema, or borrows a second caller connection.
type StrategyError ¶ added in v0.26.1
type StrategyError struct{}
StrategyError prevents a placeholder query from pretending to allocate IDs.
func (*StrategyError) CanUse ¶ added in v0.26.1
func (*StrategyError) CanUse(...interface{}) bool
type Transient ¶
type Transient struct{}
Transient represents struct used to setting new autoincrement value using insert inside new transaction finished by rollback
type Udf ¶
type Udf struct{}
Udf represents struct used to setting new autoincrement value using user defined stored procedure in db and internal autoincrement value handling
func (*Udf) Handle ¶
func (n *Udf) Handle(ctx context.Context, db *sql.DB, target interface{}, iopts ...interface{}) (doNext bool, err error)
Handle sets new autoincrement value by executing user defined stored procedure and using internal autoincrement value handling
all this handler requires more testing (especially with transactions)