|
@ -25,7 +25,7 @@ func TxInsert(tx *sql.Tx, dbname, table string, data map[string]string) (int64, |
|
|
if strings.Contains(table, "select ") { |
|
|
if strings.Contains(table, "select ") { |
|
|
dbName = table |
|
|
dbName = table |
|
|
} else { |
|
|
} else { |
|
|
dbName = getTableName(dbName, table) |
|
|
|
|
|
|
|
|
dbName = getTableName(dbname, table) |
|
|
} |
|
|
} |
|
|
if len(data) < 1 { |
|
|
if len(data) < 1 { |
|
|
return 0, errors.New("参数错误,没有要写入的数据") |
|
|
return 0, errors.New("参数错误,没有要写入的数据") |
|
@ -186,7 +186,7 @@ func TxPreUpdate(tx *sql.Tx, dbname, table string, data []string, where []string |
|
|
if strings.Contains(table, "select ") { |
|
|
if strings.Contains(table, "select ") { |
|
|
dbName = table |
|
|
dbName = table |
|
|
} else { |
|
|
} else { |
|
|
dbName = getTableName(dbName, table) |
|
|
|
|
|
|
|
|
dbName = getTableName(dbname, table) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if len(where) < 1 { |
|
|
if len(where) < 1 { |
|
@ -228,7 +228,7 @@ func TxDelete(tx *sql.Tx, dbname, table string, where map[string]string, del_cou |
|
|
if strings.Contains(table, "select ") { |
|
|
if strings.Contains(table, "select ") { |
|
|
dbName = table |
|
|
dbName = table |
|
|
} else { |
|
|
} else { |
|
|
dbName = getTableName(dbName, table) |
|
|
|
|
|
|
|
|
dbName = getTableName(dbname, table) |
|
|
} |
|
|
} |
|
|
if len(where) < 1 { |
|
|
if len(where) < 1 { |
|
|
return count, errors.New("参数错误,没有删除条件") |
|
|
return count, errors.New("参数错误,没有删除条件") |
|
|