Skip to content

Commit 09402f7

Browse files
committed
ignored some tests due to unsupported queries
1 parent 5fe8d6d commit 09402f7

File tree

49 files changed

+1348
-504
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1348
-504
lines changed

src/EFCore.Ydb/src/Extensions/YdbServiceCollectionExtensions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
using Microsoft.EntityFrameworkCore.Query;
1717
using Microsoft.EntityFrameworkCore.Storage;
1818
using Microsoft.EntityFrameworkCore.Update;
19-
using Microsoft.EntityFrameworkCore.ValueGeneration;
2019
using Microsoft.Extensions.DependencyInjection;
2120

2221
namespace EntityFrameworkCore.Ydb.Extensions;

src/EFCore.Ydb/src/Query/Internal/Translators/YdbByteArrayMethodTranslator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System;
21
using System.Collections.Generic;
32
using System.Linq;
43
using System.Reflection;
@@ -64,6 +63,7 @@ public YdbByteArrayMethodTranslator(ISqlExpressionFactory sqlExpressionFactory)
6463
)
6564
);
6665
}
66+
6767
return null;
6868
}
6969
}

src/EFCore.Ydb/src/Query/Internal/Translators/YdbDAteTimeMemberTranslator.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
using System;
2-
using System.Diagnostics;
3-
using System.Diagnostics.CodeAnalysis;
42
using System.Reflection;
5-
using EntityFrameworkCore.Ydb.Storage.Internal;
63
using EntityFrameworkCore.Ydb.Storage.Internal.Mapping;
74
using EntityFrameworkCore.Ydb.Utilities;
85
using Microsoft.EntityFrameworkCore;
@@ -91,14 +88,16 @@ YdbSqlExpressionFactory sqlExpressionFactory
9188
};
9289

9390
SqlExpression UtcNow()
94-
=> _sqlExpressionFactory.Function(
91+
{
92+
return _sqlExpressionFactory.Function(
9593
"CurrentUtc" + returnType.Name == "DateOnly" ? "Date" : returnType.Name,
9694
[],
9795
nullable: false,
9896
argumentsPropagateNullability: ArrayUtil.TrueArrays[0],
9997
returnType,
10098
_typeMappingSource.FindMapping(returnType)
10199
);
100+
}
102101
}
103102

104103
private SqlExpression? DatePart(SqlExpression instance, string partName)

src/EFCore.Ydb/src/Query/Internal/Translators/YdbDateTimeMethodTranslator.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.Linq.Expressions;
43
using System.Reflection;
54
using EntityFrameworkCore.Ydb.Utilities;
65
using Microsoft.EntityFrameworkCore;
76
using Microsoft.EntityFrameworkCore.Diagnostics;
87
using Microsoft.EntityFrameworkCore.Query;
98
using Microsoft.EntityFrameworkCore.Query.SqlExpressions;
10-
using Microsoft.EntityFrameworkCore.Storage;
119

1210
namespace EntityFrameworkCore.Ydb.Query.Internal.Translators;
1311

@@ -31,7 +29,7 @@ public class YdbDateTimeMethodTranslator : IMethodCallTranslator
3129
{ typeof(DateTimeOffset).GetRuntimeMethod(nameof(DateTimeOffset.AddDays), [typeof(double)])!, "Days" },
3230
{ typeof(DateTimeOffset).GetRuntimeMethod(nameof(DateTimeOffset.AddHours), [typeof(double)])!, "Hours" },
3331
{ typeof(DateTimeOffset).GetRuntimeMethod(nameof(DateTimeOffset.AddMinutes), [typeof(double)])!, "Mins" },
34-
{ typeof(DateTimeOffset).GetRuntimeMethod(nameof(DateTimeOffset.AddSeconds), [typeof(double)])!, "Secs" },
32+
{ typeof(DateTimeOffset).GetRuntimeMethod(nameof(DateTimeOffset.AddSeconds), [typeof(double)])!, "Secs" }
3533
};
3634

3735
private readonly YdbSqlExpressionFactory _sqlExpressionFactory;

src/EFCore.Ydb/src/Query/Internal/Translators/YdbMathTranslator.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public class YdbMathTranslator : IMethodCallTranslator
7171
{ typeof(MathF).GetMethod(nameof(MathF.Sqrt), [typeof(float)])!, "Sqrt" },
7272
{ typeof(MathF).GetMethod(nameof(MathF.Tan), [typeof(float)])!, "Tan" },
7373
{ typeof(MathF).GetMethod(nameof(MathF.Tanh), [typeof(float)])!, "Tanh" },
74-
{ typeof(MathF).GetMethod(nameof(MathF.Truncate), [typeof(float)])!, "Trunc" },
74+
{ typeof(MathF).GetMethod(nameof(MathF.Truncate), [typeof(float)])!, "Trunc" }
7575
};
7676

