tidb

package
v1.1.0-beta.0...-a97aa45 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeRowForRecord

func EncodeRowForRecord(ctx context.Context, encTable table.Table, sqlMode mysql.SQLMode, row []types.Datum, columnPermutation []int) string

EncodeRowForRecord encodes a row to a string compatible with INSERT statements.

func NewEncodingBuilder

func NewEncodingBuilder() encode.EncodingBuilder

NewEncodingBuilder creates an EncodingBuilder with TiDB backend implementation.

func NewTargetInfoGetter

func NewTargetInfoGetter(db *sql.DB) backend.TargetInfoGetter

NewTargetInfoGetter creates an TargetInfoGetter with TiDB backend implementation.

func NewTiDBBackend

func NewTiDBBackend(
	ctx context.Context,
	db *sql.DB,
	cfg *config.Config,
	errorMgr *errormanager.ErrorManager,
) backend.Backend

NewTiDBBackend creates a new TiDB backend using the given database.

The backend does not take ownership of `db`. Caller should close `db` manually after the backend expired.

Types

type TableAutoIDInfo

type TableAutoIDInfo struct {
	Column string
	NextID uint64
	Type   string
}

TableAutoIDInfo is the auto id information of a table.

func FetchTableAutoIDInfos

func FetchTableAutoIDInfos(ctx context.Context, exec dbutil.QueryExecutor, tableName string) ([]*TableAutoIDInfo, error)

FetchTableAutoIDInfos fetches the auto id information of a table.

type Writer

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

Writer is a writer that writes data to local storage.

func (*Writer) AppendRows

func (w *Writer) AppendRows(ctx context.Context, columnNames []string, rows encode.Rows) error

AppendRows implements the EngineWriter interface.

func (*Writer) Close

Close implements the EngineWriter interface.

func (*Writer) IsSynced

func (*Writer) IsSynced() bool

IsSynced implements the EngineWriter interface.

Jump to

Keyboard shortcuts

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