Documentation ¶
Index ¶
- Constants
- func DB(id ...string) gcore.Database
- func Init(cfg0 gcore.Config) (err error)
- func InitFromFile(cfgFile string) (err error)
- type M
- type Model
- func (s *Model) Count(where gmap.M) (count int64, error error)
- func (s *Model) DeleteBy(where map[string]interface{}) (cnt int64, err error)
- func (s *Model) DeleteByIDs(ids []string) (cnt int64, err error)
- func (s *Model) ExecSQL(sql string, values ...interface{}) (lastInsertID, rowsAffected int64, error error)
- func (s *Model) GetAll(orderBy ...string) (ret []map[string]string, error error)
- func (s *Model) GetAllRs(orderBy ...string) (rs gcore.ResultSet, error error)
- func (s *Model) GetAllWithFields(fields string, orderBy ...string) (ret []map[string]string, error error)
- func (s *Model) GetAllWithFieldsRs(fields string, orderBy ...string) (rs gcore.ResultSet, error error)
- func (s *Model) GetBy(where map[string]interface{}) (ret map[string]string, error error)
- func (s *Model) GetByID(id string) (ret map[string]string, error error)
- func (s *Model) GetByIDWithFields(fields string, id string) (ret map[string]string, error error)
- func (s *Model) GetByWithFields(fields string, where map[string]interface{}) (ret map[string]string, error error)
- func (s *Model) Insert(data map[string]interface{}) (lastInsertID int64, err error)
- func (s *Model) InsertBatch(data []map[string]interface{}) (cnt, lastInsertID int64, err error)
- func (s *Model) List(where map[string]interface{}, offset, length int, orderBy ...string) (ret []map[string]string, err error)
- func (s *Model) ListWithFields(fields string, where map[string]interface{}, offset, length int, ...) (ret []map[string]string, err error)
- func (s *Model) MGetBy(where map[string]interface{}, orderBy ...string) (ret []map[string]string, error error)
- func (s *Model) MGetByIDs(ids []string, orderBy ...string) (ret []map[string]string, error error)
- func (s *Model) MGetByIDsRs(ids []string, orderBy ...string) (rs gcore.ResultSet, error error)
- func (s *Model) MGetByIDsWithFields(fields string, ids []string, orderBy ...string) (ret []map[string]string, err error)
- func (s *Model) MGetByIDsWithFieldsRs(fields string, ids []string, orderBy ...string) (rs gcore.ResultSet, err error)
- func (s *Model) MGetByRs(where map[string]interface{}, orderBy ...string) (rs gcore.ResultSet, error error)
- func (s *Model) MGetByWithFields(fields string, where map[string]interface{}, orderBy ...string) (ret []map[string]string, err error)
- func (s *Model) MGetByWithFieldsRs(fields string, where map[string]interface{}, orderBy ...string) (rs gcore.ResultSet, err error)
- func (s *Model) OrderBy(ar gcore.ActiveRecord, orderBy ...string) (ret [][]string)
- func (s *Model) Page(where map[string]interface{}, offset, length int, orderBy ...string) (ret []map[string]string, total int, err error)
- func (s *Model) PageWithFields(fields string, where map[string]interface{}, offset, length int, ...) (ret []map[string]string, total int, err error)
- func (s *Model) PrimaryKey() string
- func (s *Model) QuerySQL(sql string, values ...interface{}) (ret []map[string]string, error error)
- func (s *Model) SetPrimaryKey(primaryKey string) *Model
- func (s *Model) UpdateBy(where, data map[string]interface{}) (cnt int64, err error)
- func (s *Model) UpdateByIDs(ids []string, data map[string]interface{}) (cnt int64, err error)
- type MySQLActiveRecord
- func (ar *MySQLActiveRecord) Cache(key string, seconds uint) gcore.ActiveRecord
- func (ar *MySQLActiveRecord) Delete(table string, where gmap.M) gcore.ActiveRecord
- func (ar *MySQLActiveRecord) From(from string) gcore.ActiveRecord
- func (ar *MySQLActiveRecord) FromAs(from, as string) gcore.ActiveRecord
- func (ar *MySQLActiveRecord) GetValues() []interface{}
- func (ar *MySQLActiveRecord) GroupBy(column string) gcore.ActiveRecord
- func (ar *MySQLActiveRecord) Having(having string) gcore.ActiveRecord
- func (ar *MySQLActiveRecord) HavingWrap(having, leftWrap, rightWrap string) gcore.ActiveRecord
- func (ar *MySQLActiveRecord) Insert(table string, data gmap.M) gcore.ActiveRecord
- func (ar *MySQLActiveRecord) InsertBatch(table string, data []gmap.M) gcore.ActiveRecord
- func (ar *MySQLActiveRecord) Join(table, as, on, typ string) gcore.ActiveRecord
- func (ar *MySQLActiveRecord) Limit(limit ...int) gcore.ActiveRecord
- func (ar *MySQLActiveRecord) OrderBy(column, typ string) gcore.ActiveRecord
- func (ar *MySQLActiveRecord) Raw(sql string, values ...interface{}) gcore.ActiveRecord
- func (ar *MySQLActiveRecord) Replace(table string, data gmap.M) gcore.ActiveRecord
- func (ar *MySQLActiveRecord) ReplaceBatch(table string, data []gmap.M) gcore.ActiveRecord
- func (ar *MySQLActiveRecord) Reset()
- func (ar *MySQLActiveRecord) SQL() string
- func (ar *MySQLActiveRecord) Select(columns string) gcore.ActiveRecord
- func (ar *MySQLActiveRecord) SelectNoWrap(columns string) gcore.ActiveRecord
- func (ar *MySQLActiveRecord) Set(column string, value interface{}) gcore.ActiveRecord
- func (ar *MySQLActiveRecord) SetNoWrap(column string, value interface{}) gcore.ActiveRecord
- func (ar *MySQLActiveRecord) Update(table string, data, where gmap.M) gcore.ActiveRecord
- func (ar *MySQLActiveRecord) UpdateBatch(table string, values []gmap.M, whereColumn []string) gcore.ActiveRecord
- func (ar *MySQLActiveRecord) Values() []interface{}
- func (ar *MySQLActiveRecord) Where(where gmap.M) gcore.ActiveRecord
- func (ar *MySQLActiveRecord) WhereRaw(where string) gcore.ActiveRecord
- func (ar *MySQLActiveRecord) WhereWrap(where gmap.M, leftWrap, rightWrap string) gcore.ActiveRecord
- func (ar *MySQLActiveRecord) Wrap(v string) string
- type MySQLDB
- func (db *MySQLDB) AR() (ar gcore.ActiveRecord)
- func (db *MySQLDB) Begin() (tx *sql.Tx, err error)
- func (db *MySQLDB) Exec(ar gcore.ActiveRecord) (rs gcore.ResultSet, err error)
- func (db *MySQLDB) ExecSQL(sqlStr string, values ...interface{}) (rs gcore.ResultSet, err error)
- func (db *MySQLDB) ExecSQLTx(tx *sql.Tx, sqlStr string, values ...interface{}) (rs gcore.ResultSet, err error)
- func (db *MySQLDB) ExecTx(ar0 gcore.ActiveRecord, tx *sql.Tx) (rs gcore.ResultSet, err error)
- func (db *MySQLDB) Query(ar0 gcore.ActiveRecord) (rs gcore.ResultSet, err error)
- func (db *MySQLDB) QuerySQL(sqlStr string, values ...interface{}) (rs gcore.ResultSet, err error)
- func (db *MySQLDB) Stats() sql.DBStats
- type MySQLDBConfig
- type MySQLDBGroup
- type ResultSet
- func (rs *ResultSet) LastInsertID() int64
- 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{}, tagName ...string) (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) RowsAffected() int64
- func (rs *ResultSet) SQL() string
- func (rs *ResultSet) Struct(strucT interface{}, tagName ...string) (Struct interface{}, err error)
- func (rs *ResultSet) Structs(strucT interface{}, tagName ...string) (structs []interface{}, err error)
- func (rs *ResultSet) TimeUsed() time.Duration
- func (rs *ResultSet) Value(column string) (value string)
- func (rs *ResultSet) Values(column string) (values []string)
- type SQLite3ActiveRecord
- func (ar *SQLite3ActiveRecord) Cache(key string, seconds uint) gcore.ActiveRecord
- func (ar *SQLite3ActiveRecord) Delete(table string, where gmap.M) gcore.ActiveRecord
- func (ar *SQLite3ActiveRecord) From(from string) gcore.ActiveRecord
- func (ar *SQLite3ActiveRecord) FromAs(from, as string) gcore.ActiveRecord
- func (ar *SQLite3ActiveRecord) GetValues() []interface{}
- func (ar *SQLite3ActiveRecord) GroupBy(column string) gcore.ActiveRecord
- func (ar *SQLite3ActiveRecord) Having(having string) gcore.ActiveRecord
- func (ar *SQLite3ActiveRecord) HavingWrap(having, leftWrap, rightWrap string) gcore.ActiveRecord
- func (ar *SQLite3ActiveRecord) Insert(table string, data gmap.M) gcore.ActiveRecord
- func (ar *SQLite3ActiveRecord) InsertBatch(table string, data []gmap.M) gcore.ActiveRecord
- func (ar *SQLite3ActiveRecord) Join(table, as, on, typ string) gcore.ActiveRecord
- func (ar *SQLite3ActiveRecord) Limit(limit ...int) gcore.ActiveRecord
- func (ar *SQLite3ActiveRecord) OrderBy(column, typ string) gcore.ActiveRecord
- func (ar *SQLite3ActiveRecord) Raw(sql string, values ...interface{}) gcore.ActiveRecord
- func (ar *SQLite3ActiveRecord) Replace(table string, data gmap.M) gcore.ActiveRecord
- func (ar *SQLite3ActiveRecord) ReplaceBatch(table string, data []gmap.M) gcore.ActiveRecord
- func (ar *SQLite3ActiveRecord) Reset()
- func (ar *SQLite3ActiveRecord) SQL() string
- func (ar *SQLite3ActiveRecord) Select(columns string) gcore.ActiveRecord
- func (ar *SQLite3ActiveRecord) SelectNoWrap(columns string) gcore.ActiveRecord
- func (ar *SQLite3ActiveRecord) Set(column string, value interface{}) gcore.ActiveRecord
- func (ar *SQLite3ActiveRecord) SetNoWrap(column string, value interface{}) gcore.ActiveRecord
- func (ar *SQLite3ActiveRecord) Update(table string, data, where gmap.M) gcore.ActiveRecord
- func (ar *SQLite3ActiveRecord) UpdateBatch(table string, values []gmap.M, whereColumn []string) gcore.ActiveRecord
- func (ar *SQLite3ActiveRecord) Values() []interface{}
- func (ar *SQLite3ActiveRecord) Where(where gmap.M) gcore.ActiveRecord
- func (ar *SQLite3ActiveRecord) WhereRaw(where string) gcore.ActiveRecord
- func (ar *SQLite3ActiveRecord) WhereWrap(where gmap.M, leftWrap, rightWrap string) gcore.ActiveRecord
- func (ar *SQLite3ActiveRecord) Wrap(v string) string
- type SQLite3DB
- func (db *SQLite3DB) AR() gcore.ActiveRecord
- func (db *SQLite3DB) Begin() (tx *sql.Tx, err error)
- func (db *SQLite3DB) Exec(ar0 gcore.ActiveRecord) (rs gcore.ResultSet, err error)
- func (db *SQLite3DB) ExecSQL(sqlStr string, values ...interface{}) (rs gcore.ResultSet, err error)
- func (db *SQLite3DB) ExecSQLTx(tx *sql.Tx, sqlStr string, values ...interface{}) (rs gcore.ResultSet, err error)
- func (db *SQLite3DB) ExecTx(ar0 gcore.ActiveRecord, tx *sql.Tx) (rs gcore.ResultSet, err error)
- func (db *SQLite3DB) Query(ar0 gcore.ActiveRecord) (rs gcore.ResultSet, err error)
- func (db *SQLite3DB) QuerySQL(sqlStr string, values ...interface{}) (rs gcore.ResultSet, err error)
- func (db *SQLite3DB) Stats() sql.DBStats
- type SQLite3DBConfig
- type SQLite3DBGroup
Constants ¶
View Source
const ( OpenModeReadOnly = "ro" OpenModeReadWrite = "rw" OpenModeReadWriteCreate = "rwc" OpenModeMemory = "memory" CacheModePrivate = "private" SyncModeOff = 0 SyncModeNormal = 1 SyncModeFull = 2 SyncModeExtra = 3 )
Variables ¶
This section is empty.
Functions ¶
func Init ¶
func Init(cfg0 gcore.Config) (err error)
Init parse app.toml database configuration, `cfg` is Config object of app.toml
func InitFromFile ¶
InitFromFile parse foo.toml database configuration, `cfg` is Config object of foo.toml
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func (*Model) GetAllWithFields ¶
func (*Model) GetAllWithFieldsRs ¶
func (*Model) GetByIDWithFields ¶
func (*Model) GetByWithFields ¶
func (*Model) InsertBatch ¶
func (*Model) ListWithFields ¶
func (*Model) MGetByIDsRs ¶
func (*Model) MGetByIDsWithFields ¶
func (*Model) MGetByIDsWithFieldsRs ¶
func (*Model) MGetByWithFields ¶
func (*Model) MGetByWithFieldsRs ¶
func (*Model) PageWithFields ¶
func (*Model) PrimaryKey ¶
func (*Model) SetPrimaryKey ¶
type MySQLActiveRecord ¶
type MySQLActiveRecord struct {
// contains filtered or unexported fields
}
func (*MySQLActiveRecord) Cache ¶
func (ar *MySQLActiveRecord) Cache(key string, seconds uint) gcore.ActiveRecord
func (*MySQLActiveRecord) Delete ¶
func (ar *MySQLActiveRecord) Delete(table string, where gmap.M) gcore.ActiveRecord
func (*MySQLActiveRecord) From ¶
func (ar *MySQLActiveRecord) From(from string) gcore.ActiveRecord
func (*MySQLActiveRecord) FromAs ¶
func (ar *MySQLActiveRecord) FromAs(from, as string) gcore.ActiveRecord
func (*MySQLActiveRecord) GetValues ¶
func (ar *MySQLActiveRecord) GetValues() []interface{}
func (*MySQLActiveRecord) GroupBy ¶
func (ar *MySQLActiveRecord) GroupBy(column string) gcore.ActiveRecord
func (*MySQLActiveRecord) Having ¶
func (ar *MySQLActiveRecord) Having(having string) gcore.ActiveRecord
func (*MySQLActiveRecord) HavingWrap ¶
func (ar *MySQLActiveRecord) HavingWrap(having, leftWrap, rightWrap string) gcore.ActiveRecord
func (*MySQLActiveRecord) Insert ¶
func (ar *MySQLActiveRecord) Insert(table string, data gmap.M) gcore.ActiveRecord
func (*MySQLActiveRecord) InsertBatch ¶
func (ar *MySQLActiveRecord) InsertBatch(table string, data []gmap.M) gcore.ActiveRecord
func (*MySQLActiveRecord) Join ¶
func (ar *MySQLActiveRecord) Join(table, as, on, typ string) gcore.ActiveRecord
func (*MySQLActiveRecord) Limit ¶
func (ar *MySQLActiveRecord) Limit(limit ...int) gcore.ActiveRecord
Limit Limit(offset,count) or Limit(count)
func (*MySQLActiveRecord) OrderBy ¶
func (ar *MySQLActiveRecord) OrderBy(column, typ string) gcore.ActiveRecord
func (*MySQLActiveRecord) Raw ¶
func (ar *MySQLActiveRecord) Raw(sql string, values ...interface{}) gcore.ActiveRecord
func (*MySQLActiveRecord) Replace ¶
func (ar *MySQLActiveRecord) Replace(table string, data gmap.M) gcore.ActiveRecord
func (*MySQLActiveRecord) ReplaceBatch ¶
func (ar *MySQLActiveRecord) ReplaceBatch(table string, data []gmap.M) gcore.ActiveRecord
func (*MySQLActiveRecord) Reset ¶
func (ar *MySQLActiveRecord) Reset()
func (*MySQLActiveRecord) SQL ¶
func (ar *MySQLActiveRecord) SQL() string
func (*MySQLActiveRecord) Select ¶
func (ar *MySQLActiveRecord) Select(columns string) gcore.ActiveRecord
func (*MySQLActiveRecord) SelectNoWrap ¶
func (ar *MySQLActiveRecord) SelectNoWrap(columns string) gcore.ActiveRecord
func (*MySQLActiveRecord) Set ¶
func (ar *MySQLActiveRecord) Set(column string, value interface{}) gcore.ActiveRecord
func (*MySQLActiveRecord) SetNoWrap ¶
func (ar *MySQLActiveRecord) SetNoWrap(column string, value interface{}) gcore.ActiveRecord
func (*MySQLActiveRecord) Update ¶
func (ar *MySQLActiveRecord) Update(table string, data, where gmap.M) gcore.ActiveRecord
func (*MySQLActiveRecord) UpdateBatch ¶
func (ar *MySQLActiveRecord) UpdateBatch(table string, values []gmap.M, whereColumn []string) gcore.ActiveRecord
func (*MySQLActiveRecord) Values ¶
func (ar *MySQLActiveRecord) Values() []interface{}
func (*MySQLActiveRecord) Where ¶
func (ar *MySQLActiveRecord) Where(where gmap.M) gcore.ActiveRecord
func (*MySQLActiveRecord) WhereRaw ¶
func (ar *MySQLActiveRecord) WhereRaw(where string) gcore.ActiveRecord
func (*MySQLActiveRecord) WhereWrap ¶
func (ar *MySQLActiveRecord) WhereWrap(where gmap.M, leftWrap, rightWrap string) gcore.ActiveRecord
func (*MySQLActiveRecord) Wrap ¶
func (ar *MySQLActiveRecord) Wrap(v string) string
type MySQLDB ¶
type MySQLDB struct { Config MySQLDBConfig ConnPool *sql.DB DSN string }
func NewMySQLDB ¶
func NewMySQLDB(config MySQLDBConfig) (db *MySQLDB, err error)
type MySQLDBConfig ¶
type MySQLDBConfig 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 Cache gcore.DBCache }
func NewMySQLDBConfig ¶
func NewMySQLDBConfig() MySQLDBConfig
func NewMySQLDBConfigWith ¶
func NewMySQLDBConfigWith(host string, port int, dbName, user, pass string) (cfg MySQLDBConfig)
type MySQLDBGroup ¶
type MySQLDBGroup struct {
// contains filtered or unexported fields
}
func NewMySQLDBGroup ¶
func NewMySQLDBGroup(defaultConfigName string) (group *MySQLDBGroup)
func NewMySQLDBGroupCache ¶
func NewMySQLDBGroupCache(defaultConfigName string, cache gcore.DBCache) (group *MySQLDBGroup)
func (*MySQLDBGroup) DB ¶
func (g *MySQLDBGroup) DB(name ...string) (db gcore.Database)
func (*MySQLDBGroup) Regist ¶
func (g *MySQLDBGroup) Regist(name string, cfgI interface{}) (err error)
func (*MySQLDBGroup) RegistGroup ¶
func (g *MySQLDBGroup) RegistGroup(cfg interface{}) (err error)
type ResultSet ¶
type ResultSet struct {
// contains filtered or unexported fields
}
func NewResultSet ¶
func (*ResultSet) LastInsertID ¶
func (*ResultSet) MapStructs ¶
func (*ResultSet) RowsAffected ¶
type SQLite3ActiveRecord ¶
type SQLite3ActiveRecord struct {
// contains filtered or unexported fields
}
func (*SQLite3ActiveRecord) Cache ¶
func (ar *SQLite3ActiveRecord) Cache(key string, seconds uint) gcore.ActiveRecord
func (*SQLite3ActiveRecord) Delete ¶
func (ar *SQLite3ActiveRecord) Delete(table string, where gmap.M) gcore.ActiveRecord
func (*SQLite3ActiveRecord) From ¶
func (ar *SQLite3ActiveRecord) From(from string) gcore.ActiveRecord
func (*SQLite3ActiveRecord) FromAs ¶
func (ar *SQLite3ActiveRecord) FromAs(from, as string) gcore.ActiveRecord
func (*SQLite3ActiveRecord) GetValues ¶
func (ar *SQLite3ActiveRecord) GetValues() []interface{}
func (*SQLite3ActiveRecord) GroupBy ¶
func (ar *SQLite3ActiveRecord) GroupBy(column string) gcore.ActiveRecord
func (*SQLite3ActiveRecord) Having ¶
func (ar *SQLite3ActiveRecord) Having(having string) gcore.ActiveRecord
func (*SQLite3ActiveRecord) HavingWrap ¶
func (ar *SQLite3ActiveRecord) HavingWrap(having, leftWrap, rightWrap string) gcore.ActiveRecord
func (*SQLite3ActiveRecord) Insert ¶
func (ar *SQLite3ActiveRecord) Insert(table string, data gmap.M) gcore.ActiveRecord
func (*SQLite3ActiveRecord) InsertBatch ¶
func (ar *SQLite3ActiveRecord) InsertBatch(table string, data []gmap.M) gcore.ActiveRecord
func (*SQLite3ActiveRecord) Join ¶
func (ar *SQLite3ActiveRecord) Join(table, as, on, typ string) gcore.ActiveRecord
func (*SQLite3ActiveRecord) Limit ¶
func (ar *SQLite3ActiveRecord) Limit(limit ...int) gcore.ActiveRecord
Limit Limit(offset,count) or Limit(count)
func (*SQLite3ActiveRecord) OrderBy ¶
func (ar *SQLite3ActiveRecord) OrderBy(column, typ string) gcore.ActiveRecord
func (*SQLite3ActiveRecord) Raw ¶
func (ar *SQLite3ActiveRecord) Raw(sql string, values ...interface{}) gcore.ActiveRecord
func (*SQLite3ActiveRecord) Replace ¶
func (ar *SQLite3ActiveRecord) Replace(table string, data gmap.M) gcore.ActiveRecord
func (*SQLite3ActiveRecord) ReplaceBatch ¶
func (ar *SQLite3ActiveRecord) ReplaceBatch(table string, data []gmap.M) gcore.ActiveRecord
func (*SQLite3ActiveRecord) Reset ¶
func (ar *SQLite3ActiveRecord) Reset()
func (*SQLite3ActiveRecord) SQL ¶
func (ar *SQLite3ActiveRecord) SQL() string
func (*SQLite3ActiveRecord) Select ¶
func (ar *SQLite3ActiveRecord) Select(columns string) gcore.ActiveRecord
func (*SQLite3ActiveRecord) SelectNoWrap ¶
func (ar *SQLite3ActiveRecord) SelectNoWrap(columns string) gcore.ActiveRecord
func (*SQLite3ActiveRecord) Set ¶
func (ar *SQLite3ActiveRecord) Set(column string, value interface{}) gcore.ActiveRecord
func (*SQLite3ActiveRecord) SetNoWrap ¶
func (ar *SQLite3ActiveRecord) SetNoWrap(column string, value interface{}) gcore.ActiveRecord
func (*SQLite3ActiveRecord) Update ¶
func (ar *SQLite3ActiveRecord) Update(table string, data, where gmap.M) gcore.ActiveRecord
func (*SQLite3ActiveRecord) UpdateBatch ¶
func (ar *SQLite3ActiveRecord) UpdateBatch(table string, values []gmap.M, whereColumn []string) gcore.ActiveRecord
func (*SQLite3ActiveRecord) Values ¶
func (ar *SQLite3ActiveRecord) Values() []interface{}
func (*SQLite3ActiveRecord) Where ¶
func (ar *SQLite3ActiveRecord) Where(where gmap.M) gcore.ActiveRecord
func (*SQLite3ActiveRecord) WhereRaw ¶
func (ar *SQLite3ActiveRecord) WhereRaw(where string) gcore.ActiveRecord
func (*SQLite3ActiveRecord) WhereWrap ¶
func (ar *SQLite3ActiveRecord) WhereWrap(where gmap.M, leftWrap, rightWrap string) gcore.ActiveRecord
func (*SQLite3ActiveRecord) Wrap ¶
func (ar *SQLite3ActiveRecord) Wrap(v string) string
type SQLite3DB ¶
type SQLite3DB struct { Config SQLite3DBConfig ConnPool *sql.DB DSN string }
func DBSQLite3 ¶
DBSQLite3 acquires a sqlite3 db object associated the id, id default is : `default`
func NewSQLite3DB ¶
func NewSQLite3DB(config SQLite3DBConfig) (db SQLite3DB, err error)
type SQLite3DBConfig ¶
type SQLite3DBConfig struct { Database string TablePrefix string TablePrefixSQLIdentifier string Cache gcore.DBCache SyncMode int OpenMode string CacheMode string }
func NewSQLite3DBConfig ¶
func NewSQLite3DBConfig() SQLite3DBConfig
func NewSQLite3DBConfigWith ¶
func NewSQLite3DBConfigWith(dbfilename, openMode, cacheMode string, syncMode int) (cfg SQLite3DBConfig)
type SQLite3DBGroup ¶
type SQLite3DBGroup struct {
// contains filtered or unexported fields
}
func NewSQLite3DBGroup ¶
func NewSQLite3DBGroup(defaultConfigName string) (group *SQLite3DBGroup)
func NewSQLite3DBGroupCache ¶
func NewSQLite3DBGroupCache(defaultConfigName string, cache gcore.DBCache) (group *SQLite3DBGroup)
func (*SQLite3DBGroup) DB ¶
func (g *SQLite3DBGroup) DB(name ...string) (db gcore.Database)
func (*SQLite3DBGroup) Regist ¶
func (g *SQLite3DBGroup) Regist(name string, cfgI interface{}) (err error)
func (*SQLite3DBGroup) RegistGroup ¶
func (g *SQLite3DBGroup) RegistGroup(cfg interface{}) (err error)
Click to show internal directories.
Click to hide internal directories.