Documentation ¶
Index ¶
Constants ¶
This section is empty.
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 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)