store

package
v0.0.0-...-840b8dc Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DatabaseDriverPostgres = "postgres"
	DatabaseDriverMysql    = "mysql"
)
View Source
const MySQLChecksumTmpl = `` /* 402-byte string literal not displayed */
View Source
const PostgresChecksumTmpl = `` /* 377-byte string literal not displayed */

The ‘x’ prepended to the hash strings, which tells Postgres to interpret them as hex strings when casting to a number.

Variables

View Source
var (
	ErrEmptyTable = errors.New("the table has no rows to calculate md5")
)

Functions

func Compare

func Compare(srcDSN, dstDSN string, opts CompareOptions) ([]string, error)

Types

type ColumnInfo

type ColumnInfo struct {
	ColumnName string `db:"column_name"`
	DataType   string `db:"data_type"`
}

ColumnInfo is the column info

type CompareOptions

type CompareOptions struct {
	ExcludePatterns []string
	Verbose         bool
	PageSize        int
}

type DB

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

DB is the sql.DB wrapper with some utilities

func NewDB

func NewDB(dsn string) (*DB, error)

NewDB creates a DB instance from the given data source

func (*DB) Close

func (db *DB) Close() error

func (*DB) TableList

func (db *DB) TableList() (map[string]*TableInfo, error)

func (*DB) Version

func (db *DB) Version() (*semver.Version, error)

type TableInfo

type TableInfo struct {
	TableName   string
	PrimaryKeys []string
	Columns     []*ColumnInfo
}

Jump to

Keyboard shortcuts

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