Documentation
¶
Overview ¶
Package mysql is the MySQL driver. mysqldump is single-threaded, so the driver gets its parallelism by splitting the tables of a database into groups and running one `mysqldump <tables> | mysql` pipe per group, balanced by table size. Both tools run inside the local mysql container towards any pair of endpoints.
Index ¶
- type Driver
- func (*Driver) Address(ep driver.Endpoint) string
- func (*Driver) Configured(ep driver.Endpoint) bool
- func (*Driver) Databases(ctx context.Context, ep driver.Endpoint) ([]string, error)
- func (*Driver) Fields() []driver.Field
- func (*Driver) Local() driver.Local
- func (*Driver) Name() string
- func (*Driver) Objects(ctx context.Context, ep driver.Endpoint, db string) ([]driver.Object, error)
- func (*Driver) Permanent(line string) bool
- func (d *Driver) Plan(ctx context.Context, src, dst driver.Endpoint, db string, workers int, ...) (driver.Plan, error)
- func (*Driver) Prepare(ctx context.Context, dst driver.Endpoint, db string, fresh bool) error
- func (*Driver) StageFromLog(string) string
- func (*Driver) StageFromStream(chunk []byte) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver struct{}
func (*Driver) Plan ¶
func (d *Driver) Plan(ctx context.Context, src, dst driver.Endpoint, db string, workers int, only []string) (driver.Plan, error)
Plan: phase 1 = the selected base tables in up to `workers` size-balanced groups, phase 2 = the selected views, plus routines/events when the whole database is cloned. Each group is its own --single-transaction, so groups are not one snapshot of each other — fine for a dev copy, not for a backup.
func (*Driver) Prepare ¶
Prepare creates the database only when it is missing — a remote target user may lack the CREATE privilege on a database that already exists. db was validated by the engine.