mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Update Clickhouse array type bug
This commit is contained in:
parent
54e3a079ff
commit
5eaffa700e
@ -25,7 +25,7 @@ namespace SqlSugar.ClickHouse
|
||||
}
|
||||
}
|
||||
int i = 0;
|
||||
public object FormatValue(object value, string name)
|
||||
public object FormatValue(object value, string name,DbColumnInfo dbColumnInfo)
|
||||
{
|
||||
var n = "";
|
||||
if (this.Context.CurrentConnectionConfig.MoreSettings != null && this.Context.CurrentConnectionConfig.MoreSettings.DisableNvarchar)
|
||||
@ -63,6 +63,14 @@ namespace SqlSugar.ClickHouse
|
||||
return Convert.ToInt64(value);
|
||||
}
|
||||
}
|
||||
else if (dbColumnInfo.IsArray&& value!=null)
|
||||
{
|
||||
return n+"'"+this.Context.Utilities.SerializeObject(value)+"'";
|
||||
}
|
||||
else if (dbColumnInfo.IsJson && value != null)
|
||||
{
|
||||
return n + "'" + this.Context.Utilities.SerializeObject(value) + "'";
|
||||
}
|
||||
else if (type == UtilConstants.BoolType)
|
||||
{
|
||||
return value.ObjToBool() ? "1" : "0";
|
||||
@ -144,7 +152,7 @@ namespace SqlSugar.ClickHouse
|
||||
foreach (var item in groupList)
|
||||
{
|
||||
batchInsetrSql.Append("(");
|
||||
insertColumns = string.Join(",", item.Select(it =>base.GetDbColumn(it, FormatValue(it.Value, it.PropertyName))));
|
||||
insertColumns = string.Join(",", item.Select(it =>base.GetDbColumn(it, FormatValue(it.Value, it.PropertyName,it))));
|
||||
batchInsetrSql.Append(insertColumns);
|
||||
if (groupList.Last() == item)
|
||||
{
|
||||
|
@ -114,9 +114,9 @@ namespace SqlSugar.ClickHouse
|
||||
}
|
||||
private string GetOracleUpdateColums(int i, DbColumnInfo m, bool iswhere)
|
||||
{
|
||||
return string.Format("\"{0}\"={1}", m.DbColumnName, base.GetDbColumn(m,FormatValue(i, m.DbColumnName, m.Value, iswhere)));
|
||||
return string.Format("\"{0}\"={1}", m.DbColumnName, base.GetDbColumn(m,FormatValue(i, m.DbColumnName, m.Value, iswhere,m)));
|
||||
}
|
||||
public object FormatValue(int i, string name, object value, bool iswhere)
|
||||
public object FormatValue(int i, string name, object value, bool iswhere,DbColumnInfo dbColumnInfo)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
@ -158,6 +158,14 @@ namespace SqlSugar.ClickHouse
|
||||
return Convert.ToInt64(value);
|
||||
}
|
||||
}
|
||||
else if (dbColumnInfo.IsArray && value != null)
|
||||
{
|
||||
return n + "'" + this.Context.Utilities.SerializeObject(value) + "'";
|
||||
}
|
||||
else if (dbColumnInfo.IsJson && value != null)
|
||||
{
|
||||
return n + "'" + this.Context.Utilities.SerializeObject(value) + "'";
|
||||
}
|
||||
else if (type == UtilConstants.ByteArrayType)
|
||||
{
|
||||
var parameterName = this.Builder.SqlParameterKeyWord + name + i;
|
||||
|
Loading…
Reference in New Issue
Block a user