Skip to content

Commit

Permalink
- 调整 命名空间 FreeSql.Provider.ClickHouse.Attributes -> FreeSql.DataAnnot…
Browse files Browse the repository at this point in the history
…ations;#1815
  • Loading branch information
2881099 committed May 30, 2024
1 parent 2754fe2 commit 6bf4c21
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Text;

namespace FreeSql.Provider.ClickHouse.Attributes
namespace FreeSql.DataAnnotations
{
[AttributeUsage(AttributeTargets.Property)]
public class ClickHousePartitionAttribute : Attribute
Expand Down
8 changes: 3 additions & 5 deletions Providers/FreeSql.Provider.ClickHouse/ClickHouseCodeFirst.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using System.Reflection;
using FreeSql.Internal.ObjectPool;
using ClickHouse.Client.ADO;
using FreeSql.Provider.ClickHouse.Attributes;
using FreeSql.DataAnnotations;

namespace FreeSql.ClickHouse
{
Expand Down Expand Up @@ -97,8 +97,7 @@ public override DbInfoResult GetDbInfo(Type type)
{
var arrayDbType = $"Array({value.dbtype})";
var defaultArray = new ArrayList(0);
return new DbInfoResult(Convert.ToInt32(DbType.Object), arrayDbType, arrayDbType, false,
defaultArray);
return new DbInfoResult(Convert.ToInt32(DbType.Object), arrayDbType, arrayDbType, false, defaultArray);
}
}

Expand Down Expand Up @@ -176,8 +175,7 @@ protected override string GetComparisonDDLStatements(params TypeSchemaAndName[]
if (tb == null)
throw new Exception(CoreStrings.S_Type_IsNot_Migrable(obj.tableSchema.Type.FullName));
if (tb.Columns.Any() == false)
throw new Exception(
CoreStrings.S_Type_IsNot_Migrable_0Attributes(obj.tableSchema.Type.FullName));
throw new Exception(CoreStrings.S_Type_IsNot_Migrable_0Attributes(obj.tableSchema.Type.FullName));
var tbname = _commonUtils.SplitTableName(tb.DbName);
if (tbname?.Length == 1)
tbname = new[] { database, tbname[0] };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public override void ToSqlExtension110(StringBuilder sb, bool isAsTableSplited)
var colsql = _noneParameter ? _commonUtils.GetNoneParamaterSqlValue(_paramsSource, "u", col, col.Attribute.MapType, val) :
_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?) )
{
//获取当前实时区
Expand Down

0 comments on commit 6bf4c21

Please sign in to comment.