Documentation
¶
Index ¶
- type Compare
- func (c *Compare) ApplyChangeset(changeset string) (e error)
- func (c *Compare) CompareSchema(schemaFile string) (sql string, e error)
- func (c *Compare) ExportSchemaToSQL() (sql string, e error)
- func (c *Compare) ImportSchema(fileName string) (e error)
- func (c *Compare) SetOptions(options lib.Options)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Compare ¶
type Compare struct { 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 Databases map[string]*lib.Database // A map of databases // contains filtered or unexported fields }
func NewCompare ¶
func NewCompare(config *lib.Config, options lib.Options, connector lib.IConnector) (compare *Compare, e error)
NewCompare creates a new Compare instance
func (*Compare) ApplyChangeset ¶
ApplyChangeset runs the sql produced by the `CompareSchema` command against the target database @command compare [reverse] apply
func (*Compare) CompareSchema ¶
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 ¶
ExportSchemaToSQL exports the current schema to sql
func (*Compare) ImportSchema ¶
ImportSchema calles `FetchSchema` and then marshal's it into a JSON object, writing it to the default schema.json file @command import
func (*Compare) SetOptions ¶ added in v1.5.0
SetOptions sets the options