Clickhouse 数组参数化测试

This commit is contained in:
d4ilys
2023-11-21 14:21:11 +08:00
parent d91c7fbdfd
commit 8e2aa2b44b
4 changed files with 53 additions and 16 deletions

View File

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Data.Common;
using System.Globalization;
using System.Data;
using System.Text.Json;
using ClickHouse.Client.ADO.Parameters;
using System.Text.RegularExpressions;
@ -18,7 +19,7 @@ namespace FreeSql.ClickHouse
}
public override DbParameter AppendParamter(List<DbParameter> _params, string parameterName, ColumnInfo col, Type type, object value)
{
{
if (value is string str)
value = str?.Replace("\t", "\\t")
.Replace("\r\n", "\\r\\n")
@ -43,9 +44,10 @@ namespace FreeSql.ClickHouse
if (col.DbScale != 0) ret.Scale = col.DbScale;
break;
}
//直接使用Bool
//if (value is bool)
// ret.Value = (bool)value ? 1 : 0;
//if (value.GetType().IsArray)
//{
// ret.DbType = DbType.Object;
//}
}
_params?.Add(ret);
return ret;