differ

package
v0.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RowsToPrimaryKeyMap

func RowsToPrimaryKeyMap(schema *datasource.Schema, rows []*datasource.Row) (map[string]*datasource.Row, error)

Types

type Diff

type Diff struct {
	Schema      *datasource.Schema `json:"schema"`
	DiffColumns *DiffColumns       `json:"diff_columns"`
	DiffRows    *DiffRows          `json:"diff_rows"`
}

func (*Diff) ExportJSON

func (d *Diff) ExportJSON() ([]byte, error)

func (*Diff) ExportPrettyJSON

func (d *Diff) ExportPrettyJSON() ([]byte, error)

func (*Diff) ExportSQL

func (d *Diff) ExportSQL() ([]byte, error)

func (*Diff) HasDiff added in v0.0.2

func (d *Diff) HasDiff() bool

type DiffColumns

type DiffColumns struct {
	Left  []*datasource.Column `json:"left"`
	Right []*datasource.Column `json:"right"`
}

func (*DiffColumns) HasDiff added in v0.0.2

func (dc *DiffColumns) HasDiff() bool

type DiffRows

type DiffRows struct {
	Left  []*datasource.Row `json:"left"`
	Right []*datasource.Row `json:"right"`
}

func (*DiffRows) HasDiff added in v0.0.2

func (dr *DiffRows) HasDiff() bool

type Differ

type Differ struct {
	// contains filtered or unexported fields
}

func NewDiffer

func NewDiffer(opts ...Option) (*Differ, error)

func (*Differ) DiffColumns

func (d *Differ) DiffColumns(left, right *datasource.Schema) (*DiffColumns, error)

func (*Differ) DiffRows

func (d *Differ) DiffRows(schema *datasource.Schema, leftRows, rightRows []*datasource.Row) (*DiffRows, error)

func (*Differ) IsSameRow

func (d *Differ) IsSameRow(left, right *datasource.Row) (bool, error)

func (*Differ) SetIgnoreColumnName added in v0.0.2

func (d *Differ) SetIgnoreColumnName(name string) error

func (*Differ) ValueEqual

func (d *Differ) ValueEqual(lv, rv *datasource.GenericColumnValue) (bool, error)

type Option added in v0.0.2

type Option func(*Differ) error

func IgnoreColumn added in v0.0.2

func IgnoreColumn(name string) Option

type ValueComparator

type ValueComparator interface {
	Equal(col *datasource.Column, v1, v2 *datasource.GenericColumnValue) (bool, error)
}

Jump to

Keyboard shortcuts

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