Documentation ¶
Index ¶
- Constants
- Variables
- func JSONString(v interface{}, IndentJSON bool) (string, error)
- func NewDataset(headers []string) *tablib.Dataset
- func NewDatasetWithData(headers []string, data interface{}, mustMatch bool) (*tablib.Dataset, error)
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) []byte
- func ZeroPadding(ciphertext []byte, blockSize int) []byte
- func ZeroUnPadding(origData []byte) []byte
- type AesEncrypt
- type AfterDeleteProcessor
- type AfterInsertProcessor
- type AfterSetProcessor
- type AfterUpdateProcessor
- type BeforeDeleteProcessor
- type BeforeInsertProcessor
- type BeforeSetProcessor
- type BeforeUpdateProcessor
- type Cell
- type Cipher
- type Databook
- func (databook *Databook) AddSheet(title string, data interface{}, mustMatch bool, headers ...[]string) error
- func (databook *Databook) HTML() *tablib.Exportable
- func (databook *Databook) JSON() (*tablib.Exportable, error)
- func (databook *Databook) SaveAsHTML(filename string, perm os.FileMode) error
- func (databook *Databook) SaveAsJSON(filename string, perm os.FileMode) error
- func (databook *Databook) SaveAsXLSX(filename string, perm os.FileMode) error
- func (databook *Databook) SaveAsXML(filename string, perm os.FileMode) error
- func (databook *Databook) SaveAsYAML(filename string, perm os.FileMode) error
- func (databook *Databook) Sheet(title string) tablib.Sheet
- func (databook *Databook) Sheets() map[string]tablib.Sheet
- func (databook *Databook) Size() int
- func (databook *Databook) Wipe()
- func (databook *Databook) XLSX() (*tablib.Exportable, error)
- func (databook *Databook) XML() (*tablib.Exportable, error)
- func (databook *Databook) YAML() (*tablib.Exportable, error)
- type DesEncrypt
- type DiscardLogger
- func (DiscardLogger) Debug(v ...interface{})
- func (DiscardLogger) Debugf(format string, v ...interface{})
- func (DiscardLogger) Error(v ...interface{})
- func (DiscardLogger) Errorf(format string, v ...interface{})
- func (DiscardLogger) Info(v ...interface{})
- func (DiscardLogger) Infof(format string, v ...interface{})
- func (DiscardLogger) IsShowSQL() bool
- func (DiscardLogger) Level() core.LogLevel
- func (DiscardLogger) SetLevel(l core.LogLevel)
- func (DiscardLogger) ShowSQL(show ...bool)
- func (DiscardLogger) Warn(v ...interface{})
- func (DiscardLogger) Warnf(format string, v ...interface{})
- type Engine
- func NewDB(driverName string, dataSourceName string) (*Engine, error)
- func NewEngine(driverName string, dataSourceName string) (*Engine, error)
- func NewMSSQL(driverName string, dataSourceName string) (*Engine, error)
- func NewMySQL(driverName string, dataSourceName string) (*Engine, error)
- func NewOracle(driverName string, dataSourceName string) (*Engine, error)
- func NewPostgreSQL(dataSourceName string) (*Engine, error)
- func NewSqlite3(dataSourceName string) (*Engine, error)
- func (engine *Engine) AddSql(key string, sql string)
- func (engine *Engine) AddSqlTemplate(key string, sqlTemplateStr string) error
- func (engine *Engine) After(closures func(interface{})) *Session
- func (engine *Engine) Alias(alias string) *Session
- func (engine *Engine) AllCols() *Session
- func (engine *Engine) Asc(colNames ...string) *Session
- func (engine *Engine) AutoIncrStr() string
- func (engine *Engine) BatchAddSql(sqlStrMap map[string]string)
- func (engine *Engine) BatchAddSqlTemplate(key string, sqlTemplateStrMap map[string]string) error
- func (engine *Engine) BatchLoadSqlMap(filepathSlice []string) error
- func (engine *Engine) BatchLoadSqlTemplate(filepathSlice []string) error
- func (engine *Engine) BatchReloadSqlMap(filepathSlice []string) error
- func (engine *Engine) BatchReloadSqlTemplate(filepathSlice []string) error
- func (engine *Engine) BatchRemoveSql(key []string)
- func (engine *Engine) BatchRemoveSqlTemplate(key []string)
- func (engine *Engine) BatchUpdateSql(sqlStrMap map[string]string)
- func (engine *Engine) BatchUpdateSqlTemplate(key string, sqlTemplateStrMap map[string]string) error
- func (engine *Engine) Before(closures func(interface{})) *Session
- func (engine *Engine) Cascade(trueOrFalse ...bool) *Session
- func (engine *Engine) Charset(charset string) *Session
- func (engine *Engine) ClearCache(beans ...interface{}) error
- func (engine *Engine) ClearCacheBean(bean interface{}, id string) error
- func (engine *Engine) ClearSqlMapCipher()
- func (engine *Engine) ClearSqlTemplateCipher()
- func (engine *Engine) Clone() (*Engine, error)
- func (engine *Engine) Close() error
- func (engine *Engine) Cols(columns ...string) *Session
- func (engine *Engine) Count(bean interface{}) (int64, error)
- func (engine *Engine) CreateIndexes(bean interface{}) error
- func (engine *Engine) CreateTables(beans ...interface{}) error
- func (engine *Engine) CreateUniques(bean interface{}) error
- func (engine *Engine) DB() *core.DB
- func (engine *Engine) DBMetas() ([]*core.Table, error)
- func (engine *Engine) DataSourceName() string
- func (engine *Engine) Decr(column string, arg ...interface{}) *Session
- func (engine *Engine) Delete(bean interface{}) (int64, error)
- func (engine *Engine) Desc(colNames ...string) *Session
- func (engine *Engine) Dialect() core.Dialect
- func (engine *Engine) Distinct(columns ...string) *Session
- func (engine *Engine) DriverName() string
- func (engine *Engine) DropTables(beans ...interface{}) error
- func (engine *Engine) DumpAll(w io.Writer, tp ...core.DbType) error
- func (engine *Engine) DumpAllToFile(fp string, tp ...core.DbType) error
- func (engine *Engine) DumpTables(tables []*core.Table, w io.Writer, tp ...core.DbType) error
- func (engine *Engine) DumpTablesToFile(tables []*core.Table, fp string, tp ...core.DbType) error
- func (engine *Engine) Exec(sql string, args ...interface{}) (sql.Result, error)
- func (engine *Engine) Find(beans interface{}, condiBeans ...interface{}) error
- func (engine *Engine) FormatTime(sqlTypeName string, t time.Time) (v interface{})
- func (engine *Engine) Get(bean interface{}) (bool, error)
- func (engine *Engine) GetFirst(bean interface{}) *ResultBean
- func (engine *Engine) GetSql(key string) string
- func (engine *Engine) GetSqlMap(keys ...interface{}) map[string]string
- func (engine *Engine) GetSqlTemplate(key string) *pongo2.Template
- func (engine *Engine) GetSqlTemplates(keys ...interface{}) map[string]*pongo2.Template
- func (engine *Engine) GobRegister(v interface{}) *Engine
- func (engine *Engine) GroupBy(keys string) *Session
- func (engine *Engine) Having(conditions string) *Session
- func (engine *Engine) ID(id interface{}) *Session
- func (engine *Engine) IDOf(bean interface{}) core.PK
- func (engine *Engine) IDOfV(rv reflect.Value) core.PK
- func (engine *Engine) Id(id interface{}) *Session
- func (engine *Engine) IdOf(bean interface{}) core.PKdeprecated
- func (engine *Engine) IdOfV(rv reflect.Value) core.PKdeprecated
- func (engine *Engine) Import(r io.Reader) ([]sql.Result, error)
- func (engine *Engine) ImportFile(ddlPath string) ([]sql.Result, error)
- func (engine *Engine) In(column string, args ...interface{}) *Session
- func (engine *Engine) Incr(column string, arg ...interface{}) *Session
- func (engine *Engine) InitSqlMap(options ...SqlMapOptions) error
- func (engine *Engine) InitSqlTemplate(options ...SqlTemplateOptions) error
- func (engine *Engine) Insert(beans ...interface{}) (int64, error)
- func (engine *Engine) InsertOne(bean interface{}) (int64, error)
- func (engine *Engine) IsTableEmpty(bean interface{}) (bool, error)
- func (engine *Engine) IsTableExist(beanOrTableName interface{}) (bool, error)
- func (engine *Engine) Iterate(bean interface{}, fun IterFunc) error
- func (engine *Engine) Join(joinOperator string, tablename interface{}, condition string, ...) *Session
- func (engine *Engine) Limit(limit int, start ...int) *Session
- func (engine *Engine) LoadSqlMap(filepath string) error
- func (engine *Engine) LoadSqlTemplate(filepath string) error
- func (engine *Engine) Logger() core.ILogger
- func (engine *Engine) MapCacher(bean interface{}, cacher core.Cacher)
- func (engine *Engine) MustCols(columns ...string) *Session
- func (engine *Engine) NewDB() (*core.DB, error)
- func (engine *Engine) NewSession() *Session
- func (engine *Engine) NoAutoCondition(no ...bool) *Session
- func (engine *Engine) NoAutoTime() *Session
- func (engine *Engine) NoCache() *Session
- func (engine *Engine) NoCascade() *Session
- func (engine *Engine) NowTime(sqlTypeName string) interface{}
- func (engine *Engine) NowTime2(sqlTypeName string) (interface{}, time.Time)
- func (engine *Engine) Nullable(columns ...string) *Session
- func (engine *Engine) Omit(columns ...string) *Session
- func (engine *Engine) OrderBy(order string) *Session
- func (engine *Engine) Ping() error
- func (engine *Engine) Query(sql string, paramStr ...interface{}) (resultsSlice []map[string][]byte, err error)
- func (engine *Engine) Query2(sql string, paramStr ...interface{}) (resultsSlice []map[string]string, err error)
- func (engine *Engine) Quote(value string) string
- func (engine *Engine) QuoteStr() string
- func (engine *Engine) QuoteTo(buf *bytes.Buffer, value string)
- func (engine *Engine) ReloadSqlMap(filepath string) error
- func (engine *Engine) ReloadSqlTemplate(filepath string) error
- func (engine *Engine) RemoveSql(key string)
- func (engine *Engine) RemoveSqlTemplate(key string)
- func (engine *Engine) Rows(bean interface{}) (*Rows, error)
- func (engine *Engine) SQL(query interface{}, args ...interface{}) *Session
- func (engine *Engine) SQLType(c *core.Column) string
- func (engine *Engine) Search(beans interface{}, condiBeans ...interface{}) *ResultStructs
- func (engine *Engine) Select(str string) *Session
- func (engine *Engine) SetColumnMapper(mapper core.IMapper)
- func (engine *Engine) SetDefaultCacher(cacher core.Cacher)
- func (engine *Engine) SetDisableGlobalCache(disable bool)
- func (engine *Engine) SetExpr(column string, expression string) *Session
- func (engine *Engine) SetLogger(logger core.ILogger)
- func (engine *Engine) SetMapper(mapper core.IMapper)
- func (engine *Engine) SetMaxIdleConns(conns int)
- func (engine *Engine) SetMaxOpenConns(conns int)
- func (engine *Engine) SetSqlMapCipher(cipher Cipher)
- func (engine *Engine) SetSqlMapRootDir(sqlMapRootDir string) *Engine
- func (engine *Engine) SetSqlTemplateCipher(cipher Cipher)
- func (engine *Engine) SetSqlTemplateRootDir(sqlTemplateRootDir string) *Engine
- func (engine *Engine) SetTableMapper(mapper core.IMapper)
- func (engine *Engine) ShowExecTime(show ...bool)
- func (engine *Engine) ShowSQL(show ...bool)
- func (engine *Engine) Sql(querystring string, args ...interface{}) *Sessiondeprecated
- func (engine *Engine) SqlMapClient(sqlTagName string, args ...interface{}) *Session
- func (engine *Engine) SqlMapsClient(sqlkeys interface{}, parmas ...interface{}) *SqlMapsExecutor
- func (engine *Engine) SqlTemplateClient(sqlTagName string, args ...interface{}) *Session
- func (engine *Engine) SqlTemplatesClient(sqlkeys interface{}, parmas ...interface{}) *SqlTemplatesExecutor
- func (engine *Engine) SqlType(c *core.Column) stringdeprecated
- func (engine *Engine) Sqls(sqls interface{}, parmas ...interface{}) *SqlsExecutor
- func (engine *Engine) StartFSWatcher() error
- func (engine *Engine) StopFSWatcher() error
- func (engine *Engine) StoreEngine(storeEngine string) *Session
- func (engine *Engine) Sum(bean interface{}, colName string) (float64, error)
- func (engine *Engine) Sums(bean interface{}, colNames ...string) ([]float64, error)
- func (engine *Engine) SumsInt(bean interface{}, colNames ...string) ([]int64, error)
- func (engine *Engine) SupportInsertMany() bool
- func (engine *Engine) Sync(beans ...interface{}) error
- func (engine *Engine) Sync2(beans ...interface{}) error
- func (engine *Engine) TZTime(t time.Time) time.Time
- func (engine *Engine) Table(tableNameOrBean interface{}) *Session
- func (engine *Engine) TableInfo(bean interface{}) *Table
- func (engine *Engine) Unscoped() *Session
- func (engine *Engine) Update(bean interface{}, condiBeans ...interface{}) (int64, error)
- func (engine *Engine) UpdateSql(key string, sql string)
- func (engine *Engine) UpdateSqlTemplate(key string, sqlTemplateStr string) error
- func (engine *Engine) UseBool(columns ...string) *Session
- func (engine *Engine) Where(query interface{}, args ...interface{}) *Session
- type IterFunc
- type LRUCacher
- func (m *LRUCacher) ClearBeans(tableName string)
- func (m *LRUCacher) ClearIds(tableName string)
- func (m *LRUCacher) DelBean(tableName string, id string)
- func (m *LRUCacher) DelIds(tableName, sql string)
- func (m *LRUCacher) GC()
- func (m *LRUCacher) GetBean(tableName string, id string) interface{}
- func (m *LRUCacher) GetIds(tableName, sql string) interface{}
- func (m *LRUCacher) PutBean(tableName string, id string, obj interface{})
- func (m *LRUCacher) PutIds(tableName, sql string, ids interface{})
- func (m *LRUCacher) RunGC()
- type Mapper
- type MemoryStore
- type ResultBean
- type ResultMap
- func (resultMap *ResultMap) Count() (int, error)
- func (resultMap *ResultMap) Json() (string, error)
- func (resultMap *ResultMap) List() ([]map[string]interface{}, error)
- func (resultMap *ResultMap) ListPage(firstResult int, maxResults int) ([]map[string]interface{}, error)
- func (resultMap *ResultMap) SaveAsCSV(filename string, headers []string, perm os.FileMode) error
- func (resultMap *ResultMap) SaveAsHTML(filename string, headers []string, perm os.FileMode) error
- func (resultMap *ResultMap) SaveAsJSON(filename string, headers []string, perm os.FileMode) error
- func (resultMap *ResultMap) SaveAsTSV(filename string, headers []string, perm os.FileMode) error
- func (resultMap *ResultMap) SaveAsXLSX(filename string, headers []string, perm os.FileMode) error
- func (resultMap *ResultMap) SaveAsXML(filename string, headers []string, perm os.FileMode) error
- func (resultMap *ResultMap) SaveAsXMLWithTagNamePrefixIndent(tagName string, prifix string, indent string, filename string, ...) error
- func (resultMap *ResultMap) SaveAsYAML(filename string, headers []string, perm os.FileMode) error
- func (resultMap *ResultMap) Xml() (string, error)
- func (resultMap *ResultMap) XmlIndent(prefix string, indent string, recordTag string) (string, error)
- type ResultStructs
- type Rows
- type RsaEncrypt
- type Session
- func (session *Session) After(closures func(interface{})) *Session
- func (session *Session) Alias(alias string) *Session
- func (session *Session) AllCols() *Session
- func (session *Session) And(query interface{}, args ...interface{}) *Session
- func (session *Session) Asc(colNames ...string) *Session
- func (session *Session) Before(closures func(interface{})) *Session
- func (session *Session) Begin(transactionDefinition ...int) (*Transaction, error)
- func (session *Session) Cascade(trueOrFalse ...bool) *Session
- func (session *Session) Charset(charset string) *Session
- func (session *Session) Clone() *Session
- func (session *Session) Close()
- func (session *Session) Cols(columns ...string) *Session
- func (session *Session) Conds() builder.Cond
- func (session *Session) Count(bean interface{}) (int64, error)
- func (session *Session) CreateIndexes(bean interface{}) error
- func (session *Session) CreateTable(bean interface{}) error
- func (session *Session) CreateUniques(bean interface{}) error
- func (session *Session) DB() *core.DB
- func (session *Session) Decr(column string, arg ...interface{}) *Session
- func (session *Session) Delete(bean interface{}) (int64, error)
- func (session *Session) Desc(colNames ...string) *Session
- func (session *Session) Distinct(columns ...string) *Session
- func (session *Session) DropIndexes(bean interface{}) error
- func (session *Session) DropTable(beanOrTableName interface{}) error
- func (session *Session) Exec(sqlStr string, args ...interface{}) (sql.Result, error)
- func (session *Session) Execute() (sql.Result, error)
- func (session *Session) Find(rowsSlicePtr interface{}, condiBean ...interface{}) error
- func (session *Session) ForUpdate() *Session
- func (session *Session) Get(bean interface{}) (bool, error)
- func (session *Session) GetFirst(bean interface{}) *ResultBean
- func (session *Session) GroupBy(keys string) *Session
- func (session *Session) Having(conditions string) *Session
- func (session *Session) ID(id interface{}) *Session
- func (session *Session) Id(id interface{}) *Sessiondeprecated
- func (session *Session) In(column string, args ...interface{}) *Session
- func (session *Session) Incr(column string, arg ...interface{}) *Session
- func (session *Session) Init()
- func (session *Session) Insert(beans ...interface{}) (int64, error)
- func (session *Session) InsertMulti(rowsSlicePtr interface{}) (int64, error)
- func (session *Session) InsertOne(bean interface{}) (int64, error)
- func (session *Session) IsTableEmpty(bean interface{}) (bool, error)
- func (session *Session) IsTableExist(beanOrTableName interface{}) (bool, error)
- func (session *Session) Iterate(bean interface{}, fun IterFunc) error
- func (session *Session) Join(joinOperator string, tablename interface{}, condition string, ...) *Session
- func (session *Session) LastSQL() (string, []interface{})
- func (session *Session) Limit(limit int, start ...int) *Session
- func (session *Session) MustCols(columns ...string) *Session
- func (session *Session) NoAutoCondition(no ...bool) *Session
- func (session *Session) NoAutoTime() *Session
- func (session *Session) NoCache() *Session
- func (session *Session) NoCascade() *Session
- func (session *Session) NotIn(column string, args ...interface{}) *Session
- func (session *Session) Nullable(columns ...string) *Session
- func (session *Session) Omit(columns ...string) *Session
- func (session *Session) Or(query interface{}, args ...interface{}) *Session
- func (session *Session) OrderBy(order string) *Session
- func (session *Session) Ping() error
- func (session *Session) Prepare() *Session
- func (session *Session) Query() *ResultMap
- func (session *Session) QueryWithDateFormat(dateFormat string) *ResultMap
- func (session *Session) Rows(bean interface{}) (*Rows, error)
- func (session *Session) SQL(query interface{}, args ...interface{}) *Session
- func (session *Session) Search(rowsSlicePtr interface{}, condiBean ...interface{}) *ResultStructs
- func (session *Session) Select(str string) *Session
- func (session *Session) SetExpr(column string, expression string) *Session
- func (session *Session) Sql(query string, args ...interface{}) *Sessiondeprecated
- func (session *Session) SqlMapClient(sqlTagName string, args ...interface{}) *Session
- func (session *Session) SqlMapsClient(sqlkeys interface{}, parmas ...interface{}) *SqlMapsExecutor
- func (session *Session) SqlTemplateClient(sqlTagName string, args ...interface{}) *Session
- func (session *Session) SqlTemplatesClient(sqlkeys interface{}, parmas ...interface{}) *SqlTemplatesExecutor
- func (session *Session) Sqls(sqls interface{}, parmas ...interface{}) *SqlsExecutor
- func (session *Session) StoreEngine(storeEngine string) *Session
- func (session *Session) Sum(bean interface{}, columnName string) (float64, error)
- func (session *Session) Sums(bean interface{}, columnNames ...string) ([]float64, error)
- func (session *Session) SumsInt(bean interface{}, columnNames ...string) ([]int64, error)
- func (session *Session) Sync2(beans ...interface{}) error
- func (session *Session) Table(tableNameOrBean interface{}) *Session
- func (session *Session) Unscoped() *Session
- func (session *Session) Update(bean interface{}, condiBean ...interface{}) (int64, error)
- func (session *Session) UseBool(columns ...string) *Session
- func (session *Session) Where(query interface{}, args ...interface{}) *Session
- type ShortUUID
- type SimpleLogger
- func (s *SimpleLogger) Debug(v ...interface{})
- func (s *SimpleLogger) Debugf(format string, v ...interface{})
- func (s *SimpleLogger) Error(v ...interface{})
- func (s *SimpleLogger) Errorf(format string, v ...interface{})
- func (s *SimpleLogger) Info(v ...interface{})
- func (s *SimpleLogger) Infof(format string, v ...interface{})
- func (s *SimpleLogger) IsShowSQL() bool
- func (s *SimpleLogger) Level() core.LogLevel
- func (s *SimpleLogger) SetLevel(l core.LogLevel)
- func (s *SimpleLogger) ShowSQL(show ...bool)
- func (s *SimpleLogger) Warn(v ...interface{})
- func (s *SimpleLogger) Warnf(format string, v ...interface{})
- type Sql
- type SqlMap
- type SqlMapOptions
- type SqlMapsExecutor
- type SqlTemplate
- type SqlTemplateOptions
- type SqlTemplatesExecutor
- type SqlsExecutor
- type Statement
- func (statement *Statement) Alias(alias string) *Statement
- func (statement *Statement) AllCols() *Statement
- func (statement *Statement) And(query interface{}, args ...interface{}) *Statement
- func (statement *Statement) Asc(colNames ...string) *Statement
- func (statement *Statement) Cols(columns ...string) *Statement
- func (statement *Statement) Decr(column string, arg ...interface{}) *Statement
- func (statement *Statement) Desc(colNames ...string) *Statement
- func (statement *Statement) Distinct(columns ...string) *Statement
- func (statement *Statement) ForUpdate() *Statement
- func (statement *Statement) GroupBy(keys string) *Statement
- func (statement *Statement) Having(conditions string) *Statement
- func (statement *Statement) ID(id interface{}) *Statement
- func (statement *Statement) In(column string, args ...interface{}) *Statement
- func (statement *Statement) Incr(column string, arg ...interface{}) *Statement
- func (statement *Statement) Init()
- func (statement *Statement) Join(joinOP string, tablename interface{}, condition string, args ...interface{}) *Statement
- func (statement *Statement) Limit(limit int, start ...int) *Statement
- func (statement *Statement) MustCols(columns ...string) *Statement
- func (statement *Statement) NoAutoCondition(no ...bool) *Statement
- func (statement *Statement) NotIn(column string, args ...interface{}) *Statement
- func (statement *Statement) Nullable(columns ...string)
- func (statement *Statement) Omit(columns ...string)
- func (statement *Statement) Or(query interface{}, args ...interface{}) *Statement
- func (statement *Statement) OrderBy(order string) *Statement
- func (statement *Statement) SQL(query interface{}, args ...interface{}) *Statement
- func (statement *Statement) Select(str string) *Statement
- func (statement *Statement) SetExpr(column string, expression string) *Statement
- func (statement *Statement) Table(tableNameOrBean interface{}) *Statement
- func (statement *Statement) TableName() string
- func (statement *Statement) Top(limit int) *Statement
- func (statement *Statement) Unscoped() *Statement
- func (statement *Statement) UseBool(columns ...string) *Statement
- func (statement *Statement) Where(query interface{}, args ...interface{}) *Statement
- type StringSet
- func (set *StringSet) Add(i string) bool
- func (set *StringSet) Contains(i string) bool
- func (set *StringSet) Index(c string) int
- func (set *StringSet) ItemByIndex(idx int) string
- func (set *StringSet) Len() int
- func (set *StringSet) Remove(i string)
- func (set *StringSet) Sort()
- func (set *StringSet) String() string
- type SyslogLogger
- func (s *SyslogLogger) Debug(v ...interface{})
- func (s *SyslogLogger) Debugf(format string, v ...interface{})
- func (s *SyslogLogger) Error(v ...interface{})
- func (s *SyslogLogger) Errorf(format string, v ...interface{})
- func (s *SyslogLogger) Info(v ...interface{})
- func (s *SyslogLogger) Infof(format string, v ...interface{})
- func (s *SyslogLogger) IsShowSQL() bool
- func (s *SyslogLogger) Level() core.LogLevel
- func (s *SyslogLogger) SetLevel(l core.LogLevel)
- func (s *SyslogLogger) ShowSQL(show ...bool)
- func (s *SyslogLogger) Warn(v ...interface{})
- func (s *SyslogLogger) Warnf(format string, v ...interface{})
- type Table
- type TableName
- type Transaction
- func (transaction *Transaction) Begin() error
- func (transaction *Transaction) Commit() error
- func (transaction *Transaction) Do(doFunc func(params ...interface{}), params ...interface{})
- func (transaction *Transaction) GetSavePointID() string
- func (transaction *Transaction) IsExistingTransaction() bool
- func (transaction *Transaction) Rollback() error
- func (transaction *Transaction) RollbackToSavePoint(savePointID string) error
- func (transaction *Transaction) SavePoint(savePointID string) error
- func (transaction *Transaction) Session() *Session
- func (transaction *Transaction) TransactionDefinition() int
- func (transaction *Transaction) WaitForDo(doFunc func(params ...interface{}), params ...interface{})
- type TripleDesEncrypt
- type UUID
- type Value
- type XmlCrud
- type XmlDelete
- type XmlIf
- type XmlInclude
- type XmlInsert
- type XmlMapper
- type XmlSelect
- type XmlSet
- type XmlSql
- type XmlUpdate
Constants ¶
const ( DEFAULT_LOG_PREFIX = "[xorm]" DEFAULT_LOG_FLAG = log.Ldate | log.Lmicroseconds DEFAULT_LOG_LEVEL = core.LOG_DEBUG )
default log options
const ( RSA_PUBKEY_ENCRYPT_MODE = iota //公钥加密 RSA_PUBKEY_DECRYPT_MODE //公钥解密 RSA_PRIKEY_ENCRYPT_MODE //私钥加密 RSA_PRIKEY_DECRYPT_MODE //私钥解密 )
const ( PROPAGATION_REQUIRED = 0 //Support a current transaction; create a new one if none exists. PROPAGATION_SUPPORTS = 1 //Support a current transaction; execute non-transactionally if none exists. PROPAGATION_MANDATORY = 2 //Support a current transaction; return an error if no current transaction exists. PROPAGATION_REQUIRES_NEW = 3 //Create a new transaction, suspending the current transaction if one exists. PROPAGATION_NOT_SUPPORTED = 4 //Do not support a current transaction; rather always execute non-transactionally. PROPAGATION_NEVER = 5 //Do not support a current transaction; return an error if a current transaction exists. PROPAGATION_NESTED = 6 //Execute within a nested transaction if a current transaction exists, behave like PROPAGATION_REQUIRED else. )
const ( MSSQL_DRIVER string = "mssql" MSSQL_ODBC_DRIVER string = "odbc" MYSQL_DRIVER string = "mysql" MYMYSQL_DRIVER string = "mymysql" POSTGRESQL_DRIVER string = "postgres" OCI8_DRIVER string = "oci8" GORACLE_DRIVER string = "goracle" SQLITE3_DRIVER string = "sqlite3" )
const (
DEFAULT_ALPHABET = "23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
)
const ( // Version show the xorm's version Version string = "0.6.0.1022" )
Variables ¶
var ( ErrParamsType error = errors.New("Params type error") ErrParamsFormat error = errors.New("Params format error") ErrTableNotFound error = errors.New("Not found table") ErrUnSupportedType error = errors.New("Unsupported type error") ErrNotExist error = errors.New("Not exist error") ErrCacheFailed error = errors.New("Cache failed") ErrNeedDeletedCond error = errors.New("Delete need at least one condition") ErrNotImplemented error = errors.New("Not implemented.") ErrNotInTransaction error = errors.New("Not in transaction.") ErrNestedTransaction error = errors.New("Nested transaction error.") ErrTransactionDefinition error = errors.New("Transaction definition error.") )
var ( ErrDataToLarge = errors.New("message too long for RSA public key size") ErrDataLen = errors.New("data length error") ErrDataBroken = errors.New("data broken, first byte is not zero") ErrKeyPairDismatch = errors.New("data is not encrypted by the private key") ErrDecryption = errors.New("decryption error") ErrPublicKey = errors.New("get public key error") ErrPrivateKey = errors.New("get private key error") )
var ( // NIL is defined in RFC 4122 section 4.1.7. // The nil UUID is special form of UUID that is specified to have all 128 bits set to zero. NIL = &UUID{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, } // NameSpaceDNS assume name to be a fully-qualified domain name. // Declared in RFC 4122 Appendix C. NameSpaceDNS = &UUID{ 0x6b, 0xa7, 0xb8, 0x10, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8, } // NameSpaceURL assume name to be a URL. // Declared in RFC 4122 Appendix C. NameSpaceURL = &UUID{ 0x6b, 0xa7, 0xb8, 0x11, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8, } // NameSpaceOID assume name to be an ISO OID. // Declared in RFC 4122 Appendix C. NameSpaceOID = &UUID{ 0x6b, 0xa7, 0xb8, 0x12, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8, } // NameSpaceX500 assume name to be a X.500 DN (in DER or a text output format). // Declared in RFC 4122 Appendix C. NameSpaceX500 = &UUID{ 0x6b, 0xa7, 0xb8, 0x14, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8, } )
var (
NamespaceDNS, _ = FromString("6ba7b810-9dad-11d1-80b4-00c04fd430c8")
NamespaceURL, _ = FromString("6ba7b811-9dad-11d1-80b4-00c04fd430c8")
NamespaceOID, _ = FromString("6ba7b812-9dad-11d1-80b4-00c04fd430c8")
NamespaceX500, _ = FromString("6ba7b814-9dad-11d1-80b4-00c04fd430c8")
)
Functions ¶
func JSONString ¶
func NewDataset ¶
NewDataset creates a new Dataset.
func NewDatasetWithData ¶
func NewDatasetWithData(headers []string, data interface{}, mustMatch bool) (*tablib.Dataset, error)
NewDatasetWithData creates a new Dataset.
func PKCS5Padding ¶
func PKCS5UnPadding ¶
func ZeroPadding ¶
func ZeroUnPadding ¶
Types ¶
type AesEncrypt ¶
type AesEncrypt struct {
PubKey string
}
type AfterDeleteProcessor ¶
type AfterDeleteProcessor interface {
AfterDelete()
}
AfterDeleteProcessor executed after an object has been deleted
type AfterInsertProcessor ¶
type AfterInsertProcessor interface {
AfterInsert()
}
AfterInsertProcessor executed after an object is persisted to the database
type AfterSetProcessor ¶
AfterSetProcessor executed after data set to the struct fields
type AfterUpdateProcessor ¶
type AfterUpdateProcessor interface {
AfterUpdate()
}
AfterUpdateProcessor executed after an object has been updated
type BeforeDeleteProcessor ¶
type BeforeDeleteProcessor interface {
BeforeDelete()
}
BeforeDeleteProcessor executed before an object is deleted
type BeforeInsertProcessor ¶
type BeforeInsertProcessor interface {
BeforeInsert()
}
BeforeInsertProcessor executed before an object is initially persisted to the database
type BeforeSetProcessor ¶
BeforeSetProcessor executed before data set to the struct fields
type BeforeUpdateProcessor ¶
type BeforeUpdateProcessor interface {
BeforeUpdate()
}
BeforeUpdateProcessor executed before an object is updated
type Databook ¶
func NewDatabook ¶
func NewDatabook() *Databook
func NewDatabookWithData ¶
func (*Databook) HTML ¶
func (databook *Databook) HTML() *tablib.Exportable
func (*Databook) SaveAsHTML ¶
func (*Databook) SaveAsJSON ¶
func (*Databook) SaveAsXLSX ¶
func (*Databook) SaveAsYAML ¶
type DesEncrypt ¶
type DesEncrypt struct {
PubKey string
}
type DiscardLogger ¶
type DiscardLogger struct{}
DiscardLogger don't log implementation for core.ILogger
func (DiscardLogger) Debug ¶
func (DiscardLogger) Debug(v ...interface{})
Debug empty implementation
func (DiscardLogger) Debugf ¶
func (DiscardLogger) Debugf(format string, v ...interface{})
Debugf empty implementation
func (DiscardLogger) Error ¶
func (DiscardLogger) Error(v ...interface{})
Error empty implementation
func (DiscardLogger) Errorf ¶
func (DiscardLogger) Errorf(format string, v ...interface{})
Errorf empty implementation
func (DiscardLogger) Infof ¶
func (DiscardLogger) Infof(format string, v ...interface{})
Infof empty implementation
func (DiscardLogger) IsShowSQL ¶
func (DiscardLogger) IsShowSQL() bool
IsShowSQL empty implementation
func (DiscardLogger) SetLevel ¶
func (DiscardLogger) SetLevel(l core.LogLevel)
SetLevel empty implementation
func (DiscardLogger) ShowSQL ¶
func (DiscardLogger) ShowSQL(show ...bool)
ShowSQL empty implementation
func (DiscardLogger) Warnf ¶
func (DiscardLogger) Warnf(format string, v ...interface{})
Warnf empty implementation
type Engine ¶
type Engine struct { ColumnMapper core.IMapper TableMapper core.IMapper TagIdentifier string Tables map[reflect.Type]*core.Table Cacher core.Cacher TZLocation *time.Location DatabaseTZ *time.Location // The timezone of the database // contains filtered or unexported fields }
Engine is the major struct of xorm, it means a database manager. Commonly, an application only need one engine.
func NewEngine ¶
NewEngine new a db manager according to the parameter. Currently support four drivers
func NewPostgreSQL ¶
func NewSqlite3 ¶
func (*Engine) AddSqlTemplate ¶
func (*Engine) Asc ¶
Asc will generate "ORDER BY column1,column2 Asc" This method can chainable use.
engine.Desc("name").Asc("age").Find(&users) // SELECT * FROM user ORDER BY name DESC, age ASC
func (*Engine) AutoIncrStr ¶
AutoIncrStr Database's autoincrement statement
func (*Engine) BatchAddSql ¶
func (*Engine) BatchAddSqlTemplate ¶
func (*Engine) BatchLoadSqlMap ¶
func (*Engine) BatchLoadSqlTemplate ¶
func (*Engine) BatchReloadSqlMap ¶
func (*Engine) BatchReloadSqlTemplate ¶
func (*Engine) BatchRemoveSql ¶
func (*Engine) BatchRemoveSqlTemplate ¶
func (*Engine) BatchUpdateSql ¶
func (*Engine) BatchUpdateSqlTemplate ¶
func (*Engine) ClearCache ¶
ClearCache if enabled cache, clear some tables' cache
func (*Engine) ClearCacheBean ¶
ClearCacheBean if enabled cache, clear the cache bean
func (*Engine) ClearSqlMapCipher ¶
func (engine *Engine) ClearSqlMapCipher()
func (*Engine) ClearSqlTemplateCipher ¶
func (engine *Engine) ClearSqlTemplateCipher()
func (*Engine) CreateIndexes ¶
CreateIndexes create indexes
func (*Engine) CreateTables ¶
CreateTables create tabls according bean
func (*Engine) CreateUniques ¶
CreateUniques create uniques
func (*Engine) DataSourceName ¶
DataSourceName return the current connection string
func (*Engine) Distinct ¶
Distinct use for distinct columns. Caution: when you are using cache, distinct will not be cached because cache system need id, but distinct will not provide id
func (*Engine) DriverName ¶
DriverName return the current sql driver's name
func (*Engine) DropTables ¶
DropTables drop specify tables
func (*Engine) DumpAllToFile ¶
DumpAllToFile dump database all table structs and data to a file
func (*Engine) DumpTables ¶
DumpTables dump specify tables to io.Writer
func (*Engine) DumpTablesToFile ¶
DumpTablesToFile dump specified tables to SQL file.
func (*Engine) Find ¶
Find retrieve records from table, condiBeans's non-empty fields are conditions. beans could be []Struct, []*Struct, map[int64]Struct map[int64]*Struct
func (*Engine) FormatTime ¶
FormatTime format time
func (*Engine) GetFirst ¶
func (engine *Engine) GetFirst(bean interface{}) *ResultBean
Get retrieve one record from table, bean's non-empty fields are conditions
func (*Engine) GetSqlTemplate ¶
func (*Engine) GetSqlTemplates ¶
func (*Engine) GobRegister ¶
GobRegister register one struct to gob for cache use
func (*Engine) ImportFile ¶
ImportFile SQL DDL file
func (*Engine) InitSqlMap ¶
func (engine *Engine) InitSqlMap(options ...SqlMapOptions) error
func (*Engine) InitSqlTemplate ¶
func (engine *Engine) InitSqlTemplate(options ...SqlTemplateOptions) error
func (*Engine) IsTableEmpty ¶
IsTableEmpty if a table has any reocrd
func (*Engine) IsTableExist ¶
IsTableExist if a table is exist
func (*Engine) Iterate ¶
Iterate record by record handle records from table, bean's non-empty fields are conditions.
func (*Engine) Join ¶
func (engine *Engine) Join(joinOperator string, tablename interface{}, condition string, args ...interface{}) *Session
Join the join_operator should be one of INNER, LEFT OUTER, CROSS etc - this will be prepended to JOIN
func (*Engine) LoadSqlMap ¶
func (*Engine) LoadSqlTemplate ¶
func (*Engine) NoAutoCondition ¶
NoAutoCondition disable auto generate Where condition from bean or not
func (*Engine) NoAutoTime ¶
NoAutoTime Default if your struct has "created" or "updated" filed tag, the fields will automatically be filled with current time when Insert or Update invoked. Call NoAutoTime if you dont' want to fill automatically.
func (*Engine) NoCache ¶
NoCache If you has set default cacher, and you want temporilly stop use cache, you can use NoCache()
func (*Engine) Query ¶
func (engine *Engine) Query(sql string, paramStr ...interface{}) (resultsSlice []map[string][]byte, err error)
Query a raw sql and return records as []map[string][]byte
func (*Engine) Query2 ¶
func (engine *Engine) Query2(sql string, paramStr ...interface{}) (resultsSlice []map[string]string, err error)
Exec a raw sql and return records as []map[string][]byte
func (*Engine) QuoteStr ¶
QuoteStr Engine's database use which character as quote. mysql, sqlite use ` and postgres use "
func (*Engine) ReloadSqlMap ¶
func (*Engine) ReloadSqlTemplate ¶
func (*Engine) RemoveSqlTemplate ¶
func (*Engine) Rows ¶
Rows return sql.Rows compatible Rows obj, as a forward Iterator object for iterating record by record, bean's non-empty fields are conditions.
func (*Engine) SQL ¶
SQL method let's you manually write raw SQL and operate For example:
engine.SQL("select * from user").Find(&users)
This code will execute "select * from user" and set the records to users
func (*Engine) Search ¶
func (engine *Engine) Search(beans interface{}, condiBeans ...interface{}) *ResultStructs
func (*Engine) SetColumnMapper ¶
SetColumnMapper set the column name mapping rule
func (*Engine) SetDefaultCacher ¶
SetDefaultCacher set the default cacher. Xorm's default not enable cacher.
func (*Engine) SetDisableGlobalCache ¶
SetDisableGlobalCache disable global cache or not
func (*Engine) SetMaxIdleConns ¶
SetMaxIdleConns set the max idle connections on pool, default is 2
func (*Engine) SetMaxOpenConns ¶
SetMaxOpenConns is only available for go 1.2+
func (*Engine) SetSqlMapCipher ¶
func (*Engine) SetSqlMapRootDir ¶
func (*Engine) SetSqlTemplateCipher ¶
func (*Engine) SetSqlTemplateRootDir ¶
func (*Engine) SetTableMapper ¶
SetTableMapper set the table name mapping rule
func (*Engine) ShowExecTime ¶
ShowExecTime show SQL statement and execute time or not on logger if log level is great than INFO
func (*Engine) ShowSQL ¶
ShowSQL show SQL statement or not on logger if log level is great than INFO
func (*Engine) SqlMapClient ¶
func (*Engine) SqlMapsClient ¶
func (engine *Engine) SqlMapsClient(sqlkeys interface{}, parmas ...interface{}) *SqlMapsExecutor
func (*Engine) SqlTemplateClient ¶
func (*Engine) SqlTemplatesClient ¶
func (engine *Engine) SqlTemplatesClient(sqlkeys interface{}, parmas ...interface{}) *SqlTemplatesExecutor
func (*Engine) Sqls ¶
func (engine *Engine) Sqls(sqls interface{}, parmas ...interface{}) *SqlsExecutor
func (*Engine) StartFSWatcher ¶
start filesystem watcher
func (*Engine) StoreEngine ¶
StoreEngine set store engine when create table, only support mysql now
func (*Engine) SupportInsertMany ¶
SupportInsertMany If engine's database support batch insert records like "insert into user values (name, age), (name, age)". When the return is ture, then engine.Insert(&users) will generate batch sql and exeute.
func (*Engine) Sync ¶
Sync the new struct changes to database, this method will automatically add table, column, index, unique. but will not delete or change anything. If you change some field, you should change the database manually.
func (*Engine) Update ¶
Update records, bean's non-empty fields are updated contents, condiBean' non-empty filds are conditions CAUTION:
1.bool will defaultly be updated content nor conditions You should call UseBool if you have bool to use. 2.float32 & float64 may be not inexact as conditions
func (*Engine) UpdateSqlTemplate ¶
type LRUCacher ¶
type LRUCacher struct { // maxSize int MaxElementSize int Expired time.Duration GcInterval time.Duration // contains filtered or unexported fields }
LRUCacher implments cache object facilities
func NewLRUCacher ¶
func NewLRUCacher(store core.CacheStore, maxElementSize int) *LRUCacher
NewLRUCacher creates a cacher
func NewLRUCacher2 ¶
NewLRUCacher2 creates a cache include different params
func (*LRUCacher) ClearBeans ¶
ClearBeans clears all beans in some table
func (*LRUCacher) GC ¶
func (m *LRUCacher) GC()
GC check ids lit and sql list to remove all element expired
type Mapper ¶
func UnmarshalMapper ¶
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
MemoryStore represents in-memory store
func NewMemoryStore ¶
func NewMemoryStore() *MemoryStore
func (*MemoryStore) Del ¶
func (s *MemoryStore) Del(key string) error
func (*MemoryStore) Get ¶
func (s *MemoryStore) Get(key string) (interface{}, error)
func (*MemoryStore) Put ¶
func (s *MemoryStore) Put(key string, value interface{}) error
type ResultBean ¶
func (*ResultBean) GetResult ¶
func (resultBean *ResultBean) GetResult() (bool, interface{}, error)
type ResultMap ¶
func (*ResultMap) SaveAsHTML ¶
func (*ResultMap) SaveAsJSON ¶
func (*ResultMap) SaveAsXLSX ¶
func (*ResultMap) SaveAsXMLWithTagNamePrefixIndent ¶
func (*ResultMap) SaveAsYAML ¶
type ResultStructs ¶
type ResultStructs struct { Result interface{} Error error }
func (*ResultStructs) Json ¶
func (resultStructs *ResultStructs) Json() (string, error)
func (*ResultStructs) Xml ¶
func (resultStructs *ResultStructs) Xml() (string, error)
type Rows ¶
type Rows struct { NoTypeCheck bool // contains filtered or unexported fields }
Rows rows wrapper a rows to
func (*Rows) Err ¶
Err returns the error, if any, that was encountered during iteration. Err may be called after an explicit or implicit Close.
type RsaEncrypt ¶
type RsaEncrypt struct { PubKey string PriKey string EncryptMode int DecryptMode int // contains filtered or unexported fields }
type Session ¶
type Session struct { Engine *Engine Tx *core.Tx Statement Statement IsAutoCommit bool IsCommitedOrRollbacked bool IsSqlFunc bool TransType string IsAutoClose bool // Automatically reset the statement after operations that execute a SQL // query such as Count(), Find(), Get(), ... AutoResetStatement bool // contains filtered or unexported fields }
Session keep a pointer to sql.DB and provides all execution of all kind of database operations.
func (*Session) Begin ¶
func (session *Session) Begin(transactionDefinition ...int) (*Transaction, error)
func (*Session) CreateIndexes ¶
CreateIndexes create indexes
func (*Session) CreateTable ¶
CreateTable create a table according a bean
func (*Session) CreateUniques ¶
CreateUniques create uniques
func (*Session) Desc ¶
Desc provide desc order by query condition, the input parameters are columns.
func (*Session) Distinct ¶
Distinct use for distinct columns. Caution: when you are using cache, distinct will not be cached because cache system need id, but distinct will not provide id
func (*Session) DropIndexes ¶
DropIndexes drop indexes
func (*Session) DropTable ¶
DropTable drop table will drop table if exist, if drop failed, it will return error
func (*Session) Find ¶
Find retrieve records from table, condiBeans's non-empty fields are conditions. beans could be []Struct, []*Struct, map[int64]Struct map[int64]*Struct
func (*Session) Get ¶
Get retrieve one record from database, bean's non-empty fields will be as conditions
func (*Session) GetFirst ¶
func (session *Session) GetFirst(bean interface{}) *ResultBean
func (*Session) InsertMulti ¶
InsertMulti insert multiple records
func (*Session) InsertOne ¶
InsertOne insert only one struct into database as a record. The in parameter bean must a struct or a point to struct. The return parameter is inserted and error
func (*Session) IsTableEmpty ¶
IsTableEmpty if table have any records
func (*Session) IsTableExist ¶
IsTableExist if a table is exist
func (*Session) Iterate ¶
Iterate record by record handle records from table, condiBeans's non-empty fields are conditions. beans could be []Struct, []*Struct, map[int64]Struct map[int64]*Struct
func (*Session) Join ¶
func (session *Session) Join(joinOperator string, tablename interface{}, condition string, args ...interface{}) *Session
Join join_operator should be one of INNER, LEFT OUTER, CROSS etc - this will be prepended to JOIN
func (*Session) NoAutoCondition ¶
NoAutoCondition disable generate SQL condition from beans
func (*Session) NoAutoTime ¶
NoAutoTime means do not automatically give created field and updated field the current time on the current session temporarily
func (*Session) NoCache ¶
NoCache ask this session do not retrieve data from cache system and get data from database directly.
func (*Session) OrderBy ¶
OrderBy provide order by query condition, the input parameter is the content after order by on a sql statement.
func (*Session) Prepare ¶
Prepare set a flag to session that should be prepare statment before execute query
func (*Session) QueryWithDateFormat ¶
Exec a raw sql and return records as ResultMap
func (*Session) Rows ¶
Rows return sql.Rows compatible Rows obj, as a forward Iterator object for iterating record by record, bean's non-empty fields are conditions.
func (*Session) SQL ¶
SQL provides raw sql input parameter. When you have a complex SQL statement and cannot use Where, Id, In and etc. Methods to describe, you can use SQL.
func (*Session) Search ¶
func (session *Session) Search(rowsSlicePtr interface{}, condiBean ...interface{}) *ResultStructs
func (*Session) SqlMapClient ¶
func (*Session) SqlMapsClient ¶
func (session *Session) SqlMapsClient(sqlkeys interface{}, parmas ...interface{}) *SqlMapsExecutor
func (*Session) SqlTemplateClient ¶
func (*Session) SqlTemplatesClient ¶
func (session *Session) SqlTemplatesClient(sqlkeys interface{}, parmas ...interface{}) *SqlTemplatesExecutor
func (*Session) Sqls ¶
func (session *Session) Sqls(sqls interface{}, parmas ...interface{}) *SqlsExecutor
func (*Session) StoreEngine ¶
StoreEngine is only avialble mysql dialect currently
func (*Session) Table ¶
Table can input a string or pointer to struct for special a table to operate.
func (*Session) Update ¶
Update records, bean's non-empty fields are updated contents, condiBean' non-empty filds are conditions CAUTION:
1.bool will defaultly be updated content nor conditions You should call UseBool if you have bool to use. 2.float32 & float64 may be not inexact as conditions
type ShortUUID ¶
type ShortUUID struct {
// contains filtered or unexported fields
}
func NewShortUUID ¶
func NewShortUUID() *ShortUUID
func (*ShortUUID) Encode ¶
Encodes a UUID into a string (LSB first) according to the alphabet If leftmost (MSB) bits 0, string might be shorter
func (*ShortUUID) SetAlphabet ¶
type SimpleLogger ¶
type SimpleLogger struct { DEBUG *log.Logger ERR *log.Logger INFO *log.Logger WARN *log.Logger // contains filtered or unexported fields }
SimpleLogger is the default implment of core.ILogger
func NewSimpleLogger ¶
func NewSimpleLogger(out io.Writer) *SimpleLogger
NewSimpleLogger use a special io.Writer as logger output
func NewSimpleLogger2 ¶
func NewSimpleLogger2(out io.Writer, prefix string, flag int) *SimpleLogger
NewSimpleLogger2 let you customrize your logger prefix and flag
func NewSimpleLogger3 ¶
NewSimpleLogger3 let you customrize your logger prefix and flag and logLevel
func (*SimpleLogger) Debug ¶
func (s *SimpleLogger) Debug(v ...interface{})
Debug implement core.ILogger
func (*SimpleLogger) Debugf ¶
func (s *SimpleLogger) Debugf(format string, v ...interface{})
Debugf implement core.ILogger
func (*SimpleLogger) Error ¶
func (s *SimpleLogger) Error(v ...interface{})
Error implement core.ILogger
func (*SimpleLogger) Errorf ¶
func (s *SimpleLogger) Errorf(format string, v ...interface{})
Errorf implement core.ILogger
func (*SimpleLogger) Info ¶
func (s *SimpleLogger) Info(v ...interface{})
Info implement core.ILogger
func (*SimpleLogger) Infof ¶
func (s *SimpleLogger) Infof(format string, v ...interface{})
Infof implement core.ILogger
func (*SimpleLogger) IsShowSQL ¶
func (s *SimpleLogger) IsShowSQL() bool
IsShowSQL implement core.ILogger
func (*SimpleLogger) Level ¶
func (s *SimpleLogger) Level() core.LogLevel
Level implement core.ILogger
func (*SimpleLogger) SetLevel ¶
func (s *SimpleLogger) SetLevel(l core.LogLevel)
SetLevel implement core.ILogger
func (*SimpleLogger) ShowSQL ¶
func (s *SimpleLogger) ShowSQL(show ...bool)
ShowSQL implement core.ILogger
func (*SimpleLogger) Warn ¶
func (s *SimpleLogger) Warn(v ...interface{})
Warn implement core.ILogger
func (*SimpleLogger) Warnf ¶
func (s *SimpleLogger) Warnf(format string, v ...interface{})
Warnf implement core.ILogger
type SqlMapOptions ¶
type SqlMapsExecutor ¶
type SqlMapsExecutor struct {
// contains filtered or unexported fields
}
type SqlTemplate ¶
type SqlTemplateOptions ¶
type SqlTemplatesExecutor ¶
type SqlTemplatesExecutor struct {
// contains filtered or unexported fields
}
type SqlsExecutor ¶
type SqlsExecutor struct {
// contains filtered or unexported fields
}
type Statement ¶
type Statement struct { RefTable *core.Table Engine *Engine Start int LimitN int OrderStr string JoinStr string GroupByStr string HavingStr string ColumnStr string OmitStr string AltTableName string RawSQL string RawParams []interface{} UseCascade bool UseAutoJoin bool StoreEngine string Charset string UseCache bool UseAutoTime bool IsDistinct bool IsForUpdate bool TableAlias string // contains filtered or unexported fields }
Statement save all the sql info for executing SQL
func (*Statement) ID ¶
ID generate "where id = ? " statement or for composite key "where key1 = ? and key2 = ?"
func (*Statement) Join ¶
func (statement *Statement) Join(joinOP string, tablename interface{}, condition string, args ...interface{}) *Statement
Join The joinOP should be one of INNER, LEFT OUTER, CROSS etc - this will be prepended to JOIN
func (*Statement) NoAutoCondition ¶
NoAutoCondition if you do not want convert bean's field as query condition, then use this function
func (*Statement) Nullable ¶
Nullable Update use only: update columns to null when value is nullable and zero-value
func (*Statement) Table ¶
Table tempororily set table name, the parameter could be a string or a pointer of struct
type StringSet ¶
type StringSet struct {
// contains filtered or unexported fields
}
func NewStringSet ¶
func NewStringSet() *StringSet
func (*StringSet) ItemByIndex ¶
type SyslogLogger ¶
type SyslogLogger struct {
// contains filtered or unexported fields
}
SyslogLogger will be depricated
func NewSyslogLogger ¶
func NewSyslogLogger(w *syslog.Writer) *SyslogLogger
NewSyslogLogger implements core.ILogger
func (*SyslogLogger) Debug ¶
func (s *SyslogLogger) Debug(v ...interface{})
Debug log content as Debug
func (*SyslogLogger) Debugf ¶
func (s *SyslogLogger) Debugf(format string, v ...interface{})
Debugf log content as Debug and format
func (*SyslogLogger) Error ¶
func (s *SyslogLogger) Error(v ...interface{})
Error log content as Error
func (*SyslogLogger) Errorf ¶
func (s *SyslogLogger) Errorf(format string, v ...interface{})
Errorf log content as Errorf and format
func (*SyslogLogger) Infof ¶
func (s *SyslogLogger) Infof(format string, v ...interface{})
Infof log content as Infof and format
func (*SyslogLogger) SetLevel ¶
func (s *SyslogLogger) SetLevel(l core.LogLevel)
SetLevel always return error, as current log/syslog package doesn't allow to set priority level after syslog.Writer created
func (*SyslogLogger) ShowSQL ¶
func (s *SyslogLogger) ShowSQL(show ...bool)
ShowSQL set if logging SQL
func (*SyslogLogger) Warnf ¶
func (s *SyslogLogger) Warnf(format string, v ...interface{})
Warnf log content as Warnf and format
type TableName ¶
type TableName interface {
TableName() string
}
TableName table name interface to define customerize table name
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
func (*Transaction) Commit ¶
func (transaction *Transaction) Commit() error
Commit When using transaction, Commit will commit all operations.
func (*Transaction) Do ¶
func (transaction *Transaction) Do(doFunc func(params ...interface{}), params ...interface{})
func (*Transaction) GetSavePointID ¶
func (transaction *Transaction) GetSavePointID() string
func (*Transaction) IsExistingTransaction ¶
func (transaction *Transaction) IsExistingTransaction() bool
func (*Transaction) Rollback ¶
func (transaction *Transaction) Rollback() error
Rollback When using transaction, you can rollback if any error
func (*Transaction) RollbackToSavePoint ¶
func (transaction *Transaction) RollbackToSavePoint(savePointID string) error
func (*Transaction) SavePoint ¶
func (transaction *Transaction) SavePoint(savePointID string) error
func (*Transaction) Session ¶
func (transaction *Transaction) Session() *Session
func (*Transaction) TransactionDefinition ¶
func (transaction *Transaction) TransactionDefinition() int
func (*Transaction) WaitForDo ¶
func (transaction *Transaction) WaitForDo(doFunc func(params ...interface{}), params ...interface{})
type TripleDesEncrypt ¶
type TripleDesEncrypt struct {
PubKey string
}
type UUID ¶
type UUID [16]byte
The UUID represents Universally Unique IDentifier (which is 128 bit long).
func FromString ¶
FromString returns UUID parsed from string input. Input is expected in a form accepted by UnmarshalText.
func NewNamespaceUUID ¶
NewNamespaceUUID creates a namespace UUID by using the namespace name in the NIL name space. This is a different approach as the 4 "standard" namespace UUIDs which are timebased UUIDs (V1).
func NewV1 ¶
func NewV1() *UUID
NewV1 creates a new UUID with variant 1 as described in RFC 4122. Variant 1 is based on hosts MAC address and actual timestamp (as count of 100-nanosecond intervals since 00:00:00.00, 15 October 1582 (the date of Gregorian reform to the Christian calendar).
func NewV3 ¶
NewV3 creates a new UUID with variant 3 as described in RFC 4122. Variant 3 based namespace-uuid and name and MD-5 hash calculation.
func NewV4 ¶
func NewV4() *UUID
NewV4 creates a new UUID with variant 4 as described in RFC 4122. Variant 4 based on pure random bytes.
func NewV5 ¶
NewV5 creates a new UUID with variant 5 as described in RFC 4122. Variant 5 based namespace-uuid and name and SHA-1 hash calculation.
func (*UUID) UnmarshalText ¶
func (*UUID) WithoutDashString ¶
type XmlInclude ¶
type XmlInclude struct {
RefId string `xml:"refid,attr"`
}
type XmlMapper ¶
type XmlMapper struct { Namespace string `xml:"namespace,attr"` Sqls []XmlSql `xml:"sql"` Inserts []XmlInsert `xml:"insert"` Deletes []XmlDelete `xml:"delete"` Selects []XmlSelect `xml:"select"` Updates []XmlUpdate `xml:"update"` }
func UnmarshalXml ¶
func (*XmlMapper) ParseMapper ¶
Source Files ¶
- aes.go
- cipher.go
- convert.go
- databook.go
- dataset.go
- des.go
- engine.go
- engineplus.go
- error.go
- fswatcher.go
- goracle_driver.go
- helpers.go
- helpersplus.go
- logger.go
- lru_cacher.go
- memroy_store.go
- mssql_dialect.go
- mymysql_driver.go
- mysql_dialect.go
- mysql_driver.go
- oci8_driver.go
- odbc_driver.go
- oracle_dialect.go
- postgres_dialect.go
- pq_driver.go
- processors.go
- rows.go
- rsa.go
- session.go
- session_cond.go
- session_delete.go
- session_find.go
- session_get.go
- session_insert.go
- session_iterate.go
- session_raw.go
- session_schema.go
- session_sum.go
- session_tx.go
- session_tx_plus.go
- session_update.go
- sessionplus.go
- sql_executor.go
- sqlite3_dialect.go
- sqlite3_driver.go
- sqlmap.go
- sqlmaps_executor.go
- sqltemplate.go
- sqltemplates_executor.go
- statement.go
- syslogger.go
- types.go
- uuid.go
- xml_mapper.go
- xorm.go
- xormplus.go