compare

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compare

type Compare struct {
	Config             *lib.Config              // Config is the config object
	LocalSQLPaths      []string                 // LocalSQLPaths is a list of paths pulled from the changesets.json file
	ChangesetSignature string                   // ChangesetSignature is a SHA signature for the changesets.json file
	LocalChangeFiles   []lib.ChangeFile         // LocalChangeFiles is a list of paths to local change files
	Files              *lib.Files               // Files is the injected file manager
	Connector          lib.IConnector           // IConnector is the injected server manager
	Databases          map[string]*lib.Database // A map of databases
	Options            lib.Options
}

func NewCompare

func NewCompare(config *lib.Config, options lib.Options) (compare *Compare, e error)

NewCompare creates a new Compare instance

func (*Compare) ApplyChangeset

func (c *Compare) ApplyChangeset(changeset string) (e error)

ApplyChangeset runs the sql produced by the `CompareSchema` command against the target database @command compare [reverse] apply

func (*Compare) CompareSchema

func (c *Compare) CompareSchema(schemaFile string) (sql string, e error)

CompareSchema returns a string that contains a new line (`\n`) separated list of sql statements This comparison assumes the local `schemaFile` is the authority and the remote database is the schema to be updated @param reverse bool If true, the remote and local schema comparison is flipped in that the remote schema is treated as the authority

and the local schema is treated as the schema to be updated.

@command compare [reverse]

func (*Compare) ExportSchemaToSQL

func (c *Compare) ExportSchemaToSQL() (sql string, e error)

ExportSchemaToSQL exports the current schema to sql

func (*Compare) ImportSchema

func (c *Compare) ImportSchema(fileName string) (e error)

ImportSchema calles `FetchSchema` and then marshal's it into a JSON object, writing it to the default schema.json file @command import

Jump to

Keyboard shortcuts

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