Documentation ¶
Index ¶
- Constants
- 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() (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(tx *sql.Tx, sqlStr string, 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) Init(rawRows *[]map[string][]byte)
- 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 ¶
View Source
const ( OPEN_MODE_READ_ONLY = "ro" OPEN_MODE_READ_WRITE = "rw" OPEN_MODE_READ_WRITE_CREATE = "rwc" OPEN_MODE_MEMORY = "memory" CACHE_MODE_SHARED = "shared" CACHE_MODE_PRIVATE = "private" SYNC_MODE_OFF = 0 SYNC_MODE_NORMAL = 1 SYNC_MODE_FULL = 2 SYNC_MODE_EXTRA = 3 )
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 { Database string TablePrefix string TablePrefixSqlIdentifier string Cache Cache SyncMode int OpenMode string CacheMode string Password string }
func NewDBConfig ¶
func NewDBConfig() DBConfig
func NewDBConfigWith ¶
type DBGroup ¶
type DBGroup struct {
// contains filtered or unexported fields
}
func NewDBGroup ¶
func NewDBGroupCache ¶
Click to show internal directories.
Click to hide internal directories.