增加执行任意sql的能力

This commit is contained in:
2023-09-30 16:39:11 +08:00
parent a282d18786
commit 11cde6cc4f
3 changed files with 67 additions and 16 deletions

View File

@ -137,3 +137,21 @@ func (sd *SystemDao) GetTableInfo(dbInstance *gorm.DB, database string, tableNam
}).Scan(&list).Error
return list, err
}
// CreateTable 创建数据表
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 16:34 2023/9/30
func (sd *SystemDao) CreateTable(dbInstance *gorm.DB, createTableSql string) error {
return sd.ExecuteSql(dbInstance, createTableSql)
}
// ExecuteSql 执行任意sql语句
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 16:35 2023/9/30
func (sd *SystemDao) ExecuteSql(dbInstance *gorm.DB, anySql string, value ...interface{}) error {
return dbInstance.Exec(anySql, value...).Error
}