7777
private static readonly List<MethodInfo> _roundWithDecimalMethods =
@@ -89,7 +89,9 @@ public class YdbMathTranslator : IMethodCallTranslator
8989
private readonly ISqlExpressionFactory _sqlExpressionFactory;
9090

9191
public YdbMathTranslator(ISqlExpressionFactory sqlExpressionFactory)
92-
=> _sqlExpressionFactory = sqlExpressionFactory;
92+
{
93+
_sqlExpressionFactory = sqlExpressionFactory;
94+
}
9395

9496
public virtual SqlExpression? Translate(
9597
SqlExpression? instance,

src/EFCore.Ydb/src/Query/Internal/YdbMemberTranslatorProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ IRelationalTypeMappingSource typeMappingSource
1515

1616
AddTranslators(
1717
[
18-
new YdbDateTimeMemberTranslator(typeMappingSource, sqlExpressionFactory),
18+
new YdbDateTimeMemberTranslator(typeMappingSource, sqlExpressionFactory)
1919
]
2020
);
2121
}

src/EFCore.Ydb/src/Query/Internal/YdbMethodCallTranslatorProvider.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using EntityFrameworkCore.Ydb.Query.Internal.Translators;
2-
using EntityFrameworkCore.Ydb.Storage.Internal;
32
using Microsoft.EntityFrameworkCore.Query;
43

54
namespace EntityFrameworkCore.Ydb.Query.Internal;
@@ -16,7 +15,7 @@ public YdbMethodCallTranslatorProvider(RelationalMethodCallTranslatorProviderDep
1615
new YdbDateTimeMethodTranslator(sqlExpressionFactory),
1716
new YdbMathTranslator(sqlExpressionFactory),
1817
new YdbMathTranslator(sqlExpressionFactory),
19-
new YdbByteArrayMethodTranslator(sqlExpressionFactory),
18+
new YdbByteArrayMethodTranslator(sqlExpressionFactory)
2019
]
2120
);
2221
}

src/EFCore.Ydb/src/Query/Internal/YdbQueryableMethodTranslatingExpressionVisitor.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System.Linq.Expressions;
21
using EntityFrameworkCore.Ydb.Storage.Internal;
32
using Microsoft.EntityFrameworkCore.Query;
43

src/EFCore.Ydb/src/Query/Internal/YdbSqlAliasManager.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System.Collections.Generic;
22
using System.Diagnostics.CodeAnalysis;
3-
using System.Linq;
43
using System.Linq.Expressions;
54
using Microsoft.EntityFrameworkCore.Query;
65
using Microsoft.EntityFrameworkCore.Query.SqlExpressions;
@@ -20,7 +19,7 @@ public override Expression PostprocessAliases(Expression expression)
2019
private sealed class AliasRewriter : ExpressionVisitor
2120
{
2221
private bool isRootSelect = true;
23-
22+
2423
[return: NotNullIfNotNull("node")]
2524
public override Expression? Visit(Expression? node) => node switch
2625
{
@@ -61,7 +60,7 @@ private Expression VisitSelect(SelectExpression selectExpression)
6160
);
6261
return news;
6362
}
64-
63+
6564
private Expression VisitTableBase(TableExpressionBase tableExpression)
6665
=> tableExpression switch
6766
{
@@ -77,10 +76,7 @@ private Expression VisitLeftJoin(LeftJoinExpression leftJoinExpression)
7776
leftJoinExpression.JoinPredicate
7877
);
7978

80-
private Expression VisitTable(TableExpressionBase tableExpression)
81-
{
82-
return tableExpression;
83-
}
79+
private Expression VisitTable(TableExpressionBase tableExpression) => tableExpression;
8480

8581
private IReadOnlyList<ProjectionExpression> AdjustAliases(
8682
IReadOnlyList<ProjectionExpression> projections,

src/EFCore.Ydb/src/Query/Internal/YdbSqlAliasManagerFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ namespace EntityFrameworkCore.Ydb.Query.Internal;
66
[Experimental("EF9002")]
77
public class YdbSqlAliasManagerFactory : ISqlAliasManagerFactory
88
{
9-
public SqlAliasManager Create()
9+
public SqlAliasManager Create()
1010
=> new YdbSqlAliasManager();
1111
}

0 commit comments

Comments
 (0)