mysql

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 11 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver struct{}

func New

func New() *Driver

func (*Driver) Address added in v0.2.0

func (*Driver) Address(ep driver.Endpoint) string

func (*Driver) Configured

func (*Driver) Configured(ep driver.Endpoint) bool

func (*Driver) Databases added in v0.2.0

func (*Driver) Databases(ctx context.Context, ep driver.Endpoint) ([]string, error)

func (*Driver) Fields

func (*Driver) Fields() []driver.Field

func (*Driver) Local added in v0.1.1

func (*Driver) Local() driver.Local

func (*Driver) Name

func (*Driver) Name() string

func (*Driver) Objects

func (*Driver) Objects(ctx context.Context, ep driver.Endpoint, db string) ([]driver.Object, error)

func (*Driver) Permanent added in v0.2.0

func (*Driver) Permanent(line string) bool

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

func (*Driver) Prepare(ctx context.Context, dst driver.Endpoint, db string, fresh bool) error

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.

func (*Driver) StageFromLog

func (*Driver) StageFromLog(string) string

func (*Driver) StageFromStream

func (*Driver) StageFromStream(chunk []byte) string

Jump to

Keyboard shortcuts

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