mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 02:32:50 +08:00
- 调整 命名空间 FreeSql.Provider.ClickHouse.Attributes -> FreeSql.DataAnnotations;#1815
This commit is contained in:
parent
2754fe2393
commit
6bf4c21af0
@ -2,7 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace FreeSql.Provider.ClickHouse.Attributes
|
namespace FreeSql.DataAnnotations
|
||||||
{
|
{
|
||||||
[AttributeUsage(AttributeTargets.Property)]
|
[AttributeUsage(AttributeTargets.Property)]
|
||||||
public class ClickHousePartitionAttribute : Attribute
|
public class ClickHousePartitionAttribute : Attribute
|
||||||
|
@ -11,7 +11,7 @@ using System.Data.Common;
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using FreeSql.Internal.ObjectPool;
|
using FreeSql.Internal.ObjectPool;
|
||||||
using ClickHouse.Client.ADO;
|
using ClickHouse.Client.ADO;
|
||||||
using FreeSql.Provider.ClickHouse.Attributes;
|
using FreeSql.DataAnnotations;
|
||||||
|
|
||||||
namespace FreeSql.ClickHouse
|
namespace FreeSql.ClickHouse
|
||||||
{
|
{
|
||||||
@ -97,8 +97,7 @@ namespace FreeSql.ClickHouse
|
|||||||
{
|
{
|
||||||
var arrayDbType = $"Array({value.dbtype})";
|
var arrayDbType = $"Array({value.dbtype})";
|
||||||
var defaultArray = new ArrayList(0);
|
var defaultArray = new ArrayList(0);
|
||||||
return new DbInfoResult(Convert.ToInt32(DbType.Object), arrayDbType, arrayDbType, false,
|
return new DbInfoResult(Convert.ToInt32(DbType.Object), arrayDbType, arrayDbType, false, defaultArray);
|
||||||
defaultArray);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,8 +175,7 @@ namespace FreeSql.ClickHouse
|
|||||||
if (tb == null)
|
if (tb == null)
|
||||||
throw new Exception(CoreStrings.S_Type_IsNot_Migrable(obj.tableSchema.Type.FullName));
|
throw new Exception(CoreStrings.S_Type_IsNot_Migrable(obj.tableSchema.Type.FullName));
|
||||||
if (tb.Columns.Any() == false)
|
if (tb.Columns.Any() == false)
|
||||||
throw new Exception(
|
throw new Exception(CoreStrings.S_Type_IsNot_Migrable_0Attributes(obj.tableSchema.Type.FullName));
|
||||||
CoreStrings.S_Type_IsNot_Migrable_0Attributes(obj.tableSchema.Type.FullName));
|
|
||||||
var tbname = _commonUtils.SplitTableName(tb.DbName);
|
var tbname = _commonUtils.SplitTableName(tb.DbName);
|
||||||
if (tbname?.Length == 1)
|
if (tbname?.Length == 1)
|
||||||
tbname = new[] { database, tbname[0] };
|
tbname = new[] { database, tbname[0] };
|
||||||
|
@ -169,7 +169,7 @@ namespace FreeSql.ClickHouse.Curd
|
|||||||
var colsql = _noneParameter ? _commonUtils.GetNoneParamaterSqlValue(_paramsSource, "u", col, col.Attribute.MapType, val) :
|
var colsql = _noneParameter ? _commonUtils.GetNoneParamaterSqlValue(_paramsSource, "u", col, col.Attribute.MapType, val) :
|
||||||
_commonUtils.QuoteWriteParamterAdapter(col.Attribute.MapType, _commonUtils.QuoteParamterName($"p_{_paramsSource.Count}"));
|
_commonUtils.QuoteWriteParamterAdapter(col.Attribute.MapType, _commonUtils.QuoteParamterName($"p_{_paramsSource.Count}"));
|
||||||
|
|
||||||
//判断是否是DateTime类型,如果是DateTime类型,需要转换成ClickHouse支持的时间格式
|
//判断是否是DateTime类型,如果是DateTime类型,需要转换成ClickHouse支持的时间格式 #1813
|
||||||
if (col.Attribute.MapType == typeof(DateTime) || col.Attribute.MapType == typeof(DateTime?) )
|
if (col.Attribute.MapType == typeof(DateTime) || col.Attribute.MapType == typeof(DateTime?) )
|
||||||
{
|
{
|
||||||
//获取当前实时区
|
//获取当前实时区
|
||||||
|
Loading…
x
Reference in New Issue
Block a user