func (engine *Engine) DB() *core.DB {
	return engine.db
}
DB return the wrapper of sql.DB
package xorm
import (
	"bufio"
	"bytes"
	"database/sql"
	"encoding/gob"
	"errors"
	"fmt"
	"io"
	"os"
	"reflect"
	"strconv"
	"strings"
	"sync"
	"time"
	"github.com/go-xorm/builder"
	"github.com/go-xorm/core"
)
type Engine struct {
	db      *core.DB
	dialect core.Dialect
	ColumnMapper  core.IMapper
	TableMapper   core.IMapper
	TagIdentifier string
	Tables        map[reflect.Type]*core.Table
	mutex  *sync.RWMutex
	Cacher core.Cacher
	showSQL      bool
	showExecTime bool
	logger     core.ILogger
	TZLocation *time.Location  
	DatabaseTZ *time.Location  
	disableGlobalCache bool
	tagHandlers map[string]tagHandler
	engineGroup *EngineGroup
}
func (engine *Engine) BufferSize(size int) *Session {
	session := engine.NewSession()
	session.isAutoClose = true
	return session.BufferSize(size)
}
func (engine *Engine) CondDeleted(colName string) builder.Cond {
	if engine.dialect.DBType() == core.MSSQL {
		return builder.IsNull{colName}
	}
	return builder.IsNull{colName}.Or(builder.Eq{colName: zeroTime1})
}
func (engine *Engine) ShowSQL(show ...bool) {
	engine.logger.ShowSQL(show...)
	if len(show) == 0 {
		engine.showSQL = true
	} else {
		engine.showSQL = show[0]
	}
}
func (engine *Engine) ShowExecTime(show ...bool) {
	if len(show) == 0 {
		engine.showExecTime = true
	} else {
		engine.showExecTime = show[0]
	}
}
func (engine *Engine) Logger() core.ILogger {
	return engine.logger
}
func (engine *Engine) SetLogger(logger core.ILogger) {
	engine.logger = logger
	engine.dialect.SetLogger(logger)
}
func (engine *Engine) SetLogLevel(level core.LogLevel) {
	engine.logger.SetLevel(level)
}
func (engine *Engine) SetDisableGlobalCache(disable bool) {
	if engine.disableGlobalCache != disable {
		engine.disableGlobalCache = disable
	}
}
func (engine *Engine) DriverName() string {
	return engine.dialect.DriverName()
}
func (engine *Engine) DataSourceName() string {
	return engine.dialect.DataSourceName()
}
func (engine *Engine) SetMapper(mapper core.IMapper) {
	engine.SetTableMapper(mapper)
	engine.SetColumnMapper(mapper)
}
func (engine *Engine) SetTableMapper(mapper core.IMapper) {
	engine.TableMapper = mapper
}
func (engine *Engine) SetColumnMapper(mapper core.IMapper) {
	engine.ColumnMapper = mapper
}
func (engine *Engine) SupportInsertMany() bool {
	return engine.dialect.SupportInsertMany()
}
func (engine *Engine) QuoteStr() string {
	return engine.dialect.QuoteStr()
}
func (engine *Engine) Quote(value string) string {
	value = strings.TrimSpace(value)
	if len(value) == 0 {
		return value
	}
	if string(value[0]) == engine.dialect.QuoteStr() || value[0] == '`' {
		return value
	}
	value = strings.Replace(value, ".", engine.dialect.QuoteStr()+"."+engine.dialect.QuoteStr(), -1)
	return engine.dialect.QuoteStr() + value + engine.dialect.QuoteStr()
}
func (engine *Engine) QuoteTo(buf *bytes.Buffer, value string) {
	if buf == nil {
		return
	}
	value = strings.TrimSpace(value)
	if value == "" {
		return
	}
	if string(value[0]) == engine.dialect.QuoteStr() || value[0] == '`' {
		buf.WriteString(value)
		return
	}
	value = strings.Replace(value, ".", engine.dialect.QuoteStr()+"."+engine.dialect.QuoteStr(), -1)
	buf.WriteString(engine.dialect.QuoteStr())
	buf.WriteString(value)
	buf.WriteString(engine.dialect.QuoteStr())
}
func (engine *Engine) quote(sql string) string {
	return engine.dialect.QuoteStr() + sql + engine.dialect.QuoteStr()
}
func (engine *Engine) SqlType(c *core.Column) string {
	return engine.SQLType(c)
}
func (engine *Engine) SQLType(c *core.Column) string {
	return engine.dialect.SqlType(c)
}
func (engine *Engine) AutoIncrStr() string {
	return engine.dialect.AutoIncrStr()
}
func (engine *Engine) SetMaxOpenConns(conns int) {
	engine.db.SetMaxOpenConns(conns)
}
func (engine *Engine) SetMaxIdleConns(conns int) {
	engine.db.SetMaxIdleConns(conns)
}
func (engine *Engine) SetDefaultCacher(cacher core.Cacher) {
	engine.Cacher = cacher
}
func (engine *Engine) GetDefaultCacher() core.Cacher {
	return engine.Cacher
}
func (engine *Engine) NoCache() *Session {
	session := engine.NewSession()
	session.isAutoClose = true
	return session.NoCache()
}
func (engine *Engine) NoCascade() *Session {
	session := engine.NewSession()
	session.isAutoClose = true
	return session.NoCascade()
}
func (engine *Engine) MapCacher(bean interface{}, cacher core.Cacher) error {
	v := rValue(bean)
	tb, err := engine.autoMapType(v)
	if err != nil {
		return err
	}
	tb.Cacher = cacher
	return nil
}
func (engine *Engine) NewDB() (*core.DB, error) {
	return core.OpenDialect(engine.dialect)
}