package
9.0.0-alpha+incompatible
Repository: https://github.com/pingcap/tidb.git
Documentation: pkg.go.dev
# Functions
AddCounter adds a counter.
AddGauge adds a gauge.
CheckTiDBEnableTableLock use sql variable to check whether current TiDB has TiKV.
CheckTiDBWithTiKV use sql to check whether current TiDB has TiKV.
DatabaseTablesToMap transfers DatabaseTables to Map.
DecGauge decs a gauge.
DefaultConfig returns the default export Config for dumpling.
FlushTableWithReadLock flush tables with read lock.
GetCharsetAndDefaultCollation gets charset and default collation map.
GetColumnTypes gets *sql.ColumnTypes from a specified table.
GetConfTables parses tables from tables-list and filter arguments.
GetDBInfo get model.DBInfos from database sql interface.
GetPartitionNames get partition names from a specified table.
GetPartitionTableIDs get partition tableIDs through histograms.
GetPdAddrs gets PD address from TiDB.
GetPrimaryKeyAndColumnTypes gets all primary columns and their types in ordinal order.
GetPrimaryKeyColumns gets all primary columns in ordinal order.
GetRegionInfos get region info including regionID, start key, end key from database sql interface.
GetSpecifiedColumnValueAndClose get columns' values whose name is equal to columnName and close the given rows.
GetSpecifiedColumnValuesAndClose get columns' values whose name is equal to columnName.
GetSuitableRows gets suitable rows for each table.
GetTiDBDDLIDs gets DDL IDs from TiDB.
IncCounter incs a counter.
IncGauge incs a gauge.
ListAllDatabasesTables lists all the databases and tables from the database listTableByInfoSchema list tables by table information_schema in MySQL listTableByShowTableStatus has better performance than listTableByInfoSchema listTableByShowFullTables is used in mysql8 version [8.0.3,8.0.23), more details can be found in the comments of func matchMysqlBugversion.
ListAllPlacementPolicyNames returns all placement policy names.
LockTables locks table with read lock.
MakeRowReceiver constructs RowReceiverArr from column types.
NewConsistencyController returns a new consistency controller.
NewDatabaseTables returns a new DatabaseTables.
NewDumper returns a new Dumper.
NewSpeedRecorder new a SpeedRecorder.
NewTaskDatabaseMeta returns a new dumping database metadata task.
NewTaskPolicyMeta returns a new dumping placement policy metadata task.
NewTaskSequenceMeta returns a new dumping sequence metadata task.
NewTaskTableData returns a new dumping table data task.
NewTaskTableMeta returns a new dumping table metadata task.
NewTaskViewMeta returns a new dumping view metadata task.
NewWriter returns a new Writer with given configurations.
ObserveHistogram observes a histogram.
ParseCompressType parses compressType string to storage.CompressType.
ParseFileSize parses file size from tables-list and filter arguments.
ParseOutputDialect parses output dialect string to Dialect.
ParseOutputFileTemplate parses template from the specified text.
ParseTableFilter parses table filter from tables-list and filter arguments.
ParseTableType parses table type string to TableType.
ReadCounter reports the current value of the counter.
ReadGauge reports the current value of the gauge.
RestoreCharset builds the restore charset SQLs.
SelectAllFromTable dumps data serialized from a specified table.
SelectTiDBRowID checks whether this table has _tidb_rowid column.
SelectVersion gets the version information from the database server.
SetCharset builds the set charset SQLs.
ShowCreateDatabase constructs the create database SQL for a specified database returns (createDatabaseSQL, error).
ShowCreatePlacementPolicy constructs the create policy SQL for a specified table returns (createPolicySQL, error).
ShowCreateSequence constructs the create sequence SQL for a specified sequence returns (createSequenceSQL, error).
ShowCreateTable constructs the create table SQL for a specified table returns (createTableSQL, error).
ShowCreateView constructs the create view SQL for a specified view returns (createFakeTableSQL, createViewSQL, error).
ShowDatabases shows the databases of a database server.
ShowMasterStatus get SHOW MASTER STATUS result from database.
ShowTables shows the tables of a database, the caller should use the correct database.
SQLTypeBytesMaker returns a SQLTypeBytes.
SQLTypeNumberMaker returns a SQLTypeNumber.
SQLTypeStringMaker returns a SQLTypeString.
SubGauge subs a gauge.
UnlockTables unlocks all tables' lock.
WriteInsert writes TableDataIR to a storage.ExternalFileWriter in sql type.
WriteInsertInCsv writes TableDataIR to a storage.ExternalFileWriter in csv type.
WriteMeta writes MetaIR to a storage.ExternalFileWriter.
# Constants
BinaryFormatBase64 format binary data as Base64 string, e.g.
BinaryFormatHEX format binary data as HEX string, e.g.
BinaryFormatUTF8 is the default format, format binary data as UTF8 string.
ConsistencyTypeAuto will use flush for MySQL/MariaDB and snapshot for TiDB.
ConsistencyTypeFlush will use FLUSH TABLES WITH READ LOCK to temporarily interrupt the DML and DDL operations of the replica database, to ensure the global consistency of the backup connection.
ConsistencyTypeLock will add read locks on all tables to be exported.
ConsistencyTypeNone doesn't guarantee for consistency.
ConsistencyTypeSnapshot gets a consistent snapshot of the specified timestamp and exports it.
CSVDialectBigQuery is the dialect of BigQuery.
CSVDialectDefault is the default dialect, which is MySQL/MariaDB/TiDB etc.
CSVDialectRedshift is the dialect of Redshift.
CSVDialectSnowflake is the dialect of Snowflake.
DefaultAnonymousOutputFileTemplateText is the default anonymous output file templateText for dumpling's table data file name.
DefaultStatementSize is the default statement size.
DefaultTableFilter is the default exclude table filter.
ErrNoSuchTable is the error code no such table in MySQL/TiDB.
FileFormatCSV indicates the given file type is csv type.
FileFormatCSVString indicates the string/suffix of csv type file.
FileFormatSQLText indicates the given file type is sql type.
FileFormatSQLTextString indicates the string/suffix of sql type file.
FileFormatUnknown indicates the given file type is unknown.
FlagHelp represents the help flag.
LooseCollationCompatible is used in DM, represents a collation setting for best compatibility.
StrictCollationCompatible is used in DM, represents a collation setting for correctness.
TableTypeBase represents the basic table.
TableTypeBaseStr represents the basic table string.
TableTypeSequence represents the view table TODO: need to be supported.
TableTypeSequenceStr represents the view table string.
TableTypeView represents the view table.
TableTypeViewStr represents the view table string.
TiDBMemQuotaQueryName is the session variable TiDBMemQuotaQuery's name in TiDB.
UnspecifiedSize means the filesize/statement-size is unspecified.
# Variables
DefaultOutputFileTemplate is the default output file template for dumpling's table data file name.
DialectBinaryFormatMap is the map of dialect and binary format.
ServerInfoUnknown is the unknown database type to dumpling.
# Structs
BaseConn wraps connection instance.
Config is the dump config for dumpling.
ConsistencyFlushTableWithReadLock uses FlushTableWithReadLock before the dump.
ConsistencyLockDumpingTables execute lock tables read on all tables before dump.
ConsistencyNone dumps without adding locks, which cannot guarantee consistency.
Dumper is the dump progress structure.
DumpStatus is the status of dumping.
InterceptFileWriter is an interceptor of os.File, tracking whether a StringWriter has written something.
LazyStringWriter is an interceptor of io.StringWriter, will lazily create file the first time StringWriter need to write something.
RowReceiverArr is the combined RowReceiver array.
SpeedRecorder record the finished bytes and calculate its speed.
SQLTypeBytes implements RowReceiverStringer which represents bytes type columns in database.
SQLTypeNumber implements RowReceiverStringer which represents numeric type columns in database.
SQLTypeString implements RowReceiverStringer which represents string type columns in database.
TableInfo is the table info for a table in database.
TaskDatabaseMeta is a dumping database metadata task.
TaskPolicyMeta is a dumping view metadata task.
TaskSequenceMeta is a dumping sequence metadata task.
TaskTableData is a dumping table data task.
TaskTableMeta is a dumping table metadata task.
TaskViewMeta is a dumping view metadata task.
Writer is the abstraction that keep pulling data from database and write to files.
# Interfaces
ConsistencyController is the interface that controls the consistency of exporting progress.
MetaIR is the interface that wraps database/table/view's metadata.
RowReceiver is an interface which represents sql types that support bind address for *sql.Rows.
RowReceiverStringer is a combined interface of RowReceiver and Stringer.
SQLRowIter is the iterator on a collection of sql.Row.
Stringer is an interface which represents sql types that support writing to buffer in sql/csv type.
StringIter is the iterator on a collection of strings.
TableDataIR is table data intermediate representation.
TableMeta contains the meta information of a table.
Task is a file dump task for dumpling, it could either be dumping database/table/view/policy metadata, table data.
# Type aliases
BinaryFormat is the format of binary data Three standard formats are supported: UTF8, HEX and Base64 now.
CSVDialect is the dialect of the CSV output for compatible with different import target.
DatabaseTables is the type that represents tables in a database.
FileFormat is the format that output to file.
TableType represents the type of table.