package
1.0.0
Repository: https://github.com/eopenio/idump.git
Documentation: pkg.go.dev

# Functions

AddCounter adds a counter.
AddGauge adds a gauge.
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.
GetColumnTypes gets *sql.ColumnTypes from a specified table.
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.
InitMetricsVector inits metrics vectors.
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.
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.
NewTaskDatabaseMeta returns a new dumping database 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.
ParseOutputFileTemplate parses template from the specified text.
ParseServerInfo parses exported server type and version info from version string.
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.
RegisterMetrics registers metrics.
RemoveLabelValuesWithTaskInMetrics removes metrics of specified labels.
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).
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

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.
ServerTypeAll represents All server types.
ServerTypeMariaDB represents MariaDB server type.
ServerTypeMySQL represents MySQL server type.
ServerTypeTiDB represents TiDB server type.
ServerTypeUnknown represents unknown server type.
TableTypeBase represents the basic table.
TableTypeBaseStr represents the basic 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.
ServerInfoUnknown is the unknown database type to dumpling.

# Structs

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.
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.
ServerInfo is the combination of ServerType and ServerInfo.
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.
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 metadata, table data.

# Type aliases

DatabaseTables is the type that represents tables in a database.
FileFormat is the format that output to file.
ServerType represents the type of database to export.
TableType represents the type of table.