Skip to content

Commit

Permalink
升级ef依赖。
Browse files Browse the repository at this point in the history
  • Loading branch information
maikebing committed Dec 15, 2023
1 parent 826e6b0 commit fec67ad
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 67 deletions.
10 changes: 5 additions & 5 deletions src/EFCore.Taos.Core/IoTSharp.EntityFrameworkCore.Taos.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
<Compile Include="..\Shared\*.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="6.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.3">
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.3" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\docs\logo.png">
Expand Down
7 changes: 1 addition & 6 deletions src/EFCore.Taos.Core/Query/Internal/TaosQuerySqlGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,7 @@ protected override Expression VisitTable(TableExpression tableExpression)
return tableExpression;
}

[System.Obsolete]
protected override string GenerateOperator(SqlBinaryExpression binaryExpression)
=> binaryExpression.OperatorType == ExpressionType.Add
&& binaryExpression.Type == typeof(string)
? " || "
: base.GetOperator(binaryExpression);


protected override void GenerateLimitOffset(SelectExpression selectExpression)
{
Expand Down
41 changes: 3 additions & 38 deletions src/EFCore.Taos.Core/Update/Internal/TaosUpdateSqlGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,49 +41,14 @@ public TaosUpdateSqlGenerator([NotNull] UpdateSqlGeneratorDependencies dependenc
: base(dependencies)
{
}

protected override void AppendDeleteCommand(StringBuilder commandStringBuilder, string name, string schema, IReadOnlyList<IColumnModification> conditionOperations)
{
base.AppendDeleteCommand(commandStringBuilder, name, schema, conditionOperations);
}

protected override void AppendDeleteCommandHeader(StringBuilder commandStringBuilder, string name, string schema)
{
base.AppendDeleteCommandHeader(commandStringBuilder, name, schema);
}
protected override ResultSetMapping AppendSelectAffectedCommand(StringBuilder commandStringBuilder, string name, string schema, IReadOnlyList<IColumnModification> readOperations, IReadOnlyList<IColumnModification> conditionOperations, int commandPosition)
{
Check.NotNull(commandStringBuilder, nameof(commandStringBuilder));
Check.NotEmpty(name, nameof(name));

commandStringBuilder
.Append("SELECT changes()")
.AppendLine(SqlGenerationHelper.StatementTerminator)
.AppendLine();

return ResultSetMapping.LastInResultSet;
}
protected override void AppendIdentityWhereCondition(StringBuilder commandStringBuilder, IColumnModification columnModification)
{

Check.NotNull(commandStringBuilder, nameof(commandStringBuilder));
Check.NotNull(columnModification, nameof(columnModification));
SqlGenerationHelper.DelimitIdentifier(commandStringBuilder, "rowid");
commandStringBuilder.Append(" = ")
.Append("last_insert_rowid()");
}
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
protected override void AppendRowsAffectedWhereCondition(StringBuilder commandStringBuilder, int expectedRowsAffected)
{
Check.NotNull(commandStringBuilder, nameof(commandStringBuilder));

commandStringBuilder.Append("changes() = ").Append(expectedRowsAffected);
}




/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Carbunql" Version="0.5.6" />
<PackageReference Include="Ductus.FluentDocker.MsTest" Version="2.10.59" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.7" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.7" />
<PackageReference Include="coverlet.collector" Version="3.2.0">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="SqModel" Version="0.8.15" />
</ItemGroup>

<ItemGroup>
Expand Down
13 changes: 7 additions & 6 deletions src/EntityFrameworkCore.Taos.Tests/SqModelTest.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using IoTSharp.Data.Taos;
using Carbunql.Analysis;
using IoTSharp.Data.Taos;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SqModel.Analysis;
using System;
using System.Collections.Generic;
using System.Linq;
Expand All @@ -20,17 +20,17 @@ public void TestExecuteBulkInsert_Json()
,station_uid,longitude,latitude,mn,dev_code,pol_name,pol_unit,pol_id FROM st_pmcm WHERE point_code = @p1;";
const string SQLDemo3 = "SELECT * FROM bytable WHERE t1 = @t1 AND t2 LIKE @t11 LIMIT @t3;";
// const string SQLDemo4 = "INSERT INTO t_status USING st_status (status_key) TAGS ('s1') (status_time, val) VALUES (@x1, @x2);";
var s1 = SqlParser.Parse(SQLDemo1);
var s1 = SelectQueryParser.Parse(SQLDemo1);
Assert.AreEqual(0, ((int?)s1.Parameters?.Count).GetValueOrDefault());
var s2 = SqlParser.Parse(SQLDemo2);
var s2 = SelectQueryParser.Parse(SQLDemo2);
Assert.AreEqual(5, ((int?)s2.Parameters?.Count).GetValueOrDefault());

Assert.AreEqual("@p1", s2.Parameters?.Keys.ToArray()[0]);

var pn2 = s2.Parameters;
Assert.AreEqual(1, pn2.Count);
Assert.AreEqual("@p1", pn2.Keys.ToArray()[0]);
var s3 = SqlParser.Parse(SQLDemo3);
var s3 = SelectQueryParser.Parse(SQLDemo3);
Assert.AreEqual(7, s3.Parameters?.Count);
Assert.AreEqual("@t1", s3.Parameters?.ToArray()[1].Key);
Assert.AreEqual("@t11", s3.Parameters?.ToArray()[3].Key);
Expand All @@ -57,7 +57,8 @@ public void TestExecuteBulkInsert_Json()
//Assert.AreEqual(2, pn4.Length);
//Assert.AreEqual("@x1", pn4[0]);
//Assert.AreEqual("@x2", pn4[1]);
var s5 = SqlParser.Parse("insert into #subtable using stable tags($t1,$t2,$t3,$t4,$t5,$t6,$t7,$t8,$t9,$t10,$t11,$t12,$t13) values (@t1,@t2,@t3,@t4,@t5,@t6,@t7,@t8,@t9,@t10,@t11,@t12,@t13,@t14)");

var s5 = SelectQueryParser.Parse("insert into #subtable using stable tags($t1,$t2,$t3,$t4,$t5,$t6,$t7,$t8,$t9,$t10,$t11,$t12,$t13) values (@t1,@t2,@t3,@t4,@t5,@t6,@t7,@t8,@t9,@t10,@t11,@t12,@t13,@t14)");
Assert.AreEqual(14, s5.Parameters?.Count);
Assert.AreEqual("#subtable", s5.Parameters?.ToArray()[0].Key);
Assert.AreEqual(13, s5.Parameters?.Count(k=>k.Key.StartsWith('$')));
Expand Down
6 changes: 3 additions & 3 deletions src/Example/Example.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

<ItemGroup>
<PackageReference Include="ConsoleTableExt" Version="3.2.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.3" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.14.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.5" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/IoTSharp.Data.Taos/IoTSharp.Data.Taos.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net4.6'">
<PackageReference Include="System.Net.Http" Version="4.3.4" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="6.0.3" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions" Version="6.0.3" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit fec67ad

Please sign in to comment.