diff

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package diff contains functions to generate SQL statements to migrate an old schema to the new schema

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Files

func Files(dst io.Writer, from, to string, options ...Option) error

Files compares contents of two files and generates a series of statements to migrate from the old one to the new one, writing the result to `dst`

func Sources added in v0.0.7

func Sources(dst io.Writer, from, to schemalex.SchemaSource, options ...Option) error

Files compares contents from two sources and generates a series of statements to migrate from the old one to the new one, writing the result to `dst`

func Statements

func Statements(dst io.Writer, from, to model.Stmts, options ...Option) error

Statements compares two model.Stmts and generates a series of statements to migrate from the old one to the new one, writing the result to `dst`

func Strings

func Strings(dst io.Writer, from, to string, options ...Option) error

Strings compares two strings and generates a series of statements to migrate from the old one to the new one, writing the result to `dst`

Types

type Option

type Option = schemalex.Option

func WithParser

func WithParser(p *schemalex.Parser) Option

WithParser specifies the parser instance to use when parsing the statements given to the diffing functions. If unspecified, a default parser will be used

func WithTransaction

func WithTransaction(b bool) Option

WithTransaction specifies if statements to control transactions should be included in the diff.

Jump to

Keyboard shortcuts

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