Versions in this module Expand all Collapse all v1 v1.1.0 Mar 21, 2022 v1.0.0 Feb 10, 2022 Changes in this version + func CountSQL(sql string) string + func CountTable(c sqlx.SqlConn, table string) (int64, error) + func CreateDbIne(dsn string) error + func CreateMysqlIndexes(conn sqlx.SqlConn, db, table string, indexes []string) error + func GenerateSQLInsert(table string, data interface{}) string + func GetLengthTag(field reflect.StructField) (int, error) + func GetMysqlTableComment(source, table string) (string, error) + func MysqlListTable(db *sql.DB) ([]string, error) + func MysqlPing(dsn string) error + func PageSQL(sql string, page, pageSize int) (string, int, int) + func ParseMySQLDatabase(dsn string) (string, string, error) + func TakeMySQLConn(dsn string) (*sql.DB, error) + func TakeMySQLConnx(dsn string) sqlx.SqlConn + func ToClickhouseTable(dsn, db, table, indexes string, withTime bool) ([]string, string, error) + type Column struct + Collation interface{} + Comment string + Default interface{} + Extra string + Field string + Key string + Null string + Privileges string + Type string + func DescribeMysqlTable(conn sqlx.SqlConn, table string) ([]*Column, error) + type Count struct + Count int64 + type MySQLModel struct + AppName string + Conn sqlx.SqlConn + DBs []string + Database string + Dsn string + Indexes []string + MutableFieldDBs []string + MutableFieldNames []string + TableName string + Type reflect.Type + func MustNewMySQLModel(appName, dsn string, data interface{}) (*MySQLModel, bool, error) + func NewMySQLModel(appName, dsn string, data interface{}) (*MySQLModel, bool, error) + func (b *MySQLModel) BatchInsert(vs interface{}) error + func (b *MySQLModel) Count(where string, args ...interface{}) (int64, error) + func (b *MySQLModel) Delete(id interface{}) (int64, error) + func (b *MySQLModel) DeleteWhere(where string, args ...interface{}) (int64, error) + func (b *MySQLModel) Drop() error + func (b *MySQLModel) DropIfExists() error + func (b *MySQLModel) FindBy(field string, fieldValue interface{}) (interface{}, error) + func (b *MySQLModel) FindWhere(where string, args ...interface{}) (interface{}, error) + func (b *MySQLModel) Insert(data interface{}) (int64, error) + func (b *MySQLModel) QueryWhere(where string, args ...interface{}) (interface{}, error) + func (b *MySQLModel) Update(id interface{}, sets string, args ...interface{}) (int64, error) + func (m *MySQLModel) All() (interface{}, error) + func (m *MySQLModel) MustAll() interface{} + func (m *MySQLModel) UpdateWhere(sets, where string, args ...interface{}) (int64, error) + type MysqlTableComment struct + TableComment string