source

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateJSONFile

func GenerateJSONFile(columns []string, data [][]interface{}) (string, int, error)

Types

type Source

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

func NewSource

func NewSource(cfg *config.Config) (*Source, error)

func (*Source) DeleteAfterSync

func (s *Source) DeleteAfterSync() error

func (*Source) GerMinMaxSplitKey

func (s *Source) GerMinMaxSplitKey() (int, int, error)

func (*Source) GetBatchNum

func (s *Source) GetBatchNum(rows *sql.Rows) (int, int)

GetBatchNum returns the number of batches to be processed

func (*Source) GetRows

func (s *Source) GetRows(conditionSql string) (*sql.Rows, error)

func (*Source) GetSourceReadRowsCount

func (s *Source) GetSourceReadRowsCount() (int, error)

func (*Source) QueryTableData

func (s *Source) QueryTableData(rows *sql.Rows) ([][]interface{}, []string, error)

func (*Source) SplitCondition

func (s *Source) SplitCondition(minSplitKey, maxSplitKey int) []string

type Sourcer

type Sourcer interface {
	QueryTableData(rows *sql.Rows) ([][]interface{}, []string, error)
	GetBatchNum(rows *sql.Rows) (int, int)
	GetRows(conditionSql string) (*sql.Rows, error)
}

Jump to

Keyboard shortcuts

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