tidb

package
v0.0.0-...-fb93fda Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Db *sql.DB // TODO: Maybe find a way not exposing it to public?
}

func NewClient

func NewClient(host string, port int32, user, password string) (Client, error)

func NewClientFromOpts

func NewClientFromOpts(opts TiDBClientOpts) (Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) ExecWithElapsed

func (c *Client) ExecWithElapsed(sql string) error

func (*Client) GetInstances

func (c *Client) GetInstances(selectType string) ([]string, error)

func (*Client) GetTableID

func (c *Client) GetTableID(dbName, tblName string) (int64, error)

type TableRow

type TableRow struct {
	TableID int64
	RowID   int64
	Status  TableRowStatus
}

func NewTableRow

func NewTableRow(tableID, rowID int64) TableRow

func (*TableRow) GetKey

func (r *TableRow) GetKey() TiKVKey

type TableRowStatus

type TableRowStatus int32
const (
	MinInf TableRowStatus = 1
	MaxInf TableRowStatus = 2
)

type TiDBClientOpts

type TiDBClientOpts struct {
	Host     string
	Port     int32
	User     string
	Password string
}

type TiKVKey

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

func FromPDKey

func FromPDKey(k string) (TiKVKey, error)

func NewTableEndAsKey

func NewTableEndAsKey(tableID int64) TiKVKey

func NewTableRowAsKey

func NewTableRowAsKey(tableID, rowID int64) TiKVKey

func NewTableStartAsKey

func NewTableStartAsKey(tableID int64) TiKVKey

func (*TiKVKey) GetBytes

func (k *TiKVKey) GetBytes() []byte

func (*TiKVKey) GetPDKey

func (k *TiKVKey) GetPDKey() string

func (*TiKVKey) GetTableID

func (k *TiKVKey) GetTableID() (int64, error)

func (*TiKVKey) GetTableRow

func (k *TiKVKey) GetTableRow() (TableRow, error)

Jump to

Keyboard shortcuts

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