Documentation ¶
Index ¶
- func MapCurrent(v map[string]interface{}) interface{}
- func MapKey(v map[string]interface{}) string
- type ActiveRecord
- func (ar *ActiveRecord) Cache(key string, seconds uint) *ActiveRecord
- func (ar *ActiveRecord) Delete(table string, where map[string]interface{}) *ActiveRecord
- func (ar *ActiveRecord) From(from string) *ActiveRecord
- func (ar *ActiveRecord) FromAs(from, as string) *ActiveRecord
- func (ar *ActiveRecord) GroupBy(column string) *ActiveRecord
- func (ar *ActiveRecord) Having(having string) *ActiveRecord
- func (ar *ActiveRecord) HavingWrap(having, leftWrap, rightWrap string) *ActiveRecord
- func (ar *ActiveRecord) Insert(table string, data map[string]interface{}) *ActiveRecord
- func (ar *ActiveRecord) InsertBatch(table string, data []map[string]interface{}) *ActiveRecord
- func (ar *ActiveRecord) Join(table, as, on, type_ string) *ActiveRecord
- func (ar *ActiveRecord) Limit(limit ...int) *ActiveRecord
- func (ar *ActiveRecord) OrderBy(column, type_ string) *ActiveRecord
- func (ar *ActiveRecord) Raw(sql string, values ...interface{}) *ActiveRecord
- func (ar *ActiveRecord) Replace(table string, data map[string]interface{}) *ActiveRecord
- func (ar *ActiveRecord) ReplaceBatch(table string, data []map[string]interface{}) *ActiveRecord
- func (ar *ActiveRecord) Reset()
- func (ar *ActiveRecord) SQL() string
- func (ar *ActiveRecord) Select(columns string) *ActiveRecord
- func (ar *ActiveRecord) SelectNoWrap(columns string) *ActiveRecord
- func (ar *ActiveRecord) Set(column string, value interface{}) *ActiveRecord
- func (ar *ActiveRecord) SetNoWrap(column string, value interface{}) *ActiveRecord
- func (ar *ActiveRecord) Update(table string, data, where map[string]interface{}) *ActiveRecord
- func (ar *ActiveRecord) UpdateBatch(table string, values []map[string]interface{}, whereColumn []string) *ActiveRecord
- func (ar *ActiveRecord) Values() []interface{}
- func (ar *ActiveRecord) Where(where map[string]interface{}) *ActiveRecord
- func (ar *ActiveRecord) WhereWrap(where map[string]interface{}, leftWrap, rightWrap string) *ActiveRecord
- func (ar *ActiveRecord) Wrap(v string) string
- type Cache
- type DB
- func (db *DB) AR() (ar *ActiveRecord)
- func (db *DB) Begin(config DBConfig) (tx *sql.Tx, err error)
- func (db *DB) Exec(ar *ActiveRecord) (rs *ResultSet, err error)
- func (db *DB) ExecSQL(sqlStr string, values ...interface{}) (rs *ResultSet, err error)
- func (db *DB) ExecSQLTx(sqlStr string, tx *sql.Tx, values ...interface{}) (rs *ResultSet, err error)
- func (db *DB) ExecTx(ar *ActiveRecord, tx *sql.Tx) (rs *ResultSet, err error)
- func (db *DB) Query(ar *ActiveRecord) (rs *ResultSet, err error)
- type DBConfig
- type DBGroup
- type ResultSet
- func (rs *ResultSet) Len() int
- func (rs *ResultSet) MapRows(keyColumn string) (rowsMap map[string]map[string]string)
- func (rs *ResultSet) MapStructs(keyColumn string, strucT interface{}) (structsMap map[string]interface{}, err error)
- func (rs *ResultSet) MapValues(keyColumn, valueColumn string) (values map[string]string)
- func (rs *ResultSet) Row() (row map[string]string)
- func (rs *ResultSet) Rows() (rows []map[string]string)
- func (rs *ResultSet) Struct(strucT interface{}) (Struct interface{}, err error)
- func (rs *ResultSet) Structs(strucT interface{}) (structs []interface{}, err error)
- func (rs *ResultSet) Value(column string) (value string)
- func (rs *ResultSet) Values(column string) (values []string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MapCurrent ¶
func MapCurrent(v map[string]interface{}) interface{}
Types ¶
type ActiveRecord ¶
type ActiveRecord struct {
// contains filtered or unexported fields
}
func (*ActiveRecord) Cache ¶
func (ar *ActiveRecord) Cache(key string, seconds uint) *ActiveRecord
func (*ActiveRecord) Delete ¶
func (ar *ActiveRecord) Delete(table string, where map[string]interface{}) *ActiveRecord
func (*ActiveRecord) From ¶
func (ar *ActiveRecord) From(from string) *ActiveRecord
func (*ActiveRecord) FromAs ¶
func (ar *ActiveRecord) FromAs(from, as string) *ActiveRecord
func (*ActiveRecord) GroupBy ¶
func (ar *ActiveRecord) GroupBy(column string) *ActiveRecord
func (*ActiveRecord) Having ¶
func (ar *ActiveRecord) Having(having string) *ActiveRecord
func (*ActiveRecord) HavingWrap ¶
func (ar *ActiveRecord) HavingWrap(having, leftWrap, rightWrap string) *ActiveRecord
func (*ActiveRecord) Insert ¶
func (ar *ActiveRecord) Insert(table string, data map[string]interface{}) *ActiveRecord
func (*ActiveRecord) InsertBatch ¶
func (ar *ActiveRecord) InsertBatch(table string, data []map[string]interface{}) *ActiveRecord
func (*ActiveRecord) Join ¶
func (ar *ActiveRecord) Join(table, as, on, type_ string) *ActiveRecord
func (*ActiveRecord) Limit ¶
func (ar *ActiveRecord) Limit(limit ...int) *ActiveRecord
Limit Limit(offset,count) or Limit(count)
func (*ActiveRecord) OrderBy ¶
func (ar *ActiveRecord) OrderBy(column, type_ string) *ActiveRecord
func (*ActiveRecord) Raw ¶
func (ar *ActiveRecord) Raw(sql string, values ...interface{}) *ActiveRecord
func (*ActiveRecord) Replace ¶
func (ar *ActiveRecord) Replace(table string, data map[string]interface{}) *ActiveRecord
func (*ActiveRecord) ReplaceBatch ¶
func (ar *ActiveRecord) ReplaceBatch(table string, data []map[string]interface{}) *ActiveRecord
func (*ActiveRecord) Reset ¶
func (ar *ActiveRecord) Reset()
func (*ActiveRecord) SQL ¶
func (ar *ActiveRecord) SQL() string
func (*ActiveRecord) Select ¶
func (ar *ActiveRecord) Select(columns string) *ActiveRecord
func (*ActiveRecord) SelectNoWrap ¶
func (ar *ActiveRecord) SelectNoWrap(columns string) *ActiveRecord
func (*ActiveRecord) Set ¶
func (ar *ActiveRecord) Set(column string, value interface{}) *ActiveRecord
func (*ActiveRecord) SetNoWrap ¶
func (ar *ActiveRecord) SetNoWrap(column string, value interface{}) *ActiveRecord
func (*ActiveRecord) Update ¶
func (ar *ActiveRecord) Update(table string, data, where map[string]interface{}) *ActiveRecord
func (*ActiveRecord) UpdateBatch ¶
func (ar *ActiveRecord) UpdateBatch(table string, values []map[string]interface{}, whereColumn []string) *ActiveRecord
func (*ActiveRecord) Values ¶
func (ar *ActiveRecord) Values() []interface{}
func (*ActiveRecord) Where ¶
func (ar *ActiveRecord) Where(where map[string]interface{}) *ActiveRecord
func (*ActiveRecord) WhereWrap ¶
func (ar *ActiveRecord) WhereWrap(where map[string]interface{}, leftWrap, rightWrap string) *ActiveRecord
func (*ActiveRecord) Wrap ¶
func (ar *ActiveRecord) Wrap(v string) string
type DB ¶
func (*DB) AR ¶
func (db *DB) AR() (ar *ActiveRecord)
type DBConfig ¶
type DBConfig struct { Charset string Collate string Database string Host string Port int Username string Password string TablePrefix string TablePrefixSqlIdentifier string Timeout int ReadTimeout int WriteTimeout int MaxIdleConns int MaxOpenConns int ConnMaxLifetimeSeconds int Cache Cache }
func NewDBConfig ¶
func NewDBConfig() DBConfig
type DBGroup ¶
type DBGroup struct {
// contains filtered or unexported fields
}
func NewDBGroup ¶
func NewDBGroupCache ¶
Click to show internal directories.
Click to hide internal directories.