Versions in this module Expand all Collapse all v1 v1.0.0 Mar 17, 2021 Changes in this version + const LayoutTime + func CreateIndexes(conn *SqlConn, db, table string, indexes []string) error + func CreateTableIfNotExists(conn *SqlConn, table, sql string) (bool, error) + func GetDBTag(field reflect.StructField) string + func GetDBTagMap(t reflect.Type) map[string]int + func GetLengthTag(field reflect.StructField) (int, error) + func GoTypeToSQLType(t reflect.Type, db string, length int) (string, bool, error) + func ParseMySQLDatabase(dsn string) (string, string, error) + func TableExists(conn *SqlConn, table string) (bool, error) + type BaseMySQLModel struct + AppName string + Columns []string + Conn *SqlConn + Database string + ModifiableDBs []string + ModifiableFields []string + TableName string + Type reflect.Type + func NewBaseMySQLModel(appName string, dsn string, data interface{}) (*BaseMySQLModel, bool, error) + func (b *BaseMySQLModel) Count(where string, args ...interface{}) (int64, error) + func (b *BaseMySQLModel) Delete(id interface{}) (int64, error) + func (b *BaseMySQLModel) FindBy(field string, fieldValue interface{}) (interface{}, error) + func (b *BaseMySQLModel) Insert(data interface{}) error + func (b *BaseMySQLModel) Update(id interface{}, sets string) (int64, error) + type Column struct + Field string + func DescribeTable(conn *SqlConn, table string) ([]*Column, error) + type Count struct + Count int64 + type SqlConn struct + func NewMySQL(dsn string) (*SqlConn, error) + func (s *SqlConn) Exec(query string, args ...interface{}) (sql.Result, error) + func (s *SqlConn) QueryRow(v interface{}, query string, args ...interface{}) error + func (s *SqlConn) QueryRowPartial(v interface{}, query string, args ...interface{}) error + func (s *SqlConn) QueryRows(vs interface{}, query string, args ...interface{}) error + func (s *SqlConn) QueryRowsPartial(vs interface{}, query string, args ...interface{}) error