func (db *Sqlite) BeginTx() *sql.Tx {
	return CommonBeginTxWithLevel(db.DbList["default"], sql.LevelDefault)
}
BeginTx starts a transaction with level LevelDefault.
package db
import (
	"database/sql"
	"github.com/GoAdminGroup/go-admin/modules/config"
)
type Sqlite struct {
	Base
}
func GetSqliteDB() *Sqlite {
	return &Sqlite{
		Base: Base{
			DbList: make(map[string]*sql.DB),
		},
	}
}
func (db *Sqlite) Name() string {
	return "sqlite"
}
func (db *Sqlite) GetDelimiter() string {
	return "`"
}
func (db *Sqlite) GetDelimiter2() string {
	return "`"
}
func (db *Sqlite) GetDelimiters() []string {
	return []string{"`", "`"}
}
func (db *Sqlite) QueryWithConnection(con string, query string, args ...interface{}) ([]map[string]interface{}, error) {
	return CommonQuery(db.DbList[con], query, args...)
}
func (db *Sqlite) ExecWithConnection(con string, query string, args ...interface{}) (sql.Result, error) {
	return CommonExec(db.DbList[con], query, args...)
}
func (db *Sqlite) Query(query string, args ...interface{}) ([]map[string]interface{}, error) {
	return CommonQuery(db.DbList["default"], query, args...)
}
func (db *Sqlite) Exec(query string, args ...interface{}) (sql.Result, error) {
	return CommonExec(db.DbList["default"], query, args...)
}
func (db *Sqlite) QueryWith(tx *sql.Tx, conn, query string, args ...interface{}) ([]map[string]interface{}, error) {
	if tx != nil {
		return db.QueryWithTx(tx, query, args...)
	}
	return db.QueryWithConnection(conn, query, args...)
}
func (db *Sqlite) ExecWith(tx *sql.Tx, conn, query string, args ...interface{}) (sql.Result, error) {
	if tx != nil {
		return db.ExecWithTx(tx, query, args...)
	}
	return db.ExecWithConnection(conn, query, args...)
}
func (db *Sqlite) InitDB(cfgList map[string]config.Database) Connection {
	db.Configs = cfgList
	db.Once.Do(func() {
		for conn, cfg := range cfgList {
			sqlDB, err := sql.Open("sqlite3", cfg.GetDSN())
			if err != nil {
				panic(err)
			}
			sqlDB.SetMaxIdleConns(cfg.MaxIdleCon)
			sqlDB.SetMaxOpenConns(cfg.MaxOpenCon)
			db.DbList[conn] = sqlDB
			if err := sqlDB.Ping(); err != nil {
				panic(err)
			}
		}
	})
	return db
}
func (db *Sqlite) BeginTxWithReadUncommitted() *sql.Tx {
	return CommonBeginTxWithLevel(db.DbList["default"], sql.LevelReadUncommitted)
}
func (db *Sqlite) BeginTxWithReadCommitted() *sql.Tx {
	return CommonBeginTxWithLevel(db.DbList["default"], sql.LevelReadCommitted)
}
func (db *Sqlite) BeginTxWithRepeatableRead() *sql.Tx {
	return CommonBeginTxWithLevel(db.DbList["default"], sql.LevelRepeatableRead)
}