mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
Update TDengine
This commit is contained in:
parent
08fed0fda6
commit
4efd60a536
@ -6,7 +6,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="TDengine.Ado.Data" Version="1.6.10" />
|
<PackageReference Include="TDengine.Ado.Data" Version="1.6.13" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -226,7 +226,16 @@ namespace SqlSugar.TDengine
|
|||||||
{
|
{
|
||||||
var db=this.Context.CopyNew();
|
var db=this.Context.CopyNew();
|
||||||
db.Ado.Connection.ChangeDatabase("");
|
db.Ado.Connection.ChangeDatabase("");
|
||||||
db.Ado.ExecuteCommand(string.Format(CreateDataBaseSql,databaseName));
|
var sql = CreateDataBaseSql;
|
||||||
|
if (this.Context.CurrentConnectionConfig.ConnectionString.ToLower().Contains("config_us"))
|
||||||
|
{
|
||||||
|
sql += " PRECISION 'us'";
|
||||||
|
}
|
||||||
|
else if (this.Context.CurrentConnectionConfig.ConnectionString.ToLower().Contains("config_ns"))
|
||||||
|
{
|
||||||
|
sql += " PRECISION 'ns'";
|
||||||
|
}
|
||||||
|
db.Ado.ExecuteCommand(string.Format(sql, databaseName));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
public override List<string> GetIndexList(string tableName)
|
public override List<string> GetIndexList(string tableName)
|
||||||
|
@ -101,6 +101,10 @@ namespace SqlSugar.TDengine
|
|||||||
{
|
{
|
||||||
sqlParameter.IsMicrosecond= true;
|
sqlParameter.IsMicrosecond= true;
|
||||||
}
|
}
|
||||||
|
else if (parameter.CustomDbType?.Equals(typeof(Date19))==true)
|
||||||
|
{
|
||||||
|
sqlParameter.IsNanosecond = true;
|
||||||
|
}
|
||||||
result[i]=sqlParameter;
|
result[i]=sqlParameter;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
28
Src/Asp.NetCore2/SqlSugar.TDengineCore/Tools/DateTime19.cs
Normal file
28
Src/Asp.NetCore2/SqlSugar.TDengineCore/Tools/DateTime19.cs
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace SqlSugar
|
||||||
|
{
|
||||||
|
internal enum Date19
|
||||||
|
{
|
||||||
|
time=19
|
||||||
|
}
|
||||||
|
public class DateTime19: ISugarDataConverter
|
||||||
|
{
|
||||||
|
public SugarParameter ParameterConverter<T>(object columnValue, int columnIndex)
|
||||||
|
{
|
||||||
|
var name = "@Common" + columnIndex;
|
||||||
|
Type undertype = SqlSugar.UtilMethods.GetUnderType(typeof(T));//获取没有nullable的枚举类型
|
||||||
|
return new SugarParameter(name, columnValue, undertype) { CustomDbType= typeof(Date19) };
|
||||||
|
}
|
||||||
|
|
||||||
|
public T QueryConverter<T>(IDataRecord dr, int i)
|
||||||
|
{
|
||||||
|
|
||||||
|
var value = dr.GetValue(i);
|
||||||
|
return (T)UtilMethods.ChangeType2(value, typeof(T));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user