Documentation ¶
Index ¶
Constants ¶
const WriteModeReplace = "replace"
WriteModeReplace represents the replace into write mode.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { URL string `json:"url"` // Database URL, including the database address and other database parameters Username string `json:"username"` // Username Password string `json:"password"` // Password }
Config is the MySQL configuration, and the reading time needs to be parsed, i.e., parseTime=true
type Dialect ¶
type Dialect struct{}
Dialect represents the database dialect for MySQL
type Field ¶
type Field struct { *database.BaseField database.BaseConfigSetter }
Field Field
type FieldType ¶
type FieldType struct { *database.BaseFieldType // contains filtered or unexported fields }
FieldType Field type
func NewFieldType ¶
func NewFieldType(typ database.ColumnType) *FieldType
NewFieldType Create a new field type
func (*FieldType) IsSupported ¶
IsSupported Whether it supports parsing
type ReplaceParam ¶
ReplaceParam represents the parameters for the replace into operation.
func NewReplaceParam ¶
func NewReplaceParam(t database.Table, txOpts *sql.TxOptions) *ReplaceParam
NewReplaceParam creates replace parameters based on the table and transaction options (txOpts).
type Scanner ¶
type Scanner struct { database.BaseScanner // contains filtered or unexported fields }
Scanner Scanner
func NewScanner ¶
NewScanner Generate a scanner based on the column type
func (*Scanner) Scan ¶
Scan Read data based on the column type MEDIUMINT, INT, BIGINT, SMALLINT, TINYINT, YEAR are treated as integers. DOUBLE, FLOAT, DECIMAL are treated as high-precision real numbers. DATE, DATETIME, TIMESTAMP are treated as time. TEXT, LONGTEXT, MEDIUMTEXT, TINYTEXT, CHAR, VARCHAR, TIME are treated as strings. BLOB, LONGBLOB, MEDIUMBLOB, BINARY, TINYBLOB, VARBINARY are treated as byte streams.
type Source ¶
type Source struct { *database.BaseSource // Basic data source // contains filtered or unexported fields }
Source mysql represents the MySQL data source
func (*Source) ConnectName ¶
ConnectName is the connection information for the MySQL data source using github.com/go-sql-driver/mysql
func (*Source) Connector ¶
Connector is the data source connector for github.com/go-sql-driver/mysql
func (*Source) DriverName ¶
DriverName is the driver name for github.com/go-sql-driver/mysql
type Table ¶
type Table struct { *database.BaseTable database.BaseConfigSetter }
Table represents a MySQL table.
func NewTable ¶
NewTable creates a new MySQL table. Note that at this point, the schema parameter in BaseTable is empty, instance is the database name, and name is the table name.
func (*Table) ExecParam ¶
ExecParam retrieves execution parameters, where the replace into parameter mode has been registered.
func (*Table) ShouldOneByOne ¶
ShouldOneByOne specifies whether to retry one operation at a time.
func (*Table) ShouldRetry ¶
ShouldRetry determines whether a retry is necessary.