perf(scan): 使用缓存减少对象扫描
抽取函数,优化变量命名 支持了传入数组类型
This commit is contained in:
@@ -11,14 +11,14 @@ import (
|
||||
// buildInsertStatementForSuperTable 构建超级表插入语句
|
||||
// @param rows 同一超级表下的数据行
|
||||
// @return 插入语句
|
||||
func buildInsertStatementForSuperTable(rows ...*TableRowMateria) (string, error) {
|
||||
func buildInsertStatementForSuperTable(rows ...*TableRowMaterial) (string, error) {
|
||||
if len(rows) == 0 {
|
||||
return "", fmt.Errorf("no rows provided for super table insert")
|
||||
}
|
||||
|
||||
var sb strings.Builder
|
||||
|
||||
// 格式化标签列和值
|
||||
// 开始格式化标签和值
|
||||
formattedTagColumns := formatColumns(rows[0].TagColumns...)
|
||||
formattedTagValues := formatRowValues(rows[0].TagValues...)
|
||||
formattedColumns := formatColumns(rows[0].Columns...)
|
||||
@@ -56,7 +56,7 @@ func buildInsertStatementForSuperTable(rows ...*TableRowMateria) (string, error)
|
||||
// buildInsertStatementForNormalTable 普通表插入构建
|
||||
// @param data 数据 当前应该是同一个表的
|
||||
// @return 插入语句 表名1 (列名) VALUES (),()
|
||||
func buildInsertStatementForNormalTable(rows ...*TableRowMateria) (string, error) {
|
||||
func buildInsertStatementForNormalTable(rows ...*TableRowMaterial) (string, error) {
|
||||
if len(rows) == 0 {
|
||||
return "", fmt.Errorf("no data provided for normal table insert")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user