add: update export table task
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package dborm
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
@@ -85,11 +86,16 @@ func Close() {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取默认数据源
|
||||
// default gorm DB
|
||||
func DefaultDB() *gorm.DB {
|
||||
return dbgEngine
|
||||
}
|
||||
|
||||
// get sql DB
|
||||
func GCoreDB() (*sql.DB, error) {
|
||||
return dbgEngine.DB()
|
||||
}
|
||||
|
||||
// RawSQL 原生查询语句
|
||||
func RawSQL(sql string, parameters []any) ([]map[string]any, error) {
|
||||
// 数据源
|
||||
|
||||
@@ -16,6 +16,7 @@ import (
|
||||
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
"xorm.io/xorm"
|
||||
"xorm.io/xorm/core"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -124,6 +125,10 @@ func XormConnectDatabase(dbType, dbUser, dbPassword, dbHost, dbPort, dbName stri
|
||||
return xEngine, nil
|
||||
}
|
||||
|
||||
func XCoreDB() *core.DB {
|
||||
return xEngine.DB()
|
||||
}
|
||||
|
||||
func ConstructInsertSQL(tableName string, insertData interface{}) (string, []string) {
|
||||
log.Debug("ConstructInsertSQL processing... ")
|
||||
log.Debug("Request insertData:", insertData)
|
||||
|
||||
Reference in New Issue
Block a user