dumper

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Drivers

func Drivers() []string

Drivers returns a sorted list of the names of the registered drivers.

func Register

func Register(name string, driver Driver)

Register makes a database driver available by the provided name. If Register is called twice with the same name or if driver is nil, it panics.

Types

type ConnOpts

type ConnOpts struct {
	DSN             string
	Timeout         time.Duration
	MaxConnLifetime time.Duration
	MaxConns        int
	MaxIdleConns    int
}

ConnOpts are the options to create a connection

type Driver

type Driver interface {
	IsSupported(dsn string) bool
	NewConnection(ConnOpts, reader.Reader) (Dumper, error)
}

Driver is a driver interface used to support multiple drivers

type Dumper

type Dumper interface {
	Dump(chan<- struct{}, config.Tables, int) error
	// Close closes the dumper resources and releases them.
	Close() error
}

A Dumper writes a database's stucture to the provided stream.

func NewDumper

func NewDumper(opts ConnOpts, rdr reader.Reader) (dumper Dumper, err error)

NewDumper is a factory method that will create a dumper based on the provided DSN

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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