From 6068de43a010f66afa79e8003a89fea12c6febbe Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Sun, 15 Dec 2024 15:47:10 +0100 Subject: [PATCH] Depend on EF 10.0.0-alpha.1.24610.3 (#3409) --- Directory.Packages.props | 10 +- .../Internal/NpgsqlHistoryRepository.cs | 3 +- ...NpgsqlDeleteConvertingExpressionVisitor.cs | 2 +- .../Internal/NpgsqlQueryCompilationContext.cs | 9 +- .../NpgsqlQueryCompilationContextFactory.cs | 6 +- ...yableMethodTranslatingExpressionVisitor.cs | 44 +- .../NpgsqlSqlTranslatingExpressionVisitor.cs | 3 +- .../Mapping/NpgsqlArrayTypeMapping.cs | 2 +- .../BuiltInDataTypesNpgsqlTest.cs | 4 +- .../ComplexTypeBulkUpdatesNpgsqlTest.cs | 36 +- .../NonSharedModelBulkUpdatesNpgsqlTest.cs | 33 +- .../NorthwindBulkUpdatesNpgsqlTest.cs | 100 +-- ...FiltersInheritanceBulkUpdatesNpgsqlTest.cs | 6 +- .../TPHInheritanceBulkUpdatesNpgsqlTest.cs | 6 +- .../MigrationsInfrastructureNpgsqlTest.cs | 25 +- .../Migrations/MigrationsNpgsqlTest.cs | 6 +- .../Query/AdHocComplexTypeQueryNpgsqlTest.cs | 8 +- .../Query/AdHocJsonQueryNpgsqlTest.cs | 30 + .../Query/AdHocPrecompiledQueryNpgsqlTest.cs | 4 +- .../Query/ArrayArrayQueryTest.cs | 88 +-- .../Query/ArrayListQueryTest.cs | 88 +-- .../Query/CitextQueryTest.cs | 40 +- .../Query/ComplexTypeQueryNpgsqlTest.cs | 118 ++-- .../Query/EnumQueryTest.cs | 24 +- .../FullTextSearchDbFunctionsNpgsqlTest.cs | 12 +- .../Query/GearsOfWarQueryNpgsqlFixture.cs | 4 + .../Query/GearsOfWarQueryNpgsqlTest.cs | 55 +- .../Query/JsonDomQueryTest.cs | 28 +- .../Query/JsonPocoQueryTest.cs | 36 +- .../Query/JsonQueryNpgsqlTest.cs | 118 ++-- .../Query/JsonStringQueryTest.cs | 16 +- .../Query/LTreeQueryTest.cs | 40 +- .../Query/LegacyTimestampQueryTest.cs | 8 +- .../Query/MultirangeQueryNpgsqlTest.cs | 104 ++-- .../Query/NetworkQueryNpgsqlTest.cs | 136 ++-- .../Query/NodaTimeQueryNpgsqlTest.cs | 52 +- ...thwindAggregateOperatorsQueryNpgsqlTest.cs | 40 +- .../NorthwindFunctionsQueryNpgsqlTest.cs | 24 +- .../Query/NorthwindGroupByQueryNpgsqlTest.cs | 170 +++-- .../NorthwindMiscellaneousQueryNpgsqlTest.cs | 40 +- .../Query/NorthwindWhereQueryNpgsqlTest.cs | 12 +- .../Query/PrecompiledQueryNpgsqlTest.cs | 142 +++-- ...compiledSqlPregenerationQueryNpgsqlTest.cs | 60 +- .../PrimitiveCollectionsQueryNpgsqlTest.cs | 586 +++++++++++------- .../Query/RangeQueryNpgsqlTest.cs | 68 +- .../Query/SpatialQueryNpgsqlGeographyTest.cs | 28 +- .../Query/SpatialQueryNpgsqlGeometryTest.cs | 52 +- .../Query/SqlQueryNpgsqlTest.cs | 32 +- .../Query/TPCGearsOfWarQueryNpgsqlFixture.cs | 6 +- .../Query/TPCGearsOfWarQueryNpgsqlTest.cs | 31 +- .../Query/TPTGearsOfWarQueryNpgsqlFixture.cs | 6 +- .../Query/TPTGearsOfWarQueryNpgsqlTest.cs | 31 +- .../Query/TimestampQueryTest.cs | 18 +- .../Query/UdfDbFunctionNpgsqlTests.cs | 80 +-- .../NpgsqlDatabaseModelFactoryTest.cs | 68 +- .../TestRelationalCommandBuilderFactory.cs | 7 + 56 files changed, 1534 insertions(+), 1271 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 362c7099e..c2997a8d8 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,7 +1,7 @@ - [9.0.0,10.0.0) - 9.0.0 + 10.0.0-alpha.1.24610.3 + 10.0.0-alpha.1.24609.1 9.0.2 @@ -23,9 +23,9 @@ - - - + + + diff --git a/src/EFCore.PG/Migrations/Internal/NpgsqlHistoryRepository.cs b/src/EFCore.PG/Migrations/Internal/NpgsqlHistoryRepository.cs index 1366a1b6e..c2834eed5 100644 --- a/src/EFCore.PG/Migrations/Internal/NpgsqlHistoryRepository.cs +++ b/src/EFCore.PG/Migrations/Internal/NpgsqlHistoryRepository.cs @@ -177,8 +177,7 @@ or PostgresErrorCodes.DuplicateTable private IReadOnlyList GetCreateIfNotExistsCommands() => Dependencies.MigrationsSqlGenerator.Generate([new SqlOperation { - Sql = GetCreateIfNotExistsScript(), - SuppressTransaction = true + Sql = GetCreateIfNotExistsScript() }]); /// diff --git a/src/EFCore.PG/Query/Internal/NpgsqlDeleteConvertingExpressionVisitor.cs b/src/EFCore.PG/Query/Internal/NpgsqlDeleteConvertingExpressionVisitor.cs index bba009ead..4c3505e15 100644 --- a/src/EFCore.PG/Query/Internal/NpgsqlDeleteConvertingExpressionVisitor.cs +++ b/src/EFCore.PG/Query/Internal/NpgsqlDeleteConvertingExpressionVisitor.cs @@ -3,7 +3,7 @@ namespace Npgsql.EntityFrameworkCore.PostgreSQL.Query.Internal; /// -/// Converts the relational into a PG-specific , which +/// Converts the relational into a PG-specific , which /// precisely models a DELETE statement in PostgreSQL. This is done to handle the PG-specific USING syntax for table joining. /// public class NpgsqlDeleteConvertingExpressionVisitor : ExpressionVisitor diff --git a/src/EFCore.PG/Query/Internal/NpgsqlQueryCompilationContext.cs b/src/EFCore.PG/Query/Internal/NpgsqlQueryCompilationContext.cs index 259cd1ec7..a04bb43c5 100644 --- a/src/EFCore.PG/Query/Internal/NpgsqlQueryCompilationContext.cs +++ b/src/EFCore.PG/Query/Internal/NpgsqlQueryCompilationContext.cs @@ -18,9 +18,7 @@ public NpgsqlQueryCompilationContext( QueryCompilationContextDependencies dependencies, RelationalQueryCompilationContextDependencies relationalDependencies, bool async) - : this( - dependencies, relationalDependencies, async, precompiling: false, - nonNullableReferenceTypeParameters: null) + : this(dependencies, relationalDependencies, async, precompiling: false) { } @@ -34,9 +32,8 @@ public NpgsqlQueryCompilationContext( QueryCompilationContextDependencies dependencies, RelationalQueryCompilationContextDependencies relationalDependencies, bool async, - bool precompiling, - IReadOnlySet? nonNullableReferenceTypeParameters) - : base(dependencies, relationalDependencies, async, precompiling, nonNullableReferenceTypeParameters) + bool precompiling) + : base(dependencies, relationalDependencies, async, precompiling) { } diff --git a/src/EFCore.PG/Query/Internal/NpgsqlQueryCompilationContextFactory.cs b/src/EFCore.PG/Query/Internal/NpgsqlQueryCompilationContextFactory.cs index 7f6bbfc3a..cc35642a3 100644 --- a/src/EFCore.PG/Query/Internal/NpgsqlQueryCompilationContextFactory.cs +++ b/src/EFCore.PG/Query/Internal/NpgsqlQueryCompilationContextFactory.cs @@ -43,8 +43,6 @@ public virtual QueryCompilationContext Create(bool async) /// 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. /// - public virtual QueryCompilationContext CreatePrecompiled(bool async, IReadOnlySet nonNullableReferenceTypeParameters) - => new NpgsqlQueryCompilationContext( - _dependencies, _relationalDependencies, async, precompiling: true, - nonNullableReferenceTypeParameters); + public virtual QueryCompilationContext CreatePrecompiled(bool async) + => new NpgsqlQueryCompilationContext(_dependencies, _relationalDependencies, async, precompiling: true); } diff --git a/src/EFCore.PG/Query/Internal/NpgsqlQueryableMethodTranslatingExpressionVisitor.cs b/src/EFCore.PG/Query/Internal/NpgsqlQueryableMethodTranslatingExpressionVisitor.cs index 8d2bc0623..4660c863e 100644 --- a/src/EFCore.PG/Query/Internal/NpgsqlQueryableMethodTranslatingExpressionVisitor.cs +++ b/src/EFCore.PG/Query/Internal/NpgsqlQueryableMethodTranslatingExpressionVisitor.cs @@ -1096,46 +1096,18 @@ protected override bool IsValidSelectExpressionForExecuteUpdate( /// 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. /// - protected override bool IsValidSelectExpressionForExecuteDelete( - SelectExpression selectExpression, - StructuralTypeShaperExpression shaper, - [NotNullWhen(true)] out TableExpression? tableExpression) - { + protected override bool IsValidSelectExpressionForExecuteDelete(SelectExpression selectExpression) // The default relational behavior is to allow only single-table expressions, and the only permitted feature is a predicate. // Here we extend this to also inner joins to tables, which we generate via the PostgreSQL-specific USING construct. - if (selectExpression is - { - Orderings: [], - Offset: null, - Limit: null, - GroupBy: [], - Having: null - }) + => selectExpression is { - TableExpressionBase? table = null; - if (selectExpression.Tables.Count == 1) - { - table = selectExpression.Tables[0]; - } - else if (selectExpression.Tables.All(t => t is TableExpression or InnerJoinExpression)) - { - var projectionBindingExpression = (ProjectionBindingExpression)shaper.ValueBufferExpression; - var entityProjectionExpression = - (StructuralTypeProjectionExpression)selectExpression.GetProjection(projectionBindingExpression); - var column = entityProjectionExpression.BindProperty(shaper.StructuralType.GetProperties().First()); - table = selectExpression.Tables.Select(t => t.UnwrapJoin()).Single(t => t.Alias == column.TableAlias); - } - - if (table is TableExpression te) - { - tableExpression = te; - return true; - } + Orderings: [], + Offset: null, + Limit: null, + GroupBy: [], + Having: null } - - tableExpression = null; - return false; - } + && selectExpression.Tables[0] is TableExpression && selectExpression.Tables.Skip(1).All(t => t is InnerJoinExpression); // PostgreSQL unnest is guaranteed to return output rows in the same order as its input array, // https://www.postgresql.org/docs/current/functions-array.html. diff --git a/src/EFCore.PG/Query/Internal/NpgsqlSqlTranslatingExpressionVisitor.cs b/src/EFCore.PG/Query/Internal/NpgsqlSqlTranslatingExpressionVisitor.cs index 0ef5b7e9b..ff443b89e 100644 --- a/src/EFCore.PG/Query/Internal/NpgsqlSqlTranslatingExpressionVisitor.cs +++ b/src/EFCore.PG/Query/Internal/NpgsqlSqlTranslatingExpressionVisitor.cs @@ -518,8 +518,7 @@ private bool TryTranslateStartsEndsWithContains( return true; } - case SqlParameterExpression patternParameter - when patternParameter.Name.StartsWith(QueryCompilationContext.QueryParameterPrefix, StringComparison.Ordinal): + case SqlParameterExpression patternParameter: { // The pattern is a parameter, register a runtime parameter that will contain the rewritten LIKE pattern, where // all special characters have been escaped. diff --git a/src/EFCore.PG/Storage/Internal/Mapping/NpgsqlArrayTypeMapping.cs b/src/EFCore.PG/Storage/Internal/Mapping/NpgsqlArrayTypeMapping.cs index a336b1148..4bae5b140 100644 --- a/src/EFCore.PG/Storage/Internal/Mapping/NpgsqlArrayTypeMapping.cs +++ b/src/EFCore.PG/Storage/Internal/Mapping/NpgsqlArrayTypeMapping.cs @@ -132,7 +132,7 @@ private static RelationalTypeMappingParameters CreateParameters(string storeType var comparer = typeof(TCollection).IsArray && typeof(TCollection).GetArrayRank() > 1 ? null // TODO: Value comparer for multidimensional arrays : (ValueComparer?)Activator.CreateInstance( - elementType.IsNullableValueType() + elementType.IsNullableValueType() || elementMapping.Comparer.Type.IsNullableValueType() ? typeof(ListOfNullableValueTypesComparer<,>) .MakeGenericType(typeof(TConcreteCollection), elementType.UnwrapNullableType()) : elementType.IsValueType diff --git a/test/EFCore.PG.FunctionalTests/BuiltInDataTypesNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/BuiltInDataTypesNpgsqlTest.cs index a873c85b4..99c1a5996 100644 --- a/test/EFCore.PG.FunctionalTests/BuiltInDataTypesNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/BuiltInDataTypesNpgsqlTest.cs @@ -48,11 +48,11 @@ public void Sql_translation_uses_type_mapper_when_parameter() AssertSql( """ -@__timeSpan_0='02:01:00' (Nullable = true) +@timeSpan='02:01:00' (Nullable = true) SELECT m."Int" FROM "MappedNullableDataTypes" AS m -WHERE m."TimeSpanAsTime" = @__timeSpan_0 +WHERE m."TimeSpanAsTime" = @timeSpan """); } diff --git a/test/EFCore.PG.FunctionalTests/BulkUpdates/ComplexTypeBulkUpdatesNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/BulkUpdates/ComplexTypeBulkUpdatesNpgsqlTest.cs index 7bf72a670..cd7edad97 100644 --- a/test/EFCore.PG.FunctionalTests/BulkUpdates/ComplexTypeBulkUpdatesNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/BulkUpdates/ComplexTypeBulkUpdatesNpgsqlTest.cs @@ -100,20 +100,20 @@ public override async Task Update_complex_type_to_parameter(bool async) AssertExecuteUpdateSql( """ -@__complex_type_newAddress_0_AddressLine1='New AddressLine1' -@__complex_type_newAddress_0_AddressLine2='New AddressLine2' -@__complex_type_newAddress_0_Tags={ 'new_tag1', 'new_tag2' } (DbType = Object) -@__complex_type_newAddress_0_ZipCode='99999' (Nullable = true) -@__complex_type_newAddress_0_Code='FR' -@__complex_type_newAddress_0_FullName='France' +@complex_type_newAddress_AddressLine1='New AddressLine1' +@complex_type_newAddress_AddressLine2='New AddressLine2' +@complex_type_newAddress_Tags={ 'new_tag1', 'new_tag2' } (DbType = Object) +@complex_type_newAddress_ZipCode='99999' (Nullable = true) +@complex_type_newAddress_Code='FR' +@complex_type_newAddress_FullName='France' UPDATE "Customer" AS c -SET "ShippingAddress_AddressLine1" = @__complex_type_newAddress_0_AddressLine1, - "ShippingAddress_AddressLine2" = @__complex_type_newAddress_0_AddressLine2, - "ShippingAddress_Tags" = @__complex_type_newAddress_0_Tags, - "ShippingAddress_ZipCode" = @__complex_type_newAddress_0_ZipCode, - "ShippingAddress_Country_Code" = @__complex_type_newAddress_0_Code, - "ShippingAddress_Country_FullName" = @__complex_type_newAddress_0_FullName +SET "ShippingAddress_AddressLine1" = @complex_type_newAddress_AddressLine1, + "ShippingAddress_AddressLine2" = @complex_type_newAddress_AddressLine2, + "ShippingAddress_Tags" = @complex_type_newAddress_Tags, + "ShippingAddress_ZipCode" = @complex_type_newAddress_ZipCode, + "ShippingAddress_Country_Code" = @complex_type_newAddress_Code, + "ShippingAddress_Country_FullName" = @complex_type_newAddress_FullName """); } @@ -123,12 +123,12 @@ public override async Task Update_nested_complex_type_to_parameter(bool async) AssertExecuteUpdateSql( """ -@__complex_type_newCountry_0_Code='FR' -@__complex_type_newCountry_0_FullName='France' +@complex_type_newCountry_Code='FR' +@complex_type_newCountry_FullName='France' UPDATE "Customer" AS c -SET "ShippingAddress_Country_Code" = @__complex_type_newCountry_0_Code, - "ShippingAddress_Country_FullName" = @__complex_type_newCountry_0_FullName +SET "ShippingAddress_Country_Code" = @complex_type_newCountry_Code, + "ShippingAddress_Country_FullName" = @complex_type_newCountry_FullName """); } @@ -186,7 +186,7 @@ public override async Task Update_complex_type_to_another_database_complex_type_ AssertExecuteUpdateSql( """ -@__p_0='1' +@p='1' UPDATE "Customer" AS c0 SET "ShippingAddress_AddressLine1" = c1."BillingAddress_AddressLine1", @@ -199,7 +199,7 @@ public override async Task Update_complex_type_to_another_database_complex_type_ SELECT c."Id", c."BillingAddress_AddressLine1", c."BillingAddress_AddressLine2", c."BillingAddress_Tags", c."BillingAddress_ZipCode", c."ShippingAddress_Country_Code", c."ShippingAddress_Country_FullName" FROM "Customer" AS c ORDER BY c."Id" NULLS FIRST - OFFSET @__p_0 + OFFSET @p ) AS c1 WHERE c0."Id" = c1."Id" """); diff --git a/test/EFCore.PG.FunctionalTests/BulkUpdates/NonSharedModelBulkUpdatesNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/BulkUpdates/NonSharedModelBulkUpdatesNpgsqlTest.cs index d32b3c4f7..6672c16b7 100644 --- a/test/EFCore.PG.FunctionalTests/BulkUpdates/NonSharedModelBulkUpdatesNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/BulkUpdates/NonSharedModelBulkUpdatesNpgsqlTest.cs @@ -28,14 +28,14 @@ public override async Task Delete_with_owned_collection_and_non_natively_transla AssertSql( """ -@__p_0='1' +@p='1' DELETE FROM "Owner" AS o WHERE o."Id" IN ( SELECT o0."Id" FROM "Owner" AS o0 ORDER BY o0."Title" NULLS FIRST - OFFSET @__p_0 + OFFSET @p ) """); } @@ -239,6 +239,35 @@ protected class EntityWithPrimitiveCollection public List Tags { get; set; } } + public override async Task Delete_with_view_mapping(bool async) + { + await base.Delete_with_view_mapping(async); + + AssertSql( + """ +DELETE FROM "Blogs" AS b +"""); + } + + public override async Task Update_with_view_mapping(bool async) + { + await base.Update_with_view_mapping(async); + + AssertSql( + """ +UPDATE "Blogs" AS b +SET "Data" = 'Updated' +"""); + } + + public override async Task Update_complex_type_with_view_mapping(bool async) + { + await base.Update_complex_type_with_view_mapping(async); + + // #34706 + AssertSql(); + } + private void AssertSql(params string[] expected) => TestSqlLoggerFactory.AssertBaseline(expected); diff --git a/test/EFCore.PG.FunctionalTests/BulkUpdates/NorthwindBulkUpdatesNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/BulkUpdates/NorthwindBulkUpdatesNpgsqlTest.cs index 40d60f7f5..c76802b58 100644 --- a/test/EFCore.PG.FunctionalTests/BulkUpdates/NorthwindBulkUpdatesNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/BulkUpdates/NorthwindBulkUpdatesNpgsqlTest.cs @@ -38,10 +38,10 @@ public override async Task Delete_Where_parameter(bool async) AssertSql( """ -@__quantity_0='1' (Nullable = true) (DbType = Int16) +@quantity='1' (Nullable = true) (DbType = Int16) DELETE FROM "Order Details" AS o -WHERE o."Quantity" = @__quantity_0 +WHERE o."Quantity" = @quantity """, // """ @@ -70,7 +70,7 @@ public override async Task Delete_Where_OrderBy_Skip(bool async) AssertSql( """ -@__p_0='100' +@p='100' DELETE FROM "Order Details" AS o WHERE EXISTS ( @@ -80,7 +80,7 @@ SELECT 1 FROM "Order Details" AS o0 WHERE o0."OrderID" < 10300 ORDER BY o0."OrderID" NULLS FIRST - OFFSET @__p_0 + OFFSET @p ) AS o1 WHERE o1."OrderID" = o."OrderID" AND o1."ProductID" = o."ProductID") """); @@ -92,7 +92,7 @@ public override async Task Delete_Where_OrderBy_Take(bool async) AssertSql( """ -@__p_0='100' +@p='100' DELETE FROM "Order Details" AS o WHERE EXISTS ( @@ -102,7 +102,7 @@ SELECT 1 FROM "Order Details" AS o0 WHERE o0."OrderID" < 10300 ORDER BY o0."OrderID" NULLS FIRST - LIMIT @__p_0 + LIMIT @p ) AS o1 WHERE o1."OrderID" = o."OrderID" AND o1."ProductID" = o."ProductID") """); @@ -114,7 +114,7 @@ public override async Task Delete_Where_OrderBy_Skip_Take(bool async) AssertSql( """ -@__p_0='100' +@p='100' DELETE FROM "Order Details" AS o WHERE EXISTS ( @@ -124,7 +124,7 @@ SELECT 1 FROM "Order Details" AS o0 WHERE o0."OrderID" < 10300 ORDER BY o0."OrderID" NULLS FIRST - LIMIT @__p_0 OFFSET @__p_0 + LIMIT @p OFFSET @p ) AS o1 WHERE o1."OrderID" = o."OrderID" AND o1."ProductID" = o."ProductID") """); @@ -136,7 +136,7 @@ public override async Task Delete_Where_Skip(bool async) AssertSql( """ -@__p_0='100' +@p='100' DELETE FROM "Order Details" AS o WHERE EXISTS ( @@ -145,7 +145,7 @@ SELECT 1 SELECT o0."OrderID", o0."ProductID" FROM "Order Details" AS o0 WHERE o0."OrderID" < 10300 - OFFSET @__p_0 + OFFSET @p ) AS o1 WHERE o1."OrderID" = o."OrderID" AND o1."ProductID" = o."ProductID") """); @@ -157,7 +157,7 @@ public override async Task Delete_Where_Take(bool async) AssertSql( """ -@__p_0='100' +@p='100' DELETE FROM "Order Details" AS o WHERE EXISTS ( @@ -166,7 +166,7 @@ SELECT 1 SELECT o0."OrderID", o0."ProductID" FROM "Order Details" AS o0 WHERE o0."OrderID" < 10300 - LIMIT @__p_0 + LIMIT @p ) AS o1 WHERE o1."OrderID" = o."OrderID" AND o1."ProductID" = o."ProductID") """); @@ -178,7 +178,7 @@ public override async Task Delete_Where_Skip_Take(bool async) AssertSql( """ -@__p_0='100' +@p='100' DELETE FROM "Order Details" AS o WHERE EXISTS ( @@ -187,7 +187,7 @@ SELECT 1 SELECT o0."OrderID", o0."ProductID" FROM "Order Details" AS o0 WHERE o0."OrderID" < 10300 - LIMIT @__p_0 OFFSET @__p_0 + LIMIT @p OFFSET @p ) AS o1 WHERE o1."OrderID" = o."OrderID" AND o1."ProductID" = o."ProductID") """); @@ -254,9 +254,9 @@ public override async Task Delete_Where_Skip_Take_Skip_Take_causing_subquery(boo AssertSql( """ -@__p_0='100' -@__p_2='5' -@__p_1='20' +@p='100' +@p2='5' +@p1='20' DELETE FROM "Order Details" AS o WHERE EXISTS ( @@ -267,9 +267,9 @@ SELECT 1 SELECT o1."OrderID", o1."ProductID" FROM "Order Details" AS o1 WHERE o1."OrderID" < 10300 - LIMIT @__p_0 OFFSET @__p_0 + LIMIT @p OFFSET @p ) AS o0 - LIMIT @__p_2 OFFSET @__p_1 + LIMIT @p2 OFFSET @p1 ) AS o2 WHERE o2."OrderID" = o."OrderID" AND o2."ProductID" = o."ProductID") """); @@ -494,8 +494,8 @@ public override async Task Delete_with_join(bool async) AssertSql( """ -@__p_1='100' -@__p_0='0' +@p0='100' +@p='0' DELETE FROM "Order Details" AS o USING ( @@ -503,7 +503,7 @@ SELECT o0."OrderID" FROM "Orders" AS o0 WHERE o0."OrderID" < 10300 ORDER BY o0."OrderID" NULLS FIRST - LIMIT @__p_1 OFFSET @__p_0 + LIMIT @p0 OFFSET @p ) AS o1 WHERE o."OrderID" = o1."OrderID" """); @@ -515,8 +515,8 @@ public override async Task Delete_with_left_join(bool async) AssertSql( """ -@__p_1='100' -@__p_0='0' +@p0='100' +@p='0' DELETE FROM "Order Details" AS o WHERE EXISTS ( @@ -527,7 +527,7 @@ SELECT o2."OrderID" FROM "Orders" AS o2 WHERE o2."OrderID" < 10300 ORDER BY o2."OrderID" NULLS FIRST - LIMIT @__p_1 OFFSET @__p_0 + LIMIT @p0 OFFSET @p ) AS o1 ON o0."OrderID" = o1."OrderID" WHERE o0."OrderID" < 10276 AND o0."OrderID" = o."OrderID" AND o0."ProductID" = o."ProductID") """); @@ -628,19 +628,19 @@ public override async Task Update_Where_parameter_set_constant(bool async) AssertExecuteUpdateSql( """ -@__customer_0='ALFKI' +@customer='ALFKI' UPDATE "Customers" AS c SET "ContactName" = 'Updated' -WHERE c."CustomerID" = @__customer_0 +WHERE c."CustomerID" = @customer """, // """ -@__customer_0='ALFKI' +@customer='ALFKI' SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."Phone", c."PostalCode", c."Region" FROM "Customers" AS c -WHERE c."CustomerID" = @__customer_0 +WHERE c."CustomerID" = @customer """, // """ @@ -662,10 +662,10 @@ public override async Task Update_Where_set_parameter(bool async) AssertExecuteUpdateSql( """ -@__value_0='Abc' +@value='Abc' UPDATE "Customers" AS c -SET "ContactName" = @__value_0 +SET "ContactName" = @value WHERE c."CustomerID" LIKE 'F%' """); } @@ -676,10 +676,10 @@ public override async Task Update_Where_set_parameter_from_closure_array(bool as AssertExecuteUpdateSql( """ -@__p_0='Abc' +@p='Abc' UPDATE "Customers" AS c -SET "ContactName" = @__p_0 +SET "ContactName" = @p WHERE c."CustomerID" LIKE 'F%' """); } @@ -702,10 +702,10 @@ public override async Task Update_Where_set_parameter_from_multilevel_property_a AssertExecuteUpdateSql( """ -@__container_Containee_Property_0='Abc' +@container_Containee_Property='Abc' UPDATE "Customers" AS c -SET "ContactName" = @__container_Containee_Property_0 +SET "ContactName" = @container_Containee_Property WHERE c."CustomerID" LIKE 'F%' """); } @@ -745,7 +745,7 @@ public override async Task Update_Where_OrderBy_Skip_set_constant(bool async) AssertExecuteUpdateSql( """ -@__p_0='4' +@p='4' UPDATE "Customers" AS c0 SET "ContactName" = 'Updated' @@ -754,7 +754,7 @@ SELECT c."CustomerID" FROM "Customers" AS c WHERE c."CustomerID" LIKE 'F%' ORDER BY c."City" NULLS FIRST - OFFSET @__p_0 + OFFSET @p ) AS c1 WHERE c0."CustomerID" = c1."CustomerID" """); @@ -766,7 +766,7 @@ public override async Task Update_Where_OrderBy_Take_set_constant(bool async) AssertExecuteUpdateSql( """ -@__p_0='4' +@p='4' UPDATE "Customers" AS c0 SET "ContactName" = 'Updated' @@ -775,7 +775,7 @@ SELECT c."CustomerID" FROM "Customers" AS c WHERE c."CustomerID" LIKE 'F%' ORDER BY c."City" NULLS FIRST - LIMIT @__p_0 + LIMIT @p ) AS c1 WHERE c0."CustomerID" = c1."CustomerID" """); @@ -787,8 +787,8 @@ public override async Task Update_Where_OrderBy_Skip_Take_set_constant(bool asyn AssertExecuteUpdateSql( """ -@__p_1='4' -@__p_0='2' +@p0='4' +@p='2' UPDATE "Customers" AS c0 SET "ContactName" = 'Updated' @@ -797,7 +797,7 @@ SELECT c."CustomerID" FROM "Customers" AS c WHERE c."CustomerID" LIKE 'F%' ORDER BY c."City" NULLS FIRST - LIMIT @__p_1 OFFSET @__p_0 + LIMIT @p0 OFFSET @p ) AS c1 WHERE c0."CustomerID" = c1."CustomerID" """); @@ -809,8 +809,8 @@ public override async Task Update_Where_OrderBy_Skip_Take_Skip_Take_set_constant AssertExecuteUpdateSql( """ -@__p_1='6' -@__p_0='2' +@p0='6' +@p='2' UPDATE "Customers" AS c1 SET "ContactName" = 'Updated' @@ -821,10 +821,10 @@ SELECT c0."CustomerID" FROM "Customers" AS c WHERE c."CustomerID" LIKE 'F%' ORDER BY c."City" NULLS FIRST - LIMIT @__p_1 OFFSET @__p_0 + LIMIT @p0 OFFSET @p ) AS c0 ORDER BY c0."City" NULLS FIRST - LIMIT @__p_0 OFFSET @__p_0 + LIMIT @p OFFSET @p ) AS c2 WHERE c1."CustomerID" = c2."CustomerID" """); @@ -977,10 +977,10 @@ public override async Task Update_Where_set_property_plus_parameter(bool async) AssertExecuteUpdateSql( """ -@__value_0='Abc' +@value='Abc' UPDATE "Customers" AS c -SET "ContactName" = COALESCE(c."ContactName", '') || @__value_0 +SET "ContactName" = COALESCE(c."ContactName", '') || @value WHERE c."CustomerID" LIKE 'F%' """); } @@ -1041,11 +1041,11 @@ public override async Task Update_Where_multiple_set(bool async) AssertExecuteUpdateSql( """ -@__value_0='Abc' +@value='Abc' UPDATE "Customers" AS c SET "City" = 'Seattle', - "ContactName" = @__value_0 + "ContactName" = @value WHERE c."CustomerID" LIKE 'F%' """); } diff --git a/test/EFCore.PG.FunctionalTests/BulkUpdates/TPHFiltersInheritanceBulkUpdatesNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/BulkUpdates/TPHFiltersInheritanceBulkUpdatesNpgsqlTest.cs index 4b8c44424..e20926d55 100644 --- a/test/EFCore.PG.FunctionalTests/BulkUpdates/TPHFiltersInheritanceBulkUpdatesNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/BulkUpdates/TPHFiltersInheritanceBulkUpdatesNpgsqlTest.cs @@ -130,8 +130,8 @@ public override async Task Delete_where_hierarchy_subquery(bool async) AssertSql( """ -@__p_1='3' -@__p_0='0' +@p0='3' +@p='0' DELETE FROM "Animals" AS a WHERE a."Id" IN ( @@ -139,7 +139,7 @@ SELECT a0."Id" FROM "Animals" AS a0 WHERE a0."CountryId" = 1 AND a0."Name" = 'Great spotted kiwi' ORDER BY a0."Name" NULLS FIRST - LIMIT @__p_1 OFFSET @__p_0 + LIMIT @p0 OFFSET @p ) """); } diff --git a/test/EFCore.PG.FunctionalTests/BulkUpdates/TPHInheritanceBulkUpdatesNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/BulkUpdates/TPHInheritanceBulkUpdatesNpgsqlTest.cs index 21bb652f8..943ea3f91 100644 --- a/test/EFCore.PG.FunctionalTests/BulkUpdates/TPHInheritanceBulkUpdatesNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/BulkUpdates/TPHInheritanceBulkUpdatesNpgsqlTest.cs @@ -94,8 +94,8 @@ public override async Task Delete_where_hierarchy_subquery(bool async) AssertSql( """ -@__p_1='3' -@__p_0='0' +@p0='3' +@p='0' DELETE FROM "Animals" AS a WHERE a."Id" IN ( @@ -103,7 +103,7 @@ SELECT a0."Id" FROM "Animals" AS a0 WHERE a0."Name" = 'Great spotted kiwi' ORDER BY a0."Name" NULLS FIRST - LIMIT @__p_1 OFFSET @__p_0 + LIMIT @p0 OFFSET @p ) """); } diff --git a/test/EFCore.PG.FunctionalTests/Migrations/MigrationsInfrastructureNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Migrations/MigrationsInfrastructureNpgsqlTest.cs index a67c241fa..542d3ddda 100644 --- a/test/EFCore.PG.FunctionalTests/Migrations/MigrationsInfrastructureNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Migrations/MigrationsInfrastructureNpgsqlTest.cs @@ -7,16 +7,6 @@ namespace Npgsql.EntityFrameworkCore.PostgreSQL.Migrations public class MigrationsInfrastructureNpgsqlTest(MigrationsInfrastructureNpgsqlTest.MigrationsInfrastructureNpgsqlFixture fixture) : MigrationsInfrastructureTestBase(fixture) { - // TODO: Remove once we sync to https://github.com/dotnet/efcore/pull/35106 - public override void Can_generate_no_migration_script() - { - } - - // TODO: Remove once we sync to https://github.com/dotnet/efcore/pull/35106 - public override void Can_generate_migration_from_initial_database_to_initial() - { - } - public override void Can_get_active_provider() { base.Can_get_active_provider(); @@ -24,6 +14,21 @@ public override void Can_get_active_provider() Assert.Equal("Npgsql.EntityFrameworkCore.PostgreSQL", ActiveProvider); } + // See #3407 + public override void Can_apply_two_migrations_in_transaction() + => Assert.ThrowsAny(() => base.Can_apply_two_migrations_in_transaction()); + + // See #3407 + public override Task Can_apply_two_migrations_in_transaction_async() + => Assert.ThrowsAnyAsync(() => base.Can_apply_two_migrations_in_transaction_async()); + + // This tests uses Fixture.CreateEmptyContext(), which does not go through MigrationsInfrastructureNpgsqlFixture.CreateContext() + // and therefore does not set the PostgresVersion in the context options. As a result, we try to drop the database with + // WITH (FORCE), which is only supported starting with PG 13. + [MinimumPostgresVersion(13, 0)] + public override Task Can_generate_no_migration_script() + => base.Can_generate_no_migration_script(); + [ConditionalFact(Skip = "https://github.com/dotnet/efcore/issues/33056")] public override void Can_apply_all_migrations() => base.Can_apply_all_migrations(); diff --git a/test/EFCore.PG.FunctionalTests/Migrations/MigrationsNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Migrations/MigrationsNpgsqlTest.cs index db6cfe3fd..82918f6b8 100644 --- a/test/EFCore.PG.FunctionalTests/Migrations/MigrationsNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Migrations/MigrationsNpgsqlTest.cs @@ -1192,7 +1192,7 @@ await Test( model => { var table = Assert.Single(model.Tables); - var column = Assert.Single(table.Columns.Where(c => c.Name == "SomeColumn")); + var column = Assert.Single(table.Columns, c => c.Name == "SomeColumn"); if (AssertComments) { Assert.Equal("Some comment", column.Comment); @@ -2301,8 +2301,8 @@ await Test( var table = Assert.Single(model.Tables); var index = Assert.Single(table.Indexes); var storageParameter = Assert.Single( - index.GetAnnotations() - .Where(a => a.Name.StartsWith(NpgsqlAnnotationNames.StorageParameterPrefix, StringComparison.Ordinal))); + index.GetAnnotations(), + a => a.Name.StartsWith(NpgsqlAnnotationNames.StorageParameterPrefix, StringComparison.Ordinal)); Assert.Equal(NpgsqlAnnotationNames.StorageParameterPrefix + "fillfactor", storageParameter.Name); // Storage parameter values always get scaffolded as strings (PG storage is simply 'name=value') diff --git a/test/EFCore.PG.FunctionalTests/Query/AdHocComplexTypeQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/AdHocComplexTypeQueryNpgsqlTest.cs index cf86a2b2f..2a8eae475 100644 --- a/test/EFCore.PG.FunctionalTests/Query/AdHocComplexTypeQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/AdHocComplexTypeQueryNpgsqlTest.cs @@ -10,13 +10,13 @@ public override async Task Complex_type_equals_parameter_with_nested_types_with_ AssertSql( """ -@__entity_equality_container_0_Id='1' (Nullable = true) -@__entity_equality_container_0_Containee1_Id='2' (Nullable = true) -@__entity_equality_container_0_Containee2_Id='3' (Nullable = true) +@entity_equality_container_Id='1' (Nullable = true) +@entity_equality_container_Containee1_Id='2' (Nullable = true) +@entity_equality_container_Containee2_Id='3' (Nullable = true) SELECT e."Id", e."ComplexContainer_Id", e."ComplexContainer_Containee1_Id", e."ComplexContainer_Containee2_Id" FROM "EntityType" AS e -WHERE e."ComplexContainer_Id" = @__entity_equality_container_0_Id AND e."ComplexContainer_Containee1_Id" = @__entity_equality_container_0_Containee1_Id AND e."ComplexContainer_Containee2_Id" = @__entity_equality_container_0_Containee2_Id +WHERE e."ComplexContainer_Id" = @entity_equality_container_Id AND e."ComplexContainer_Containee1_Id" = @entity_equality_container_Containee1_Id AND e."ComplexContainer_Containee2_Id" = @entity_equality_container_Containee2_Id LIMIT 2 """); } diff --git a/test/EFCore.PG.FunctionalTests/Query/AdHocJsonQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/AdHocJsonQueryNpgsqlTest.cs index 056aab9d1..9dd0570f6 100644 --- a/test/EFCore.PG.FunctionalTests/Query/AdHocJsonQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/AdHocJsonQueryNpgsqlTest.cs @@ -266,6 +266,36 @@ public class TypesJsonEntity public TimeSpan Interval { get; set; } } + #region 34960 + + // These tests use a model with a non-UTC DateTime, which isn't supported in PG's timestamp with time zone + + public override Task Project_entity_with_json_null_values() + => Assert.ThrowsAsync(() => base.Project_entity_with_json_null_values()); + + public override Task Try_project_collection_but_JSON_is_entity() + => Assert.ThrowsAsync(() => base.Try_project_collection_but_JSON_is_entity()); + + public override Task Try_project_reference_but_JSON_is_collection() + => Assert.ThrowsAsync(() => base.Try_project_reference_but_JSON_is_collection()); + + #endregion 34960 + + #region 34293 + + // These tests use a model with a non-UTC DateTime, which isn't supported in PG's timestamp with time zone + + public override Task Project_entity_with_optional_json_entity_owned_by_required_json() + => Assert.ThrowsAsync(() => base.Project_entity_with_optional_json_entity_owned_by_required_json()); + + public override Task Project_required_json_entity() + => Assert.ThrowsAsync(() => base.Project_required_json_entity()); + + public override Task Project_optional_json_entity_owned_by_required_json_entity() + => Assert.ThrowsAsync(() => base.Project_optional_json_entity_owned_by_required_json_entity()); + + #endregion 34293 + protected void AssertSql(params string[] expected) => TestSqlLoggerFactory.AssertBaseline(expected); } diff --git a/test/EFCore.PG.FunctionalTests/Query/AdHocPrecompiledQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/AdHocPrecompiledQueryNpgsqlTest.cs index 8839ca80e..928af749b 100644 --- a/test/EFCore.PG.FunctionalTests/Query/AdHocPrecompiledQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/AdHocPrecompiledQueryNpgsqlTest.cs @@ -27,11 +27,11 @@ public override async Task Index_with_captured_variable() AssertSql( """ -@__id_0='1' +@id='1' SELECT j."Id", j."IntList", j."JsonThing" FROM "JsonEntities" AS j -WHERE j."IntList"[@__id_0 + 1] = 2 +WHERE j."IntList"[@id + 1] = 2 """); } diff --git a/test/EFCore.PG.FunctionalTests/Query/ArrayArrayQueryTest.cs b/test/EFCore.PG.FunctionalTests/Query/ArrayArrayQueryTest.cs index e00543860..d0226d174 100644 --- a/test/EFCore.PG.FunctionalTests/Query/ArrayArrayQueryTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/ArrayArrayQueryTest.cs @@ -25,11 +25,11 @@ public override async Task Index_with_parameter(bool async) AssertSql( """ -@__x_0='0' +@x='0' SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."IntArray"[@__x_0 + 1] = 3 +WHERE s."IntArray"[@x + 1] = 3 """); } @@ -119,11 +119,11 @@ public override async Task SequenceEqual_with_parameter(bool async) AssertSql( """ -@__arr_0={ '3', '4' } (DbType = Object) +@arr={ '3', '4' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."IntArray" = @__arr_0 +WHERE s."IntArray" = @arr """); } @@ -145,11 +145,11 @@ public override async Task SequenceEqual_over_nullable_with_parameter(bool async AssertSql( """ -@__arr_0={ '3', '4', NULL } (DbType = Object) +@arr={ '3', '4', NULL } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."NullableIntArray" = @__arr_0 +WHERE s."NullableIntArray" = @arr """); } @@ -199,11 +199,11 @@ public override async Task Array_column_Contains_parameter_item(bool async) AssertSql( """ -@__p_0='3' +@p='3' SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."IntArray" @> ARRAY[@__p_0]::integer[] +WHERE s."IntArray" @> ARRAY[@p]::integer[] """); } @@ -287,11 +287,11 @@ await AssertQuery( AssertSql( """ -@__array_0={ 'foo', 'xxx' } (DbType = Object) +@array={ 'foo', 'xxx' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."NullableText" = ANY (@__array_0) OR (s."NullableText" IS NULL AND array_position(@__array_0, NULL) IS NOT NULL) +WHERE s."NullableText" = ANY (@array) OR (s."NullableText" IS NULL AND array_position(@array, NULL) IS NOT NULL) """); } @@ -305,11 +305,11 @@ await AssertQuery( AssertSql( """ -@__array_0={ '1' } (DbType = Object) +@array={ '1' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."Id" = ANY (@__array_0) +WHERE s."Id" = ANY (@array) """); } @@ -323,11 +323,11 @@ public override void Array_param_with_null_Contains_non_nullable_not_found() AssertSql( """ -@__array_0={ 'unknown1', 'unknown2', NULL } (DbType = Object) +@array={ 'unknown1', 'unknown2', NULL } (DbType = Object) SELECT count(*)::int FROM "SomeEntities" AS s -WHERE s."NonNullableText" = ANY (@__array_0) +WHERE s."NonNullableText" = ANY (@array) """); } @@ -341,11 +341,11 @@ public override void Array_param_with_null_Contains_non_nullable_not_found_negat AssertSql( """ -@__array_0={ 'unknown1', 'unknown2', NULL } (DbType = Object) +@array={ 'unknown1', 'unknown2', NULL } (DbType = Object) SELECT count(*)::int FROM "SomeEntities" AS s -WHERE NOT (s."NonNullableText" = ANY (@__array_0) AND s."NonNullableText" = ANY (@__array_0) IS NOT NULL) +WHERE NOT (s."NonNullableText" = ANY (@array) AND s."NonNullableText" = ANY (@array) IS NOT NULL) """); } @@ -359,11 +359,11 @@ public override void Array_param_with_null_Contains_nullable_not_found() AssertSql( """ -@__array_0={ 'unknown1', 'unknown2', NULL } (DbType = Object) +@array={ 'unknown1', 'unknown2', NULL } (DbType = Object) SELECT count(*)::int FROM "SomeEntities" AS s -WHERE s."NullableText" = ANY (@__array_0) OR (s."NullableText" IS NULL AND array_position(@__array_0, NULL) IS NOT NULL) +WHERE s."NullableText" = ANY (@array) OR (s."NullableText" IS NULL AND array_position(@array, NULL) IS NOT NULL) """); } @@ -377,11 +377,11 @@ public override void Array_param_with_null_Contains_nullable_not_found_negated() AssertSql( """ -@__array_0={ 'unknown1', 'unknown2', NULL } (DbType = Object) +@array={ 'unknown1', 'unknown2', NULL } (DbType = Object) SELECT count(*)::int FROM "SomeEntities" AS s -WHERE NOT (s."NullableText" = ANY (@__array_0) AND s."NullableText" = ANY (@__array_0) IS NOT NULL) AND (s."NullableText" IS NOT NULL OR array_position(@__array_0, NULL) IS NULL) +WHERE NOT (s."NullableText" = ANY (@array) AND s."NullableText" = ANY (@array) IS NOT NULL) AND (s."NullableText" IS NOT NULL OR array_position(@array, NULL) IS NULL) """); } @@ -395,11 +395,11 @@ await AssertQuery( AssertSql( """ -@__values_0={ '1', '999' } (DbType = Object) +@values={ '1', '999' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."Id"::text = ANY (@__values_0) +WHERE s."Id"::text = ANY (@values) """); } @@ -414,11 +414,11 @@ await AssertQuery( // Note: EF Core prints the parameter as a bytea, but it's actually a smallint[] (otherwise ANY would fail) AssertSql( """ -@__values_0='0x14' (DbType = Object) +@values='0x14' (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."Byte" = ANY (@__values_0) +WHERE s."Byte" = ANY (@values) """); } @@ -432,11 +432,11 @@ await AssertQuery( AssertSql( """ -@__array_0={ '-2', '-3' } (DbType = Object) +@array={ '-2', '-3' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."EnumConvertedToInt" = ANY (@__array_0) +WHERE s."EnumConvertedToInt" = ANY (@array) """); } @@ -450,11 +450,11 @@ await AssertQuery( AssertSql( """ -@__array_0={ 'Two', 'Three' } (DbType = Object) +@array={ 'Two', 'Three' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."EnumConvertedToString" = ANY (@__array_0) +WHERE s."EnumConvertedToString" = ANY (@array) """); } @@ -468,11 +468,11 @@ await AssertQuery( AssertSql( """ -@__array_0={ 'Two', 'Three' } (DbType = Object) +@array={ 'Two', 'Three' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."NullableEnumConvertedToString" = ANY (@__array_0) OR (s."NullableEnumConvertedToString" IS NULL AND array_position(@__array_0, NULL) IS NOT NULL) +WHERE s."NullableEnumConvertedToString" = ANY (@array) OR (s."NullableEnumConvertedToString" IS NULL AND array_position(@array, NULL) IS NOT NULL) """); } @@ -486,11 +486,11 @@ await AssertQuery( AssertSql( """ -@__array_0={ 'Two', 'Three' } (DbType = Object) +@array={ 'Two', 'Three' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."NullableEnumConvertedToStringWithNonNullableLambda" = ANY (@__array_0) OR (s."NullableEnumConvertedToStringWithNonNullableLambda" IS NULL AND array_position(@__array_0, NULL) IS NOT NULL) +WHERE s."NullableEnumConvertedToStringWithNonNullableLambda" = ANY (@array) OR (s."NullableEnumConvertedToStringWithNonNullableLambda" IS NULL AND array_position(@array, NULL) IS NOT NULL) """); } @@ -504,11 +504,11 @@ await AssertQuery( AssertSql( """ -@__item_0='Eight' (Nullable = false) +@item='Eight' (Nullable = false) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."ValueConvertedArrayOfEnum" @> ARRAY[@__item_0]::text[] +WHERE s."ValueConvertedArrayOfEnum" @> ARRAY[@item]::text[] """); } @@ -536,11 +536,11 @@ await AssertQuery( AssertSql( """ -@__p_0={ 'Eight', 'Nine' } (DbType = Object) +@p={ 'Eight', 'Nine' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."ValueConvertedArrayOfEnum" <@ @__p_0 +WHERE s."ValueConvertedArrayOfEnum" <@ @p """); } @@ -685,11 +685,11 @@ await AssertQuery( AssertSql( """ -@__patternsActual_1={ 'a%', 'b%', 'c%' } (DbType = Object) +@patternsActual={ 'a%', 'b%', 'c%' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."NullableText" LIKE ANY (@__patternsActual_1) +WHERE s."NullableText" LIKE ANY (@patternsActual) """); } @@ -745,11 +745,11 @@ public override async Task Any_Contains_between_column_and_List(bool async) AssertSql( """ -@__ints_0={ '2', '3' } (DbType = Object) +@ints={ '2', '3' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."IntArray" && @__ints_0 +WHERE s."IntArray" && @ints """); } @@ -759,11 +759,11 @@ public override async Task Any_Contains_between_column_and_array(bool async) AssertSql( """ -@__ints_0={ '2', '3' } (DbType = Object) +@ints={ '2', '3' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."IntArray" && @__ints_0 +WHERE s."IntArray" && @ints """); } @@ -777,11 +777,11 @@ await AssertQuery( AssertSql( """ -@__list_0={ 'Eight' } (DbType = Object) +@list={ 'Eight' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."ValueConvertedArrayOfEnum" && @__list_0 +WHERE s."ValueConvertedArrayOfEnum" && @list """); } diff --git a/test/EFCore.PG.FunctionalTests/Query/ArrayListQueryTest.cs b/test/EFCore.PG.FunctionalTests/Query/ArrayListQueryTest.cs index 361fb653b..896060c8f 100644 --- a/test/EFCore.PG.FunctionalTests/Query/ArrayListQueryTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/ArrayListQueryTest.cs @@ -30,11 +30,11 @@ public override async Task Index_with_parameter(bool async) AssertSql( """ -@__x_0='0' +@x='0' SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."IntList"[@__x_0 + 1] = 3 +WHERE s."IntList"[@x + 1] = 3 """); } @@ -108,11 +108,11 @@ public override async Task SequenceEqual_with_parameter(bool async) AssertSql( """ -@__arr_0={ '3', '4' } (DbType = Object) +@arr={ '3', '4' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."IntList" = @__arr_0 +WHERE s."IntList" = @arr """); } @@ -134,11 +134,11 @@ public override async Task SequenceEqual_over_nullable_with_parameter(bool async AssertSql( """ -@__arr_0={ '3', '4', NULL } (DbType = Object) +@arr={ '3', '4', NULL } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."NullableIntList" = @__arr_0 +WHERE s."NullableIntList" = @arr """); } @@ -188,11 +188,11 @@ public override async Task Array_column_Contains_parameter_item(bool async) AssertSql( """ -@__p_0='3' +@p='3' SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."IntList" @> ARRAY[@__p_0]::integer[] +WHERE s."IntList" @> ARRAY[@p]::integer[] """); } @@ -276,11 +276,11 @@ await AssertQuery( AssertSql( """ -@__array_0={ 'foo', 'xxx' } (DbType = Object) +@array={ 'foo', 'xxx' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."NullableText" = ANY (@__array_0) OR (s."NullableText" IS NULL AND array_position(@__array_0, NULL) IS NOT NULL) +WHERE s."NullableText" = ANY (@array) OR (s."NullableText" IS NULL AND array_position(@array, NULL) IS NOT NULL) """); } @@ -294,11 +294,11 @@ await AssertQuery( AssertSql( """ -@__array_0={ '1' } (DbType = Object) +@array={ '1' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."Id" = ANY (@__array_0) +WHERE s."Id" = ANY (@array) """); } @@ -317,11 +317,11 @@ public override void Array_param_with_null_Contains_non_nullable_not_found() AssertSql( """ -@__array_0={ 'unknown1', 'unknown2', NULL } (DbType = Object) +@array={ 'unknown1', 'unknown2', NULL } (DbType = Object) SELECT count(*)::int FROM "SomeEntities" AS s -WHERE s."NonNullableText" = ANY (@__array_0) +WHERE s."NonNullableText" = ANY (@array) """); } @@ -340,11 +340,11 @@ public override void Array_param_with_null_Contains_non_nullable_not_found_negat AssertSql( """ -@__array_0={ 'unknown1', 'unknown2', NULL } (DbType = Object) +@array={ 'unknown1', 'unknown2', NULL } (DbType = Object) SELECT count(*)::int FROM "SomeEntities" AS s -WHERE NOT (s."NonNullableText" = ANY (@__array_0) AND s."NonNullableText" = ANY (@__array_0) IS NOT NULL) +WHERE NOT (s."NonNullableText" = ANY (@array) AND s."NonNullableText" = ANY (@array) IS NOT NULL) """); } @@ -363,11 +363,11 @@ public override void Array_param_with_null_Contains_nullable_not_found() AssertSql( """ -@__array_0={ 'unknown1', 'unknown2', NULL } (DbType = Object) +@array={ 'unknown1', 'unknown2', NULL } (DbType = Object) SELECT count(*)::int FROM "SomeEntities" AS s -WHERE s."NullableText" = ANY (@__array_0) OR (s."NullableText" IS NULL AND array_position(@__array_0, NULL) IS NOT NULL) +WHERE s."NullableText" = ANY (@array) OR (s."NullableText" IS NULL AND array_position(@array, NULL) IS NOT NULL) """); } @@ -386,11 +386,11 @@ public override void Array_param_with_null_Contains_nullable_not_found_negated() AssertSql( """ -@__array_0={ 'unknown1', 'unknown2', NULL } (DbType = Object) +@array={ 'unknown1', 'unknown2', NULL } (DbType = Object) SELECT count(*)::int FROM "SomeEntities" AS s -WHERE NOT (s."NullableText" = ANY (@__array_0) AND s."NullableText" = ANY (@__array_0) IS NOT NULL) AND (s."NullableText" IS NOT NULL OR array_position(@__array_0, NULL) IS NULL) +WHERE NOT (s."NullableText" = ANY (@array) AND s."NullableText" = ANY (@array) IS NOT NULL) AND (s."NullableText" IS NOT NULL OR array_position(@array, NULL) IS NULL) """); } @@ -404,11 +404,11 @@ await AssertQuery( AssertSql( """ -@__values_0={ '1', '999' } (DbType = Object) +@values={ '1', '999' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."Id"::text = ANY (@__values_0) +WHERE s."Id"::text = ANY (@values) """); } @@ -422,11 +422,11 @@ await AssertQuery( AssertSql( """ -@__values_0={ '20' } (DbType = Object) +@values={ '20' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."Byte" = ANY (@__values_0) +WHERE s."Byte" = ANY (@values) """); } @@ -440,11 +440,11 @@ await AssertQuery( AssertSql( """ -@__array_0={ '-2', '-3' } (DbType = Object) +@array={ '-2', '-3' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."EnumConvertedToInt" = ANY (@__array_0) +WHERE s."EnumConvertedToInt" = ANY (@array) """); } @@ -458,11 +458,11 @@ await AssertQuery( AssertSql( """ -@__array_0={ 'Two', 'Three' } (DbType = Object) +@array={ 'Two', 'Three' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."EnumConvertedToString" = ANY (@__array_0) +WHERE s."EnumConvertedToString" = ANY (@array) """); } @@ -476,11 +476,11 @@ await AssertQuery( AssertSql( """ -@__array_0={ 'Two', 'Three' } (DbType = Object) +@array={ 'Two', 'Three' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."NullableEnumConvertedToString" = ANY (@__array_0) OR (s."NullableEnumConvertedToString" IS NULL AND array_position(@__array_0, NULL) IS NOT NULL) +WHERE s."NullableEnumConvertedToString" = ANY (@array) OR (s."NullableEnumConvertedToString" IS NULL AND array_position(@array, NULL) IS NOT NULL) """); } @@ -494,11 +494,11 @@ await AssertQuery( AssertSql( """ -@__array_0={ 'Two', 'Three' } (DbType = Object) +@array={ 'Two', 'Three' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."NullableEnumConvertedToStringWithNonNullableLambda" = ANY (@__array_0) OR (s."NullableEnumConvertedToStringWithNonNullableLambda" IS NULL AND array_position(@__array_0, NULL) IS NOT NULL) +WHERE s."NullableEnumConvertedToStringWithNonNullableLambda" = ANY (@array) OR (s."NullableEnumConvertedToStringWithNonNullableLambda" IS NULL AND array_position(@array, NULL) IS NOT NULL) """); } @@ -512,11 +512,11 @@ await AssertQuery( AssertSql( """ -@__item_0='Eight' (Nullable = false) +@item='Eight' (Nullable = false) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."ValueConvertedListOfEnum" @> ARRAY[@__item_0]::text[] +WHERE s."ValueConvertedListOfEnum" @> ARRAY[@item]::text[] """); } @@ -544,11 +544,11 @@ await AssertQuery( AssertSql( """ -@__p_0={ 'Eight', 'Nine' } (DbType = Object) +@p={ 'Eight', 'Nine' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."ValueConvertedListOfEnum" <@ @__p_0 +WHERE s."ValueConvertedListOfEnum" <@ @p """); } @@ -703,11 +703,11 @@ await AssertQuery( AssertSql( """ -@__patternsActual_1={ 'a%', 'b%', 'c%' } (DbType = Object) +@patternsActual={ 'a%', 'b%', 'c%' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."NullableText" LIKE ANY (@__patternsActual_1) +WHERE s."NullableText" LIKE ANY (@patternsActual) """); } @@ -763,11 +763,11 @@ public override async Task Any_Contains_between_column_and_List(bool async) AssertSql( """ -@__ints_0={ '2', '3' } (DbType = Object) +@ints={ '2', '3' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."IntList" && @__ints_0 +WHERE s."IntList" && @ints """); } @@ -777,11 +777,11 @@ public override async Task Any_Contains_between_column_and_array(bool async) AssertSql( """ -@__ints_0={ '2', '3' } (DbType = Object) +@ints={ '2', '3' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."IntList" && @__ints_0 +WHERE s."IntList" && @ints """); } @@ -795,11 +795,11 @@ await AssertQuery( AssertSql( """ -@__array_0={ 'Eight' } (DbType = Object) +@array={ 'Eight' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s -WHERE s."ValueConvertedListOfEnum" && @__array_0 +WHERE s."ValueConvertedListOfEnum" && @array """); } diff --git a/test/EFCore.PG.FunctionalTests/Query/CitextQueryTest.cs b/test/EFCore.PG.FunctionalTests/Query/CitextQueryTest.cs index d87ad0c9c..b55d1d3d0 100644 --- a/test/EFCore.PG.FunctionalTests/Query/CitextQueryTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/CitextQueryTest.cs @@ -44,11 +44,11 @@ public void StartsWith_param_pattern() Assert.Equal(1, result.Id); AssertSql( """ -@__param_0_startswith='some%' +@param_startswith='some%' SELECT s."Id", s."CaseInsensitiveText" FROM "SomeEntities" AS s -WHERE s."CaseInsensitiveText" LIKE @__param_0_startswith +WHERE s."CaseInsensitiveText" LIKE @param_startswith LIMIT 2 """); } @@ -63,11 +63,11 @@ public void StartsWith_param_instance() Assert.Equal(1, result.Id); AssertSql( """ -@__param_0='SomeTextWithExtraStuff' +@param='SomeTextWithExtraStuff' SELECT s."Id", s."CaseInsensitiveText" FROM "SomeEntities" AS s -WHERE s."CaseInsensitiveText" IS NOT NULL AND left(@__param_0, length(s."CaseInsensitiveText"))::citext = s."CaseInsensitiveText" +WHERE s."CaseInsensitiveText" IS NOT NULL AND left(@param, length(s."CaseInsensitiveText"))::citext = s."CaseInsensitiveText" LIMIT 2 """); } @@ -98,11 +98,11 @@ public void EndsWith_param_pattern() Assert.Equal(1, result.Id); AssertSql( """ -@__param_0_endswith='%sometext' +@param_endswith='%sometext' SELECT s."Id", s."CaseInsensitiveText" FROM "SomeEntities" AS s -WHERE s."CaseInsensitiveText" LIKE @__param_0_endswith +WHERE s."CaseInsensitiveText" LIKE @param_endswith LIMIT 2 """); } @@ -117,11 +117,11 @@ public void EndsWith_param_instance() Assert.Equal(1, result.Id); AssertSql( """ -@__param_0='ExtraStuffThenSomeText' +@param='ExtraStuffThenSomeText' SELECT s."Id", s."CaseInsensitiveText" FROM "SomeEntities" AS s -WHERE s."CaseInsensitiveText" IS NOT NULL AND right(@__param_0, length(s."CaseInsensitiveText"))::citext = s."CaseInsensitiveText" +WHERE s."CaseInsensitiveText" IS NOT NULL AND right(@param, length(s."CaseInsensitiveText"))::citext = s."CaseInsensitiveText" LIMIT 2 """); } @@ -152,11 +152,11 @@ public void Contains_param_pattern() Assert.Equal(1, result.Id); AssertSql( """ -@__param_0_contains='%ometex%' +@param_contains='%ometex%' SELECT s."Id", s."CaseInsensitiveText" FROM "SomeEntities" AS s -WHERE s."CaseInsensitiveText" LIKE @__param_0_contains +WHERE s."CaseInsensitiveText" LIKE @param_contains LIMIT 2 """); } @@ -171,11 +171,11 @@ public void Contains_param_instance() Assert.Equal(1, result.Id); AssertSql( """ -@__param_0='ExtraSometextExtra' +@param='ExtraSometextExtra' SELECT s."Id", s."CaseInsensitiveText" FROM "SomeEntities" AS s -WHERE s."CaseInsensitiveText" IS NOT NULL AND strpos(@__param_0, s."CaseInsensitiveText") > 0 +WHERE s."CaseInsensitiveText" IS NOT NULL AND strpos(@param, s."CaseInsensitiveText") > 0 LIMIT 2 """); } @@ -206,11 +206,11 @@ public void IndexOf_param_pattern() Assert.Equal(1, result.Id); AssertSql( """ -@__param_0='ometex' +@param='ometex' SELECT s."Id", s."CaseInsensitiveText" FROM "SomeEntities" AS s -WHERE strpos(s."CaseInsensitiveText", @__param_0) - 1 = 1 +WHERE strpos(s."CaseInsensitiveText", @param) - 1 = 1 LIMIT 2 """); } @@ -225,11 +225,11 @@ public void IndexOf_param_instance() Assert.Equal(1, result.Id); AssertSql( """ -@__param_0='ExtraSometextExtra' +@param='ExtraSometextExtra' SELECT s."Id", s."CaseInsensitiveText" FROM "SomeEntities" AS s -WHERE strpos(@__param_0, s."CaseInsensitiveText") - 1 = 5 +WHERE strpos(@param, s."CaseInsensitiveText") - 1 = 5 LIMIT 2 """); } @@ -260,11 +260,11 @@ public void Replace_param_pattern() Assert.Equal(1, result.Id); AssertSql( """ -@__param_0='Te' +@param='Te' SELECT s."Id", s."CaseInsensitiveText" FROM "SomeEntities" AS s -WHERE replace(s."CaseInsensitiveText", @__param_0, 'Ne') = 'SomeNext' +WHERE replace(s."CaseInsensitiveText", @param, 'Ne') = 'SomeNext' LIMIT 2 """); } @@ -279,11 +279,11 @@ public void Replace_param_instance() Assert.Equal(1, result.Id); AssertSql( """ -@__param_0='ExtraSometextExtra' +@param='ExtraSometextExtra' SELECT s."Id", s."CaseInsensitiveText" FROM "SomeEntities" AS s -WHERE replace(@__param_0, s."CaseInsensitiveText", 'NewStuff') = 'ExtraNewStuffExtra' +WHERE replace(@param, s."CaseInsensitiveText", 'NewStuff') = 'ExtraNewStuffExtra' LIMIT 2 """); } diff --git a/test/EFCore.PG.FunctionalTests/Query/ComplexTypeQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/ComplexTypeQueryNpgsqlTest.cs index d46b14a82..f6bd6a21a 100644 --- a/test/EFCore.PG.FunctionalTests/Query/ComplexTypeQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/ComplexTypeQueryNpgsqlTest.cs @@ -42,14 +42,14 @@ public override async Task Filter_on_property_inside_complex_type_after_subquery AssertSql( """ -@__p_0='1' +@p='1' SELECT DISTINCT c0."Id", c0."Name", c0."BillingAddress_AddressLine1", c0."BillingAddress_AddressLine2", c0."BillingAddress_Tags", c0."BillingAddress_ZipCode", c0."BillingAddress_Country_Code", c0."BillingAddress_Country_FullName", c0."ShippingAddress_AddressLine1", c0."ShippingAddress_AddressLine2", c0."ShippingAddress_Tags", c0."ShippingAddress_ZipCode", c0."ShippingAddress_Country_Code", c0."ShippingAddress_Country_FullName" FROM ( SELECT c."Id", c."Name", c."BillingAddress_AddressLine1", c."BillingAddress_AddressLine2", c."BillingAddress_Tags", c."BillingAddress_ZipCode", c."BillingAddress_Country_Code", c."BillingAddress_Country_FullName", c."ShippingAddress_AddressLine1", c."ShippingAddress_AddressLine2", c."ShippingAddress_Tags", c."ShippingAddress_ZipCode", c."ShippingAddress_Country_Code", c."ShippingAddress_Country_FullName" FROM "Customer" AS c ORDER BY c."Id" NULLS FIRST - OFFSET @__p_0 + OFFSET @p ) AS c0 WHERE c0."ShippingAddress_ZipCode" = 7728 """); @@ -61,14 +61,14 @@ public override async Task Filter_on_property_inside_nested_complex_type_after_s AssertSql( """ -@__p_0='1' +@p='1' SELECT DISTINCT c0."Id", c0."Name", c0."BillingAddress_AddressLine1", c0."BillingAddress_AddressLine2", c0."BillingAddress_Tags", c0."BillingAddress_ZipCode", c0."BillingAddress_Country_Code", c0."BillingAddress_Country_FullName", c0."ShippingAddress_AddressLine1", c0."ShippingAddress_AddressLine2", c0."ShippingAddress_Tags", c0."ShippingAddress_ZipCode", c0."ShippingAddress_Country_Code", c0."ShippingAddress_Country_FullName" FROM ( SELECT c."Id", c."Name", c."BillingAddress_AddressLine1", c."BillingAddress_AddressLine2", c."BillingAddress_Tags", c."BillingAddress_ZipCode", c."BillingAddress_Country_Code", c."BillingAddress_Country_FullName", c."ShippingAddress_AddressLine1", c."ShippingAddress_AddressLine2", c."ShippingAddress_Tags", c."ShippingAddress_ZipCode", c."ShippingAddress_Country_Code", c."ShippingAddress_Country_FullName" FROM "Customer" AS c ORDER BY c."Id" NULLS FIRST - OFFSET @__p_0 + OFFSET @p ) AS c0 WHERE c0."ShippingAddress_Country_Code" = 'DE' """); @@ -130,14 +130,14 @@ public override async Task Load_complex_type_after_subquery_on_entity_type(bool AssertSql( """ -@__p_0='1' +@p='1' SELECT DISTINCT c0."Id", c0."Name", c0."BillingAddress_AddressLine1", c0."BillingAddress_AddressLine2", c0."BillingAddress_Tags", c0."BillingAddress_ZipCode", c0."BillingAddress_Country_Code", c0."BillingAddress_Country_FullName", c0."ShippingAddress_AddressLine1", c0."ShippingAddress_AddressLine2", c0."ShippingAddress_Tags", c0."ShippingAddress_ZipCode", c0."ShippingAddress_Country_Code", c0."ShippingAddress_Country_FullName" FROM ( SELECT c."Id", c."Name", c."BillingAddress_AddressLine1", c."BillingAddress_AddressLine2", c."BillingAddress_Tags", c."BillingAddress_ZipCode", c."BillingAddress_Country_Code", c."BillingAddress_Country_FullName", c."ShippingAddress_AddressLine1", c."ShippingAddress_AddressLine2", c."ShippingAddress_Tags", c."ShippingAddress_ZipCode", c."ShippingAddress_Country_Code", c."ShippingAddress_Country_FullName" FROM "Customer" AS c ORDER BY c."Id" NULLS FIRST - OFFSET @__p_0 + OFFSET @p ) AS c0 """); } @@ -228,15 +228,15 @@ public override async Task Complex_type_equals_parameter(bool async) AssertSql( """ -@__entity_equality_address_0_AddressLine1='804 S. Lakeshore Road' -@__entity_equality_address_0_Tags={ 'foo', 'bar' } (DbType = Object) -@__entity_equality_address_0_ZipCode='38654' (Nullable = true) -@__entity_equality_address_0_Country_Code='US' -@__entity_equality_address_0_Country_FullName='United States' +@entity_equality_address_AddressLine1='804 S. Lakeshore Road' +@entity_equality_address_Tags={ 'foo', 'bar' } (DbType = Object) +@entity_equality_address_ZipCode='38654' (Nullable = true) +@entity_equality_address_Country_Code='US' +@entity_equality_address_Country_FullName='United States' SELECT c."Id", c."Name", c."BillingAddress_AddressLine1", c."BillingAddress_AddressLine2", c."BillingAddress_Tags", c."BillingAddress_ZipCode", c."BillingAddress_Country_Code", c."BillingAddress_Country_FullName", c."ShippingAddress_AddressLine1", c."ShippingAddress_AddressLine2", c."ShippingAddress_Tags", c."ShippingAddress_ZipCode", c."ShippingAddress_Country_Code", c."ShippingAddress_Country_FullName" FROM "Customer" AS c -WHERE c."ShippingAddress_AddressLine1" = @__entity_equality_address_0_AddressLine1 AND c."ShippingAddress_AddressLine2" IS NULL AND c."ShippingAddress_Tags" = @__entity_equality_address_0_Tags AND c."ShippingAddress_ZipCode" = @__entity_equality_address_0_ZipCode AND c."ShippingAddress_Country_Code" = @__entity_equality_address_0_Country_Code AND c."ShippingAddress_Country_FullName" = @__entity_equality_address_0_Country_FullName +WHERE c."ShippingAddress_AddressLine1" = @entity_equality_address_AddressLine1 AND c."ShippingAddress_AddressLine2" IS NULL AND c."ShippingAddress_Tags" = @entity_equality_address_Tags AND c."ShippingAddress_ZipCode" = @entity_equality_address_ZipCode AND c."ShippingAddress_Country_Code" = @entity_equality_address_Country_Code AND c."ShippingAddress_Country_FullName" = @entity_equality_address_Country_FullName """); } @@ -260,18 +260,18 @@ public override async Task Contains_over_complex_type(bool async) AssertSql( """ -@__entity_equality_address_0_AddressLine1='804 S. Lakeshore Road' -@__entity_equality_address_0_Tags={ 'foo', 'bar' } (DbType = Object) -@__entity_equality_address_0_ZipCode='38654' (Nullable = true) -@__entity_equality_address_0_Country_Code='US' -@__entity_equality_address_0_Country_FullName='United States' +@entity_equality_address_AddressLine1='804 S. Lakeshore Road' +@entity_equality_address_Tags={ 'foo', 'bar' } (DbType = Object) +@entity_equality_address_ZipCode='38654' (Nullable = true) +@entity_equality_address_Country_Code='US' +@entity_equality_address_Country_FullName='United States' SELECT c."Id", c."Name", c."BillingAddress_AddressLine1", c."BillingAddress_AddressLine2", c."BillingAddress_Tags", c."BillingAddress_ZipCode", c."BillingAddress_Country_Code", c."BillingAddress_Country_FullName", c."ShippingAddress_AddressLine1", c."ShippingAddress_AddressLine2", c."ShippingAddress_Tags", c."ShippingAddress_ZipCode", c."ShippingAddress_Country_Code", c."ShippingAddress_Country_FullName" FROM "Customer" AS c WHERE EXISTS ( SELECT 1 FROM "Customer" AS c0 - WHERE c0."ShippingAddress_AddressLine1" = @__entity_equality_address_0_AddressLine1 AND c0."ShippingAddress_AddressLine2" IS NULL AND c0."ShippingAddress_Tags" = @__entity_equality_address_0_Tags AND c0."ShippingAddress_ZipCode" = @__entity_equality_address_0_ZipCode AND c0."ShippingAddress_Country_Code" = @__entity_equality_address_0_Country_Code AND c0."ShippingAddress_Country_FullName" = @__entity_equality_address_0_Country_FullName) + WHERE c0."ShippingAddress_AddressLine1" = @entity_equality_address_AddressLine1 AND c0."ShippingAddress_AddressLine2" IS NULL AND c0."ShippingAddress_Tags" = @entity_equality_address_Tags AND c0."ShippingAddress_ZipCode" = @entity_equality_address_ZipCode AND c0."ShippingAddress_Country_Code" = @entity_equality_address_Country_Code AND c0."ShippingAddress_Country_FullName" = @entity_equality_address_Country_FullName) """); } @@ -411,14 +411,14 @@ public override async Task Filter_on_property_inside_struct_complex_type_after_s AssertSql( """ -@__p_0='1' +@p='1' SELECT DISTINCT v0."Id", v0."Name", v0."BillingAddress_AddressLine1", v0."BillingAddress_AddressLine2", v0."BillingAddress_ZipCode", v0."BillingAddress_Country_Code", v0."BillingAddress_Country_FullName", v0."ShippingAddress_AddressLine1", v0."ShippingAddress_AddressLine2", v0."ShippingAddress_ZipCode", v0."ShippingAddress_Country_Code", v0."ShippingAddress_Country_FullName" FROM ( SELECT v."Id", v."Name", v."BillingAddress_AddressLine1", v."BillingAddress_AddressLine2", v."BillingAddress_ZipCode", v."BillingAddress_Country_Code", v."BillingAddress_Country_FullName", v."ShippingAddress_AddressLine1", v."ShippingAddress_AddressLine2", v."ShippingAddress_ZipCode", v."ShippingAddress_Country_Code", v."ShippingAddress_Country_FullName" FROM "ValuedCustomer" AS v ORDER BY v."Id" NULLS FIRST - OFFSET @__p_0 + OFFSET @p ) AS v0 WHERE v0."ShippingAddress_ZipCode" = 7728 """); @@ -430,14 +430,14 @@ public override async Task Filter_on_property_inside_nested_struct_complex_type_ AssertSql( """ -@__p_0='1' +@p='1' SELECT DISTINCT v0."Id", v0."Name", v0."BillingAddress_AddressLine1", v0."BillingAddress_AddressLine2", v0."BillingAddress_ZipCode", v0."BillingAddress_Country_Code", v0."BillingAddress_Country_FullName", v0."ShippingAddress_AddressLine1", v0."ShippingAddress_AddressLine2", v0."ShippingAddress_ZipCode", v0."ShippingAddress_Country_Code", v0."ShippingAddress_Country_FullName" FROM ( SELECT v."Id", v."Name", v."BillingAddress_AddressLine1", v."BillingAddress_AddressLine2", v."BillingAddress_ZipCode", v."BillingAddress_Country_Code", v."BillingAddress_Country_FullName", v."ShippingAddress_AddressLine1", v."ShippingAddress_AddressLine2", v."ShippingAddress_ZipCode", v."ShippingAddress_Country_Code", v."ShippingAddress_Country_FullName" FROM "ValuedCustomer" AS v ORDER BY v."Id" NULLS FIRST - OFFSET @__p_0 + OFFSET @p ) AS v0 WHERE v0."ShippingAddress_Country_Code" = 'DE' """); @@ -500,14 +500,14 @@ public override async Task Load_struct_complex_type_after_subquery_on_entity_typ AssertSql( """ -@__p_0='1' +@p='1' SELECT DISTINCT v0."Id", v0."Name", v0."BillingAddress_AddressLine1", v0."BillingAddress_AddressLine2", v0."BillingAddress_ZipCode", v0."BillingAddress_Country_Code", v0."BillingAddress_Country_FullName", v0."ShippingAddress_AddressLine1", v0."ShippingAddress_AddressLine2", v0."ShippingAddress_ZipCode", v0."ShippingAddress_Country_Code", v0."ShippingAddress_Country_FullName" FROM ( SELECT v."Id", v."Name", v."BillingAddress_AddressLine1", v."BillingAddress_AddressLine2", v."BillingAddress_ZipCode", v."BillingAddress_Country_Code", v."BillingAddress_Country_FullName", v."ShippingAddress_AddressLine1", v."ShippingAddress_AddressLine2", v."ShippingAddress_ZipCode", v."ShippingAddress_Country_Code", v."ShippingAddress_Country_FullName" FROM "ValuedCustomer" AS v ORDER BY v."Id" NULLS FIRST - OFFSET @__p_0 + OFFSET @p ) AS v0 """); } @@ -598,14 +598,14 @@ public override async Task Struct_complex_type_equals_parameter(bool async) AssertSql( """ -@__entity_equality_address_0_AddressLine1='804 S. Lakeshore Road' -@__entity_equality_address_0_ZipCode='38654' (Nullable = true) -@__entity_equality_address_0_Country_Code='US' -@__entity_equality_address_0_Country_FullName='United States' +@entity_equality_address_AddressLine1='804 S. Lakeshore Road' +@entity_equality_address_ZipCode='38654' (Nullable = true) +@entity_equality_address_Country_Code='US' +@entity_equality_address_Country_FullName='United States' SELECT v."Id", v."Name", v."BillingAddress_AddressLine1", v."BillingAddress_AddressLine2", v."BillingAddress_ZipCode", v."BillingAddress_Country_Code", v."BillingAddress_Country_FullName", v."ShippingAddress_AddressLine1", v."ShippingAddress_AddressLine2", v."ShippingAddress_ZipCode", v."ShippingAddress_Country_Code", v."ShippingAddress_Country_FullName" FROM "ValuedCustomer" AS v -WHERE v."ShippingAddress_AddressLine1" = @__entity_equality_address_0_AddressLine1 AND v."ShippingAddress_AddressLine2" IS NULL AND v."ShippingAddress_ZipCode" = @__entity_equality_address_0_ZipCode AND v."ShippingAddress_Country_Code" = @__entity_equality_address_0_Country_Code AND v."ShippingAddress_Country_FullName" = @__entity_equality_address_0_Country_FullName +WHERE v."ShippingAddress_AddressLine1" = @entity_equality_address_AddressLine1 AND v."ShippingAddress_AddressLine2" IS NULL AND v."ShippingAddress_ZipCode" = @entity_equality_address_ZipCode AND v."ShippingAddress_Country_Code" = @entity_equality_address_Country_Code AND v."ShippingAddress_Country_FullName" = @entity_equality_address_Country_FullName """); } @@ -622,17 +622,17 @@ public override async Task Contains_over_struct_complex_type(bool async) AssertSql( """ -@__entity_equality_address_0_AddressLine1='804 S. Lakeshore Road' -@__entity_equality_address_0_ZipCode='38654' (Nullable = true) -@__entity_equality_address_0_Country_Code='US' -@__entity_equality_address_0_Country_FullName='United States' +@entity_equality_address_AddressLine1='804 S. Lakeshore Road' +@entity_equality_address_ZipCode='38654' (Nullable = true) +@entity_equality_address_Country_Code='US' +@entity_equality_address_Country_FullName='United States' SELECT v."Id", v."Name", v."BillingAddress_AddressLine1", v."BillingAddress_AddressLine2", v."BillingAddress_ZipCode", v."BillingAddress_Country_Code", v."BillingAddress_Country_FullName", v."ShippingAddress_AddressLine1", v."ShippingAddress_AddressLine2", v."ShippingAddress_ZipCode", v."ShippingAddress_Country_Code", v."ShippingAddress_Country_FullName" FROM "ValuedCustomer" AS v WHERE EXISTS ( SELECT 1 FROM "ValuedCustomer" AS v0 - WHERE v0."ShippingAddress_AddressLine1" = @__entity_equality_address_0_AddressLine1 AND v0."ShippingAddress_AddressLine2" IS NULL AND v0."ShippingAddress_ZipCode" = @__entity_equality_address_0_ZipCode AND v0."ShippingAddress_Country_Code" = @__entity_equality_address_0_Country_Code AND v0."ShippingAddress_Country_FullName" = @__entity_equality_address_0_Country_FullName) + WHERE v0."ShippingAddress_AddressLine1" = @entity_equality_address_AddressLine1 AND v0."ShippingAddress_AddressLine2" IS NULL AND v0."ShippingAddress_ZipCode" = @entity_equality_address_ZipCode AND v0."ShippingAddress_Country_Code" = @entity_equality_address_Country_Code AND v0."ShippingAddress_Country_FullName" = @entity_equality_address_Country_FullName) """); } @@ -778,7 +778,7 @@ public override async Task Project_same_entity_with_nested_complex_type_twice_wi AssertSql( """ -@__p_0='50' +@p='50' SELECT s0."Id", s0."Name", s0."BillingAddress_AddressLine1", s0."BillingAddress_AddressLine2", s0."BillingAddress_Tags", s0."BillingAddress_ZipCode", s0."BillingAddress_Country_Code", s0."BillingAddress_Country_FullName", s0."ShippingAddress_AddressLine1", s0."ShippingAddress_AddressLine2", s0."ShippingAddress_Tags", s0."ShippingAddress_ZipCode", s0."ShippingAddress_Country_Code", s0."ShippingAddress_Country_FullName", s0."Id0", s0."Name0", s0."BillingAddress_AddressLine10", s0."BillingAddress_AddressLine20", s0."BillingAddress_Tags0", s0."BillingAddress_ZipCode0", s0."BillingAddress_Country_Code0", s0."BillingAddress_Country_FullName0", s0."ShippingAddress_AddressLine10", s0."ShippingAddress_AddressLine20", s0."ShippingAddress_Tags0", s0."ShippingAddress_ZipCode0", s0."ShippingAddress_Country_Code0", s0."ShippingAddress_Country_FullName0" FROM ( @@ -788,7 +788,7 @@ public override async Task Project_same_entity_with_nested_complex_type_twice_wi FROM "Customer" AS c CROSS JOIN "Customer" AS c0 ORDER BY c."Id" NULLS FIRST, c0."Id" NULLS FIRST - LIMIT @__p_0 + LIMIT @p ) AS s ) AS s0 """); @@ -800,7 +800,7 @@ public override async Task Project_same_nested_complex_type_twice_with_double_pu AssertSql( """ -@__p_0='50' +@p='50' SELECT s0."BillingAddress_AddressLine1", s0."BillingAddress_AddressLine2", s0."BillingAddress_Tags", s0."BillingAddress_ZipCode", s0."BillingAddress_Country_Code", s0."BillingAddress_Country_FullName", s0."BillingAddress_AddressLine10", s0."BillingAddress_AddressLine20", s0."BillingAddress_Tags0", s0."BillingAddress_ZipCode0", s0."BillingAddress_Country_Code0", s0."BillingAddress_Country_FullName0" FROM ( @@ -810,7 +810,7 @@ public override async Task Project_same_nested_complex_type_twice_with_double_pu FROM "Customer" AS c CROSS JOIN "Customer" AS c0 ORDER BY c."Id" NULLS FIRST, c0."Id" NULLS FIRST - LIMIT @__p_0 + LIMIT @p ) AS s ) AS s0 """); @@ -852,7 +852,7 @@ public override async Task Project_same_entity_with_struct_nested_complex_type_t AssertSql( """ -@__p_0='50' +@p='50' SELECT s0."Id", s0."Name", s0."BillingAddress_AddressLine1", s0."BillingAddress_AddressLine2", s0."BillingAddress_ZipCode", s0."BillingAddress_Country_Code", s0."BillingAddress_Country_FullName", s0."ShippingAddress_AddressLine1", s0."ShippingAddress_AddressLine2", s0."ShippingAddress_ZipCode", s0."ShippingAddress_Country_Code", s0."ShippingAddress_Country_FullName", s0."Id0", s0."Name0", s0."BillingAddress_AddressLine10", s0."BillingAddress_AddressLine20", s0."BillingAddress_ZipCode0", s0."BillingAddress_Country_Code0", s0."BillingAddress_Country_FullName0", s0."ShippingAddress_AddressLine10", s0."ShippingAddress_AddressLine20", s0."ShippingAddress_ZipCode0", s0."ShippingAddress_Country_Code0", s0."ShippingAddress_Country_FullName0" FROM ( @@ -862,7 +862,7 @@ public override async Task Project_same_entity_with_struct_nested_complex_type_t FROM "ValuedCustomer" AS v CROSS JOIN "ValuedCustomer" AS v0 ORDER BY v."Id" NULLS FIRST, v0."Id" NULLS FIRST - LIMIT @__p_0 + LIMIT @p ) AS s ) AS s0 """); @@ -874,7 +874,7 @@ public override async Task Project_same_struct_nested_complex_type_twice_with_do AssertSql( """ -@__p_0='50' +@p='50' SELECT s0."BillingAddress_AddressLine1", s0."BillingAddress_AddressLine2", s0."BillingAddress_ZipCode", s0."BillingAddress_Country_Code", s0."BillingAddress_Country_FullName", s0."BillingAddress_AddressLine10", s0."BillingAddress_AddressLine20", s0."BillingAddress_ZipCode0", s0."BillingAddress_Country_Code0", s0."BillingAddress_Country_FullName0" FROM ( @@ -884,7 +884,7 @@ public override async Task Project_same_struct_nested_complex_type_twice_with_do FROM "ValuedCustomer" AS v CROSS JOIN "ValuedCustomer" AS v0 ORDER BY v."Id" NULLS FIRST, v0."Id" NULLS FIRST - LIMIT @__p_0 + LIMIT @p ) AS s ) AS s0 """); @@ -896,7 +896,7 @@ public override async Task Union_of_same_entity_with_nested_complex_type_project AssertSql( """ -@__p_0='50' +@p='50' SELECT u."Id", u."Name", u."BillingAddress_AddressLine1", u."BillingAddress_AddressLine2", u."BillingAddress_Tags", u."BillingAddress_ZipCode", u."BillingAddress_Country_Code", u."BillingAddress_Country_FullName", u."ShippingAddress_AddressLine1", u."ShippingAddress_AddressLine2", u."ShippingAddress_Tags", u."ShippingAddress_ZipCode", u."ShippingAddress_Country_Code", u."ShippingAddress_Country_FullName", u."Id0", u."Name0", u."BillingAddress_AddressLine10", u."BillingAddress_AddressLine20", u."BillingAddress_Tags0", u."BillingAddress_ZipCode0", u."BillingAddress_Country_Code0", u."BillingAddress_Country_FullName0", u."ShippingAddress_AddressLine10", u."ShippingAddress_AddressLine20", u."ShippingAddress_Tags0", u."ShippingAddress_ZipCode0", u."ShippingAddress_Country_Code0", u."ShippingAddress_Country_FullName0" FROM ( @@ -909,7 +909,7 @@ CROSS JOIN "Customer" AS c0 CROSS JOIN "Customer" AS c2 ) AS u ORDER BY u."Id" NULLS FIRST, u."Id0" NULLS FIRST -LIMIT @__p_0 +LIMIT @p """); } @@ -919,7 +919,7 @@ public override async Task Union_of_same_entity_with_nested_complex_type_project AssertSql( """ -@__p_0='50' +@p='50' SELECT u1."Id", u1."Name", u1."BillingAddress_AddressLine1", u1."BillingAddress_AddressLine2", u1."BillingAddress_Tags", u1."BillingAddress_ZipCode", u1."BillingAddress_Country_Code", u1."BillingAddress_Country_FullName", u1."ShippingAddress_AddressLine1", u1."ShippingAddress_AddressLine2", u1."ShippingAddress_Tags", u1."ShippingAddress_ZipCode", u1."ShippingAddress_Country_Code", u1."ShippingAddress_Country_FullName", u1."Id0", u1."Name0", u1."BillingAddress_AddressLine10", u1."BillingAddress_AddressLine20", u1."BillingAddress_Tags0", u1."BillingAddress_ZipCode0", u1."BillingAddress_Country_Code0", u1."BillingAddress_Country_FullName0", u1."ShippingAddress_AddressLine10", u1."ShippingAddress_AddressLine20", u1."ShippingAddress_Tags0", u1."ShippingAddress_ZipCode0", u1."ShippingAddress_Country_Code0", u1."ShippingAddress_Country_FullName0" FROM ( @@ -936,11 +936,11 @@ CROSS JOIN "Customer" AS c0 CROSS JOIN "Customer" AS c2 ) AS u ORDER BY u."Id" NULLS FIRST, u."Id0" NULLS FIRST - LIMIT @__p_0 + LIMIT @p ) AS u0 ) AS u1 ORDER BY u1."Id" NULLS FIRST, u1."Id0" NULLS FIRST -LIMIT @__p_0 +LIMIT @p """); } @@ -950,7 +950,7 @@ public override async Task Union_of_same_nested_complex_type_projected_twice_wit AssertSql( """ -@__p_0='50' +@p='50' SELECT u."BillingAddress_AddressLine1", u."BillingAddress_AddressLine2", u."BillingAddress_Tags", u."BillingAddress_ZipCode", u."BillingAddress_Country_Code", u."BillingAddress_Country_FullName", u."BillingAddress_AddressLine10", u."BillingAddress_AddressLine20", u."BillingAddress_Tags0", u."BillingAddress_ZipCode0", u."BillingAddress_Country_Code0", u."BillingAddress_Country_FullName0" FROM ( @@ -963,7 +963,7 @@ CROSS JOIN "Customer" AS c0 CROSS JOIN "Customer" AS c2 ) AS u ORDER BY u."BillingAddress_ZipCode" NULLS FIRST, u."BillingAddress_ZipCode0" NULLS FIRST -LIMIT @__p_0 +LIMIT @p """); } @@ -973,7 +973,7 @@ public override async Task Union_of_same_nested_complex_type_projected_twice_wit AssertSql( """ -@__p_0='50' +@p='50' SELECT u1."BillingAddress_AddressLine1", u1."BillingAddress_AddressLine2", u1."BillingAddress_Tags", u1."BillingAddress_ZipCode", u1."BillingAddress_Country_Code", u1."BillingAddress_Country_FullName", u1."BillingAddress_AddressLine10", u1."BillingAddress_AddressLine20", u1."BillingAddress_Tags0", u1."BillingAddress_ZipCode0", u1."BillingAddress_Country_Code0", u1."BillingAddress_Country_FullName0" FROM ( @@ -990,11 +990,11 @@ CROSS JOIN "Customer" AS c0 CROSS JOIN "Customer" AS c2 ) AS u ORDER BY u."BillingAddress_ZipCode" NULLS FIRST, u."BillingAddress_ZipCode0" NULLS FIRST - LIMIT @__p_0 + LIMIT @p ) AS u0 ) AS u1 ORDER BY u1."BillingAddress_ZipCode" NULLS FIRST, u1."BillingAddress_ZipCode0" NULLS FIRST -LIMIT @__p_0 +LIMIT @p """); } @@ -1108,7 +1108,7 @@ public override async Task Projecting_complex_from_optional_navigation_using_con AssertSql( """ -@__p_0='20' +@p='20' SELECT s0."ShippingAddress_ZipCode" FROM ( @@ -1118,7 +1118,7 @@ SELECT s0."ShippingAddress_ZipCode" FROM "CustomerGroup" AS c LEFT JOIN "Customer" AS c0 ON c."OptionalCustomerId" = c0."Id" ORDER BY c0."ShippingAddress_ZipCode" NULLS FIRST - LIMIT @__p_0 + LIMIT @p ) AS s ) AS s0 """); } @@ -1128,9 +1128,9 @@ public override async Task Project_entity_with_complex_type_pushdown_and_then_le await base.Project_entity_with_complex_type_pushdown_and_then_left_join(async); AssertSql( -""" -@__p_0='20' -@__p_1='30' + """ +@p='20' +@p0='30' SELECT c3."BillingAddress_ZipCode" AS "Zip1", c4."ShippingAddress_ZipCode" AS "Zip2" FROM ( @@ -1139,7 +1139,7 @@ public override async Task Project_entity_with_complex_type_pushdown_and_then_le SELECT c."Id", c."Name", c."BillingAddress_AddressLine1", c."BillingAddress_AddressLine2", c."BillingAddress_Tags", c."BillingAddress_ZipCode", c."BillingAddress_Country_Code", c."BillingAddress_Country_FullName", c."ShippingAddress_AddressLine1", c."ShippingAddress_AddressLine2", c."ShippingAddress_Tags", c."ShippingAddress_ZipCode", c."ShippingAddress_Country_Code", c."ShippingAddress_Country_FullName" FROM "Customer" AS c ORDER BY c."Id" NULLS FIRST - LIMIT @__p_0 + LIMIT @p ) AS c0 ) AS c3 LEFT JOIN ( @@ -1148,7 +1148,7 @@ LEFT JOIN ( SELECT c1."Id", c1."Name", c1."BillingAddress_AddressLine1", c1."BillingAddress_AddressLine2", c1."BillingAddress_Tags", c1."BillingAddress_ZipCode", c1."BillingAddress_Country_Code", c1."BillingAddress_Country_FullName", c1."ShippingAddress_AddressLine1", c1."ShippingAddress_AddressLine2", c1."ShippingAddress_Tags", c1."ShippingAddress_ZipCode", c1."ShippingAddress_Country_Code", c1."ShippingAddress_Country_FullName" FROM "Customer" AS c1 ORDER BY c1."Id" DESC NULLS LAST - LIMIT @__p_1 + LIMIT @p0 ) AS c2 ) AS c4 ON c3."Id" = c4."Id" """); diff --git a/test/EFCore.PG.FunctionalTests/Query/EnumQueryTest.cs b/test/EFCore.PG.FunctionalTests/Query/EnumQueryTest.cs index a3b899507..d65e0487f 100644 --- a/test/EFCore.PG.FunctionalTests/Query/EnumQueryTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/EnumQueryTest.cs @@ -76,11 +76,11 @@ await AssertQuery( AssertSql( """ -@__sad_0='Sad' (DbType = Object) +@sad='Sad' (DbType = Object) SELECT s."Id", s."ByteEnum", s."EnumValue", s."InferredEnum", s."MappedEnum", s."SchemaQualifiedEnum", s."UnmappedByteEnum", s."UnmappedEnum" FROM test."SomeEntities" AS s -WHERE s."MappedEnum" = @__sad_0 +WHERE s."MappedEnum" = @sad """); } @@ -97,11 +97,11 @@ await AssertQuery( AssertSql( """ -@__sad_0='1' +@sad='1' SELECT s."Id", s."ByteEnum", s."EnumValue", s."InferredEnum", s."MappedEnum", s."SchemaQualifiedEnum", s."UnmappedByteEnum", s."UnmappedEnum" FROM test."SomeEntities" AS s -WHERE s."UnmappedEnum" = @__sad_0 +WHERE s."UnmappedEnum" = @sad """); } @@ -118,11 +118,11 @@ await AssertQuery( AssertSql( """ -@__sad_0='1' +@sad='1' SELECT s."Id", s."ByteEnum", s."EnumValue", s."InferredEnum", s."MappedEnum", s."SchemaQualifiedEnum", s."UnmappedByteEnum", s."UnmappedEnum" FROM test."SomeEntities" AS s -WHERE s."UnmappedEnum" = @__sad_0 +WHERE s."UnmappedEnum" = @sad """); } @@ -139,11 +139,11 @@ await AssertQuery( AssertSql( """ -@__sad_0='Sad' (DbType = Object) +@sad='Sad' (DbType = Object) SELECT s."Id", s."ByteEnum", s."EnumValue", s."InferredEnum", s."MappedEnum", s."SchemaQualifiedEnum", s."UnmappedByteEnum", s."UnmappedEnum" FROM test."SomeEntities" AS s -WHERE s."MappedEnum" = @__sad_0 +WHERE s."MappedEnum" = @sad """); } @@ -179,11 +179,11 @@ await AssertQuery( AssertSql( """ -@__values_0='0x01' (DbType = Object) +@values='0x01' (DbType = Object) SELECT s."Id", s."ByteEnum", s."EnumValue", s."InferredEnum", s."MappedEnum", s."SchemaQualifiedEnum", s."UnmappedByteEnum", s."UnmappedEnum" FROM test."SomeEntities" AS s -WHERE s."ByteEnum" = ANY (@__values_0) +WHERE s."ByteEnum" = ANY (@values) """); } @@ -200,11 +200,11 @@ await AssertQuery( AssertSql( """ -@__values_0='0x01' (DbType = Object) +@values='0x01' (DbType = Object) SELECT s."Id", s."ByteEnum", s."EnumValue", s."InferredEnum", s."MappedEnum", s."SchemaQualifiedEnum", s."UnmappedByteEnum", s."UnmappedEnum" FROM test."SomeEntities" AS s -WHERE s."UnmappedByteEnum" = ANY (@__values_0) +WHERE s."UnmappedByteEnum" = ANY (@values) """); } diff --git a/test/EFCore.PG.FunctionalTests/Query/FullTextSearchDbFunctionsNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/FullTextSearchDbFunctionsNpgsqlTest.cs index 1f2b57779..c0a368cd2 100644 --- a/test/EFCore.PG.FunctionalTests/Query/FullTextSearchDbFunctionsNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/FullTextSearchDbFunctionsNpgsqlTest.cs @@ -505,9 +505,9 @@ public void GetResultHeadline_with_parameter_config_and_options() Assert.NotEmpty(headline); AssertSql( """ -@__config_1='english' +@config='english' -SELECT ts_headline(@__config_1::regconfig, 'a b c', to_tsquery('b'), 'MinWords=1, MaxWords=2') +SELECT ts_headline(@config::regconfig, 'a b c', to_tsquery('b'), 'MinWords=1, MaxWords=2') FROM "Customers" AS c LIMIT 1 """); @@ -598,9 +598,9 @@ public void Matches_with_string() Assert.False(result); AssertSql( """ -@__query_1='b' +@query='b' -SELECT to_tsvector('a') @@ plainto_tsquery(@__query_1) +SELECT to_tsvector('a') @@ plainto_tsquery(@query) FROM "Customers" AS c LIMIT 1 """); @@ -1019,9 +1019,9 @@ public void Unaccent_with_parameter_regdictionary() AssertSql( """ -@__regDictionary_1='unaccent' +@regDictionary='unaccent' -SELECT unaccent(@__regDictionary_1::regdictionary, c."ContactName") +SELECT unaccent(@regDictionary::regdictionary, c."ContactName") FROM "Customers" AS c LIMIT 1 """); diff --git a/test/EFCore.PG.FunctionalTests/Query/GearsOfWarQueryNpgsqlFixture.cs b/test/EFCore.PG.FunctionalTests/Query/GearsOfWarQueryNpgsqlFixture.cs index e2c0054d5..19f6da3ea 100644 --- a/test/EFCore.PG.FunctionalTests/Query/GearsOfWarQueryNpgsqlFixture.cs +++ b/test/EFCore.PG.FunctionalTests/Query/GearsOfWarQueryNpgsqlFixture.cs @@ -43,6 +43,8 @@ public override ISetSource GetExpectedData() { mission.Timeline = new DateTimeOffset( mission.Timeline.Ticks - (mission.Timeline.Ticks % (TimeSpan.TicksPerMillisecond / 1000)), TimeSpan.Zero); + mission.Duration = new TimeSpan( + mission.Duration.Ticks - (mission.Duration.Ticks % (TimeSpan.TicksPerMillisecond / 1000))); } } @@ -70,6 +72,8 @@ protected override async Task SeedAsync(GearsOfWarContext context) { mission.Timeline = new DateTimeOffset( mission.Timeline.Ticks - (mission.Timeline.Ticks % (TimeSpan.TicksPerMillisecond / 1000)), TimeSpan.Zero); + mission.Duration = new TimeSpan( + mission.Duration.Ticks - (mission.Duration.Ticks % (TimeSpan.TicksPerMillisecond / 1000))); } GearsOfWarData.WireUp( diff --git a/test/EFCore.PG.FunctionalTests/Query/GearsOfWarQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/GearsOfWarQueryNpgsqlTest.cs index 684786a6a..301af4a33 100644 --- a/test/EFCore.PG.FunctionalTests/Query/GearsOfWarQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/GearsOfWarQueryNpgsqlTest.cs @@ -33,11 +33,11 @@ public override async Task Byte_array_contains_parameter(bool async) AssertSql( """ -@__someByte_0='1' (DbType = Int16) +@someByte='1' (DbType = Int16) SELECT s."Id", s."Banner", s."Banner5", s."InternalNumber", s."Name" FROM "Squads" AS s -WHERE position(set_byte(BYTEA E'\\x00', 0, @__someByte_0) IN s."Banner") > 0 +WHERE position(set_byte(BYTEA E'\\x00', 0, @someByte) IN s."Banner") > 0 """); } @@ -71,11 +71,11 @@ public override async Task Byte_array_filter_by_length_parameter(bool async) AssertSql( """ -@__p_0='2' +@p='2' SELECT s."Id", s."Banner", s."Banner5", s."InternalNumber", s."Name" FROM "Squads" AS s -WHERE length(s."Banner") = @__p_0 +WHERE length(s."Banner") = @p """); } @@ -85,11 +85,11 @@ public override void Byte_array_filter_by_length_parameter_compiled() AssertSql( """ -@__byteArrayParam='0x2A80' +@byteArrayParam='0x2A80' SELECT count(*)::int FROM "Squads" AS s -WHERE length(s."Banner") = length(@__byteArrayParam) +WHERE length(s."Banner") = length(@byteArrayParam) """); } @@ -161,11 +161,11 @@ await AssertQuery( AssertSql( """ -@__dateTimeOffset_Date_0='0002-03-01T00:00:00.0000000' +@dateTimeOffset_Date='0002-03-01T00:00:00.0000000' SELECT m."Id", m."CodeName", m."Date", m."Difficulty", m."Duration", m."Rating", m."Time", m."Timeline" FROM "Missions" AS m -WHERE date_trunc('day', m."Timeline" AT TIME ZONE 'UTC')::timestamp >= @__dateTimeOffset_Date_0 +WHERE date_trunc('day', m."Timeline" AT TIME ZONE 'UTC')::timestamp >= @dateTimeOffset_Date """); } @@ -184,13 +184,13 @@ await AssertQuery( AssertSql( """ -@__start_0='1902-01-01T10:00:00.1234567+00:00' (DbType = DateTime) -@__end_1='1902-01-03T10:00:00.1234567+00:00' (DbType = DateTime) -@__dates_2={ '1902-01-02T10:00:00.1234567+00:00' } (DbType = Object) +@start='1902-01-01T10:00:00.1234567+00:00' (DbType = DateTime) +@end='1902-01-03T10:00:00.1234567+00:00' (DbType = DateTime) +@dates={ '1902-01-02T10:00:00.1234567+00:00' } (DbType = Object) SELECT m."Id", m."CodeName", m."Date", m."Difficulty", m."Duration", m."Rating", m."Time", m."Timeline" FROM "Missions" AS m -WHERE @__start_0 <= date_trunc('day', m."Timeline" AT TIME ZONE 'UTC')::timestamptz AND m."Timeline" < @__end_1 AND m."Timeline" = ANY (@__dates_2) +WHERE @start <= date_trunc('day', m."Timeline" AT TIME ZONE 'UTC')::timestamptz AND m."Timeline" < @end AND m."Timeline" = ANY (@dates) """); } @@ -582,11 +582,11 @@ await AssertQuery( AssertSql( """ -@__MinValue_0='01/01/0001' (DbType = Date) +@MinValue='01/01/0001' (DbType = Date) SELECT m."Date" + 3 FROM "Missions" AS m -WHERE m."Date" <> @__MinValue_0 +WHERE m."Date" <> @MinValue """); } @@ -603,11 +603,11 @@ await AssertQuery( AssertSql( """ -@__MinValue_0='01/01/0001' (DbType = Date) +@MinValue='01/01/0001' (DbType = Date) SELECT CAST(m."Date" + INTERVAL '3 months' AS date) FROM "Missions" AS m -WHERE m."Date" <> @__MinValue_0 +WHERE m."Date" <> @MinValue """); } @@ -624,11 +624,11 @@ await AssertQuery( AssertSql( """ -@__MinValue_0='01/01/0001' (DbType = Date) +@MinValue='01/01/0001' (DbType = Date) SELECT CAST(m."Date" + INTERVAL '3 years' AS date) FROM "Missions" AS m -WHERE m."Date" <> @__MinValue_0 +WHERE m."Date" <> @MinValue """); } @@ -787,6 +787,25 @@ await AssertQuery( #endregion TimeOnly + // TODO: #3406 + public override Task Where_datetimeoffset_microsecond_component(bool async) + => AssertTranslationFailed(() => base.Where_datetimeoffset_microsecond_component(async)); + + public override Task Where_datetimeoffset_nanosecond_component(bool async) + => AssertTranslationFailed(() => base.Where_datetimeoffset_nanosecond_component(async)); + + public override Task Where_timespan_microsecond_component(bool async) + => AssertTranslationFailed(() => base.Where_timespan_microsecond_component(async)); + + public override Task Where_timespan_nanosecond_component(bool async) + => AssertTranslationFailed(() => base.Where_timespan_nanosecond_component(async)); + + public override Task Where_timeonly_microsecond_component(bool async) + => AssertTranslationFailed(() => base.Where_timeonly_microsecond_component(async)); + + public override Task Where_timeonly_nanosecond_component(bool async) + => AssertTranslationFailed(() => base.Where_timeonly_nanosecond_component(async)); + private void AssertSql(params string[] expected) => Fixture.TestSqlLoggerFactory.AssertBaseline(expected); } diff --git a/test/EFCore.PG.FunctionalTests/Query/JsonDomQueryTest.cs b/test/EFCore.PG.FunctionalTests/Query/JsonDomQueryTest.cs index a46fd3c96..00132db3a 100644 --- a/test/EFCore.PG.FunctionalTests/Query/JsonDomQueryTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/JsonDomQueryTest.cs @@ -80,20 +80,20 @@ public void Parameter_document() AssertSql( """ -@__p_0='1' +@p='1' SELECT j."Id", j."CustomerDocument", j."CustomerElement" FROM "JsonbEntities" AS j -WHERE j."Id" = @__p_0 +WHERE j."Id" = @p LIMIT 1 """, // """ -@__expected_0='System.Text.Json.JsonDocument' (DbType = Object) +@expected='System.Text.Json.JsonDocument' (DbType = Object) SELECT j."Id", j."CustomerDocument", j."CustomerElement" FROM "JsonbEntities" AS j -WHERE j."CustomerDocument" = @__expected_0 +WHERE j."CustomerDocument" = @expected LIMIT 2 """); } @@ -110,20 +110,20 @@ public void Parameter_element() AssertSql( """ -@__p_0='1' +@p='1' SELECT j."Id", j."CustomerDocument", j."CustomerElement" FROM "JsonbEntities" AS j -WHERE j."Id" = @__p_0 +WHERE j."Id" = @p LIMIT 1 """, // """ -@__expected_0='{"ID": "00000000-0000-0000-0000-000000000000", "Age": 25, "Name": "Joe", "IsVip": false, "Orders": [{"Price": 99.5, "ShippingAddress": "Some address 1"}, {"Price": 23, "ShippingAddress": "Some address 2"}], "Statistics": {"Nested": {"IntList": [3, 4], "IntArray": [3, 4], "SomeProperty": 10, "SomeNullableInt": 20, "SomeNullableGuid": "d5f2685d-e5c4-47e5-97aa-d0266154eb2d"}, "Visits": 4, "Purchases": 3}, "VariousTypes": {"Bool": "false", "Int16": 8, "Int32": 8, "Int64": 8, "String": "foo", "Decimal": 10, "DateTime": "2020-01-01T10:30:45", "DateTimeOffset": "2020-01-01T10:30:45+02:00"}}' (DbType = Object) +@expected='{"ID": "00000000-0000-0000-0000-000000000000", "Age": 25, "Name": "Joe", "IsVip": false, "Orders": [{"Price": 99.5, "ShippingAddress": "Some address 1"}, {"Price": 23, "ShippingAddress": "Some address 2"}], "Statistics": {"Nested": {"IntList": [3, 4], "IntArray": [3, 4], "SomeProperty": 10, "SomeNullableInt": 20, "SomeNullableGuid": "d5f2685d-e5c4-47e5-97aa-d0266154eb2d"}, "Visits": 4, "Purchases": 3}, "VariousTypes": {"Bool": "false", "Int16": 8, "Int32": 8, "Int64": 8, "String": "foo", "Decimal": 10, "DateTime": "2020-01-01T10:30:45", "DateTimeOffset": "2020-01-01T10:30:45+02:00"}}' (DbType = Object) SELECT j."Id", j."CustomerDocument", j."CustomerElement" FROM "JsonbEntities" AS j -WHERE j."CustomerElement" = @__expected_0 +WHERE j."CustomerElement" = @expected LIMIT 2 """); } @@ -324,11 +324,11 @@ public void Array_parameter_index() AssertSql( """ -@__i_0='1' +@i='1' SELECT j."Id", j."CustomerDocument", j."CustomerElement" FROM "JsonbEntities" AS j -WHERE CAST(j."CustomerElement" #>> ARRAY['Statistics','Nested','IntArray',@__i_0]::text[] AS integer) = 4 +WHERE CAST(j."CustomerElement" #>> ARRAY['Statistics','Nested','IntArray',@i]::text[] AS integer) = 4 LIMIT 2 """); } @@ -438,11 +438,11 @@ public void JsonContains_with_json_element() Assert.Equal(1, count); AssertSql( """ -@__element_1='{"Name": "Joe", "Age": 25}' (DbType = Object) +@element='{"Name": "Joe", "Age": 25}' (DbType = Object) SELECT count(*)::int FROM "JsonbEntities" AS j -WHERE j."CustomerElement" @> @__element_1 +WHERE j."CustomerElement" @> @element """); } @@ -475,11 +475,11 @@ public void JsonContained_with_json_element() Assert.Equal(1, count); AssertSql( """ -@__element_1='{"Name": "Joe", "Age": 25}' (DbType = Object) +@element='{"Name": "Joe", "Age": 25}' (DbType = Object) SELECT count(*)::int FROM "JsonbEntities" AS j -WHERE @__element_1 <@ j."CustomerElement" +WHERE @element <@ j."CustomerElement" """); } diff --git a/test/EFCore.PG.FunctionalTests/Query/JsonPocoQueryTest.cs b/test/EFCore.PG.FunctionalTests/Query/JsonPocoQueryTest.cs index bb108fc6e..5011584ed 100644 --- a/test/EFCore.PG.FunctionalTests/Query/JsonPocoQueryTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/JsonPocoQueryTest.cs @@ -64,20 +64,20 @@ public void Parameter() AssertSql( """ -@__p_0='1' +@p='1' SELECT j."Id", j."Customer", j."ToplevelArray" FROM "JsonbEntities" AS j -WHERE j."Id" = @__p_0 +WHERE j."Id" = @p LIMIT 1 """, // """ -@__expected_0='Npgsql.EntityFrameworkCore.PostgreSQL.Query.JsonPocoQueryTest+Customer' (DbType = Object) +@expected='Npgsql.EntityFrameworkCore.PostgreSQL.Query.JsonPocoQueryTest+Customer' (DbType = Object) SELECT j."Id", j."Customer", j."ToplevelArray" FROM "JsonbEntities" AS j -WHERE j."Customer" = @__expected_0 +WHERE j."Customer" = @expected LIMIT 2 """); } @@ -186,11 +186,11 @@ public void Output_DateTime() AssertSql( """ -@__p_0='1990-03-03T17:10:15.0000000Z' (DbType = DateTime) +@p='1990-03-03T17:10:15.0000000Z' (DbType = DateTime) SELECT j."Id", j."Customer", j."ToplevelArray" FROM "JsonbEntities" AS j -WHERE CAST(j."Customer" #>> '{VariousTypes,DateTime}' AS timestamp with time zone) = @__p_0 +WHERE CAST(j."Customer" #>> '{VariousTypes,DateTime}' AS timestamp with time zone) = @p LIMIT 2 """); } @@ -207,11 +207,11 @@ public void Output_DateTimeOffset() AssertSql( """ -@__p_0='1990-03-03T17:10:15.0000000+00:00' (DbType = DateTime) +@p='1990-03-03T17:10:15.0000000+00:00' (DbType = DateTime) SELECT j."Id", j."Customer", j."ToplevelArray" FROM "JsonbEntities" AS j -WHERE CAST(j."Customer" #>> '{VariousTypes,DateTimeOffset}' AS timestamp with time zone) = @__p_0 +WHERE CAST(j."Customer" #>> '{VariousTypes,DateTimeOffset}' AS timestamp with time zone) = @p LIMIT 2 """); } @@ -356,11 +356,11 @@ public void Array_parameter_index() AssertSql( """ -@__i_0='1' +@i='1' SELECT j."Id", j."Customer", j."ToplevelArray" FROM "JsonbEntities" AS j -WHERE CAST(j."Customer" #>> ARRAY['Statistics','Nested','IntArray',@__i_0]::text[] AS integer) = 4 +WHERE CAST(j."Customer" #>> ARRAY['Statistics','Nested','IntArray',@i]::text[] AS integer) = 4 LIMIT 2 """); } @@ -507,11 +507,11 @@ public void JsonContains_with_json_element() Assert.Equal(1, count); AssertSql( """ -@__element_1='{"Name": "Joe", "Age": 25}' (DbType = Object) +@element='{"Name": "Joe", "Age": 25}' (DbType = Object) SELECT count(*)::int FROM "JsonbEntities" AS j -WHERE j."Customer" @> @__element_1 +WHERE j."Customer" @> @element """); } @@ -544,11 +544,11 @@ public void JsonContains_with_string_parameter() Assert.Equal(1, count); AssertSql( """ -@__someJson_1='{"Name": "Joe", "Age": 25}' (DbType = Object) +@someJson='{"Name": "Joe", "Age": 25}' (DbType = Object) SELECT count(*)::int FROM "JsonbEntities" AS j -WHERE j."Customer" @> @__someJson_1 +WHERE j."Customer" @> @someJson """); } @@ -564,11 +564,11 @@ public void JsonContained_with_json_element() Assert.Equal(1, count); AssertSql( """ -@__element_1='{"Name": "Joe", "Age": 25}' (DbType = Object) +@element='{"Name": "Joe", "Age": 25}' (DbType = Object) SELECT count(*)::int FROM "JsonbEntities" AS j -WHERE @__element_1 <@ j."Customer" +WHERE @element <@ j."Customer" """); } @@ -601,11 +601,11 @@ public void JsonContained_with_string_parameter() Assert.Equal(1, count); AssertSql( """ -@__someJson_1='{"Name": "Joe", "Age": 25}' (DbType = Object) +@someJson='{"Name": "Joe", "Age": 25}' (DbType = Object) SELECT count(*)::int FROM "JsonbEntities" AS j -WHERE @__someJson_1 <@ j."Customer" +WHERE @someJson <@ j."Customer" """); } diff --git a/test/EFCore.PG.FunctionalTests/Query/JsonQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/JsonQueryNpgsqlTest.cs index d1e3305b6..1f7d6cdb1 100644 --- a/test/EFCore.PG.FunctionalTests/Query/JsonQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/JsonQueryNpgsqlTest.cs @@ -378,7 +378,7 @@ public override async Task Json_subquery_property_pushdown_length(bool async) AssertSql( """ -@__p_0='3' +@p='3' SELECT length(j1.c)::int FROM ( @@ -387,7 +387,7 @@ SELECT DISTINCT j0.c SELECT j."OwnedReferenceRoot" #>> '{OwnedReferenceBranch,OwnedReferenceLeaf,SomethingSomething}' AS c FROM "JsonEntitiesBasic" AS j ORDER BY j."Id" NULLS FIRST - LIMIT @__p_0 + LIMIT @p ) AS j0 ) AS j1 """); @@ -399,7 +399,7 @@ public override async Task Json_subquery_reference_pushdown_reference(bool async AssertSql( """ -@__p_0='10' +@p='10' SELECT j1.c -> 'OwnedReferenceBranch', j1."Id" FROM ( @@ -408,7 +408,7 @@ public override async Task Json_subquery_reference_pushdown_reference(bool async SELECT j."OwnedReferenceRoot" AS c, j."Id" FROM "JsonEntitiesBasic" AS j ORDER BY j."Id" NULLS FIRST - LIMIT @__p_0 + LIMIT @p ) AS j0 ) AS j1 """); @@ -467,7 +467,7 @@ public override async Task Json_subquery_reference_pushdown_reference_pushdown_r AssertSql( """ -@__p_0='10' +@p='10' SELECT j3.c -> 'OwnedReferenceLeaf', j3."Id" FROM ( @@ -480,11 +480,11 @@ public override async Task Json_subquery_reference_pushdown_reference_pushdown_r SELECT j."OwnedReferenceRoot" AS c, j."Id" FROM "JsonEntitiesBasic" AS j ORDER BY j."Id" NULLS FIRST - LIMIT @__p_0 + LIMIT @p ) AS j0 ) AS j1 ORDER BY j1.c0 ->> 'Name' NULLS FIRST - LIMIT @__p_0 + LIMIT @p ) AS j2 ) AS j3 """); @@ -496,7 +496,7 @@ public override async Task Json_subquery_reference_pushdown_reference_pushdown_c AssertSql( """ -@__p_0='10' +@p='10' SELECT j3.c -> 'OwnedCollectionLeaf', j3."Id" FROM ( @@ -509,11 +509,11 @@ public override async Task Json_subquery_reference_pushdown_reference_pushdown_c SELECT j."OwnedReferenceRoot" AS c, j."Id" FROM "JsonEntitiesBasic" AS j ORDER BY j."Id" NULLS FIRST - LIMIT @__p_0 + LIMIT @p ) AS j0 ) AS j1 ORDER BY j1.c0 ->> 'Name' NULLS FIRST - LIMIT @__p_0 + LIMIT @p ) AS j2 ) AS j3 """); @@ -525,7 +525,7 @@ public override async Task Json_subquery_reference_pushdown_property(bool async) AssertSql( """ -@__p_0='10' +@p='10' SELECT j1.c ->> 'SomethingSomething' FROM ( @@ -534,7 +534,7 @@ SELECT j1.c ->> 'SomethingSomething' SELECT j."OwnedReferenceRoot" #> '{OwnedReferenceBranch,OwnedReferenceLeaf}' AS c, j."Id" FROM "JsonEntitiesBasic" AS j ORDER BY j."Id" NULLS FIRST - LIMIT @__p_0 + LIMIT @p ) AS j0 ) AS j1 """); @@ -877,9 +877,9 @@ public override async Task Json_collection_index_in_projection_using_parameter(b AssertSql( """ -@__prm_0='0' +@prm='0' -SELECT j."OwnedCollectionRoot" -> @__prm_0, j."Id", @__prm_0 +SELECT j."OwnedCollectionRoot" -> @prm, j."Id", @prm FROM "JsonEntitiesBasic" AS j """); } @@ -959,9 +959,9 @@ public override async Task Json_collection_index_in_projection_nested(bool async AssertSql( """ -@__prm_0='1' +@prm='1' -SELECT j."OwnedCollectionRoot" #> ARRAY[0,'OwnedCollectionBranch',@__prm_0]::text[], j."Id", @__prm_0 +SELECT j."OwnedCollectionRoot" #> ARRAY[0,'OwnedCollectionBranch',@prm]::text[], j."Id", @prm FROM "JsonEntitiesBasic" AS j """); } @@ -972,9 +972,9 @@ public override async Task Json_collection_index_in_projection_nested_project_sc AssertSql( """ -@__prm_0='1' +@prm='1' -SELECT CAST(j."OwnedCollectionRoot" #>> ARRAY[0,'OwnedCollectionBranch',@__prm_0,'Date']::text[] AS timestamp without time zone) +SELECT CAST(j."OwnedCollectionRoot" #>> ARRAY[0,'OwnedCollectionBranch',@prm,'Date']::text[] AS timestamp without time zone) FROM "JsonEntitiesBasic" AS j """); } @@ -985,9 +985,9 @@ public override async Task Json_collection_index_in_projection_nested_project_re AssertSql( """ -@__prm_0='1' +@prm='1' -SELECT j."OwnedCollectionRoot" #> ARRAY[0,'OwnedCollectionBranch',@__prm_0,'OwnedReferenceLeaf']::text[], j."Id", @__prm_0 +SELECT j."OwnedCollectionRoot" #> ARRAY[0,'OwnedCollectionBranch',@prm,'OwnedReferenceLeaf']::text[], j."Id", @prm FROM "JsonEntitiesBasic" AS j """); } @@ -998,9 +998,9 @@ public override async Task Json_collection_index_in_projection_nested_project_co AssertSql( """ -@__prm_0='1' +@prm='1' -SELECT j."OwnedCollectionRoot" #> ARRAY[0,'OwnedCollectionBranch',@__prm_0,'OwnedCollectionLeaf']::text[], j."Id", @__prm_0 +SELECT j."OwnedCollectionRoot" #> ARRAY[0,'OwnedCollectionBranch',@prm,'OwnedCollectionLeaf']::text[], j."Id", @prm FROM "JsonEntitiesBasic" AS j ORDER BY j."Id" NULLS FIRST """); @@ -1012,9 +1012,9 @@ public override async Task Json_collection_index_in_projection_nested_project_co AssertSql( """ -@__prm_0='1' +@prm='1' -SELECT j."Id", j."OwnedCollectionRoot" #> ARRAY[0,'OwnedCollectionBranch',@__prm_0,'OwnedCollectionLeaf']::text[], @__prm_0 +SELECT j."Id", j."OwnedCollectionRoot" #> ARRAY[0,'OwnedCollectionBranch',@prm,'OwnedCollectionLeaf']::text[], @prm FROM "JsonEntitiesBasic" AS j """); } @@ -1037,11 +1037,11 @@ public override async Task Json_collection_index_in_predicate_using_variable(boo AssertSql( """ -@__prm_0='1' +@prm='1' SELECT j."Id" FROM "JsonEntitiesBasic" AS j -WHERE (j."OwnedCollectionRoot" #>> ARRAY[@__prm_0,'Name']::text[]) <> 'Foo' OR (j."OwnedCollectionRoot" #>> ARRAY[@__prm_0,'Name']::text[]) IS NULL +WHERE (j."OwnedCollectionRoot" #>> ARRAY[@prm,'Name']::text[]) <> 'Foo' OR (j."OwnedCollectionRoot" #>> ARRAY[@prm,'Name']::text[]) IS NULL """); } @@ -1104,11 +1104,11 @@ public override async Task Json_collection_index_in_predicate_nested_mix(bool as AssertSql( """ -@__prm_0='0' +@prm='0' SELECT j."Id", j."EntityBasicId", j."Name", j."OwnedCollectionRoot", j."OwnedReferenceRoot" FROM "JsonEntitiesBasic" AS j -WHERE (j."OwnedCollectionRoot" #>> ARRAY[1,'OwnedCollectionBranch',@__prm_0,'OwnedCollectionLeaf',j."Id" - 1,'SomethingSomething']::text[]) = 'e1_c2_c1_c1' +WHERE (j."OwnedCollectionRoot" #>> ARRAY[1,'OwnedCollectionBranch',@prm,'OwnedCollectionLeaf',j."Id" - 1,'SomethingSomething']::text[]) = 'e1_c2_c1_c1' """); } @@ -1749,11 +1749,11 @@ public override async Task Json_collection_index_with_parameter_Select_ElementAt AssertSql( """ -@__prm_0='0' +@prm='0' SELECT j."Id", ( SELECT 'Foo' - FROM ROWS FROM (jsonb_to_recordset(j."OwnedCollectionRoot" #> ARRAY[@__prm_0,'OwnedCollectionBranch']::text[]) AS ( + FROM ROWS FROM (jsonb_to_recordset(j."OwnedCollectionRoot" #> ARRAY[@prm,'OwnedCollectionBranch']::text[]) AS ( "Date" timestamp without time zone, "Enum" integer, "Enums" integer[], @@ -1775,9 +1775,9 @@ public override async Task Json_collection_index_with_expression_Select_ElementA AssertSql( """ -@__prm_0='0' +@prm='0' -SELECT j."OwnedCollectionRoot" #>> ARRAY[@__prm_0 + j."Id",'OwnedCollectionBranch',0,'OwnedReferenceLeaf','SomethingSomething']::text[] +SELECT j."OwnedCollectionRoot" #>> ARRAY[@prm + j."Id",'OwnedCollectionBranch',0,'OwnedReferenceLeaf','SomethingSomething']::text[] FROM "JsonEntitiesBasic" AS j """); } @@ -1862,9 +1862,9 @@ public override async Task Json_projection_deduplication_with_collection_indexer AssertSql( """ -@__prm_0='1' +@prm='1' -SELECT j."Id", j."OwnedReferenceRoot" #> '{OwnedCollectionBranch,1}', j."OwnedReferenceRoot", j."OwnedReferenceRoot" #> ARRAY['OwnedReferenceBranch','OwnedCollectionLeaf',@__prm_0]::text[], @__prm_0 +SELECT j."Id", j."OwnedReferenceRoot" #> '{OwnedCollectionBranch,1}', j."OwnedReferenceRoot", j."OwnedReferenceRoot" #> ARRAY['OwnedReferenceBranch','OwnedCollectionLeaf',@prm]::text[], @prm FROM "JsonEntitiesBasic" AS j """); } @@ -1875,9 +1875,9 @@ public override async Task Json_projection_deduplication_with_collection_in_orig AssertSql( """ -@__prm_0='1' +@prm='1' -SELECT j."OwnedReferenceRoot" #> ARRAY['OwnedCollectionBranch',0,'OwnedCollectionLeaf',@__prm_0]::text[], j."Id", @__prm_0, j."OwnedReferenceRoot" #> ARRAY['OwnedCollectionBranch',@__prm_0]::text[], j."OwnedReferenceRoot" -> 'OwnedCollectionBranch', j."OwnedReferenceRoot" #> '{OwnedCollectionBranch,0}' +SELECT j."OwnedReferenceRoot" #> ARRAY['OwnedCollectionBranch',0,'OwnedCollectionLeaf',@prm]::text[], j."Id", @prm, j."OwnedReferenceRoot" #> ARRAY['OwnedCollectionBranch',@prm]::text[], j."OwnedReferenceRoot" -> 'OwnedCollectionBranch', j."OwnedReferenceRoot" #> '{OwnedCollectionBranch,0}' FROM "JsonEntitiesBasic" AS j """); } @@ -1910,9 +1910,9 @@ public override async Task Json_collection_index_in_projection_using_parameter_w AssertSql( """ -@__prm_0='1' +@prm='1' -SELECT j."Id", j."EntityBasicId", j."Name", j."OwnedCollectionRoot", j."OwnedReferenceRoot", j."OwnedCollectionRoot" -> @__prm_0, @__prm_0 +SELECT j."Id", j."EntityBasicId", j."Name", j."OwnedCollectionRoot", j."OwnedReferenceRoot", j."OwnedCollectionRoot" -> @prm, @prm FROM "JsonEntitiesBasic" AS j """); } @@ -1923,9 +1923,9 @@ public override async Task Json_collection_index_in_projection_using_parameter_w AssertSql( """ -@__prm_0='1' +@prm='1' -SELECT j."Id", j."OwnedCollectionRoot" -> @__prm_0, @__prm_0 +SELECT j."Id", j."OwnedCollectionRoot" -> @prm, @prm FROM "JsonEntitiesBasic" AS j """); } @@ -1958,9 +1958,9 @@ public override async Task Json_collection_after_collection_index_in_projection_ AssertSql( """ -@__prm_0='1' +@prm='1' -SELECT j."Id", j."EntityBasicId", j."Name", j."OwnedCollectionRoot", j."OwnedReferenceRoot", j."OwnedCollectionRoot" #> ARRAY[@__prm_0,'OwnedCollectionBranch']::text[], @__prm_0 +SELECT j."Id", j."EntityBasicId", j."Name", j."OwnedCollectionRoot", j."OwnedReferenceRoot", j."OwnedCollectionRoot" #> ARRAY[@prm,'OwnedCollectionBranch']::text[], @prm FROM "JsonEntitiesBasic" AS j """); } @@ -1971,9 +1971,9 @@ public override async Task Json_collection_after_collection_index_in_projection_ AssertSql( """ -@__prm_0='1' +@prm='1' -SELECT j."Id", j."OwnedCollectionRoot" #> ARRAY[@__prm_0,'OwnedCollectionBranch']::text[], @__prm_0 +SELECT j."Id", j."OwnedCollectionRoot" #> ARRAY[@prm,'OwnedCollectionBranch']::text[], @prm FROM "JsonEntitiesBasic" AS j """); } @@ -1984,9 +1984,9 @@ public override async Task Json_collection_index_in_projection_when_owner_is_pre AssertSql( """ -@__prm_0='1' +@prm='1' -SELECT j."Id", j."EntityBasicId", j."Name", j."OwnedCollectionRoot", j."OwnedReferenceRoot", j."OwnedCollectionRoot" #> ARRAY[1,'OwnedCollectionBranch',@__prm_0]::text[], @__prm_0 +SELECT j."Id", j."EntityBasicId", j."Name", j."OwnedCollectionRoot", j."OwnedReferenceRoot", j."OwnedCollectionRoot" #> ARRAY[1,'OwnedCollectionBranch',@prm]::text[], @prm FROM "JsonEntitiesBasic" AS j """); } @@ -1997,9 +1997,9 @@ public override async Task Json_collection_index_in_projection_when_owner_is_not AssertSql( """ -@__prm_0='1' +@prm='1' -SELECT j."Id", j."OwnedCollectionRoot" #> ARRAY[1,'OwnedCollectionBranch',@__prm_0]::text[], @__prm_0 +SELECT j."Id", j."OwnedCollectionRoot" #> ARRAY[1,'OwnedCollectionBranch',@prm]::text[], @prm FROM "JsonEntitiesBasic" AS j """); } @@ -2032,9 +2032,9 @@ public override async Task Json_collection_index_in_projection_when_owner_is_pre AssertSql( """ -@__prm_0='1' +@prm='1' -SELECT j."Id", j."EntityBasicId", j."Name", j."OwnedCollectionRoot", j."OwnedReferenceRoot", j."OwnedCollectionRoot" #> ARRAY[@__prm_0,'OwnedCollectionBranch',1]::text[], @__prm_0, j."OwnedCollectionRoot" #> '{1,OwnedCollectionBranch,1,OwnedReferenceLeaf}', j."OwnedCollectionRoot" #> '{1,OwnedReferenceBranch}', j."OwnedCollectionRoot" #> ARRAY[@__prm_0,'OwnedReferenceBranch']::text[], j."OwnedCollectionRoot" #> ARRAY[@__prm_0,'OwnedCollectionBranch',j."Id"]::text[], j."OwnedCollectionRoot" #> ARRAY[j."Id",'OwnedCollectionBranch',1,'OwnedReferenceLeaf']::text[], j."OwnedCollectionRoot" #> '{1,OwnedReferenceBranch}', j."OwnedCollectionRoot" #> ARRAY[j."Id",'OwnedReferenceBranch']::text[], j."OwnedCollectionRoot" #> ARRAY[j."Id",'OwnedCollectionBranch',j."Id"]::text[] +SELECT j."Id", j."EntityBasicId", j."Name", j."OwnedCollectionRoot", j."OwnedReferenceRoot", j."OwnedCollectionRoot" #> ARRAY[@prm,'OwnedCollectionBranch',1]::text[], @prm, j."OwnedCollectionRoot" #> '{1,OwnedCollectionBranch,1,OwnedReferenceLeaf}', j."OwnedCollectionRoot" #> '{1,OwnedReferenceBranch}', j."OwnedCollectionRoot" #> ARRAY[@prm,'OwnedReferenceBranch']::text[], j."OwnedCollectionRoot" #> ARRAY[@prm,'OwnedCollectionBranch',j."Id"]::text[], j."OwnedCollectionRoot" #> ARRAY[j."Id",'OwnedCollectionBranch',1,'OwnedReferenceLeaf']::text[], j."OwnedCollectionRoot" #> '{1,OwnedReferenceBranch}', j."OwnedCollectionRoot" #> ARRAY[j."Id",'OwnedReferenceBranch']::text[], j."OwnedCollectionRoot" #> ARRAY[j."Id",'OwnedCollectionBranch',j."Id"]::text[] FROM "JsonEntitiesBasic" AS j """); } @@ -2045,9 +2045,9 @@ public override async Task Json_collection_index_in_projection_when_owner_is_not AssertSql( """ -@__prm_0='1' +@prm='1' -SELECT j."Id", j."OwnedCollectionRoot" #> ARRAY[@__prm_0,'OwnedCollectionBranch',1]::text[], @__prm_0, j."OwnedCollectionRoot" #> '{1,OwnedCollectionBranch,1,OwnedReferenceLeaf}', j."OwnedCollectionRoot" #> '{1,OwnedReferenceBranch}', j."OwnedCollectionRoot" #> ARRAY[@__prm_0,'OwnedReferenceBranch']::text[], j."OwnedCollectionRoot" #> ARRAY[@__prm_0,'OwnedCollectionBranch',j."Id"]::text[], j."OwnedCollectionRoot" #> ARRAY[j."Id",'OwnedCollectionBranch',1,'OwnedReferenceLeaf']::text[], j."OwnedCollectionRoot" #> '{1,OwnedReferenceBranch}', j."OwnedCollectionRoot" #> ARRAY[j."Id",'OwnedReferenceBranch']::text[], j."OwnedCollectionRoot" #> ARRAY[j."Id",'OwnedCollectionBranch',j."Id"]::text[] +SELECT j."Id", j."OwnedCollectionRoot" #> ARRAY[@prm,'OwnedCollectionBranch',1]::text[], @prm, j."OwnedCollectionRoot" #> '{1,OwnedCollectionBranch,1,OwnedReferenceLeaf}', j."OwnedCollectionRoot" #> '{1,OwnedReferenceBranch}', j."OwnedCollectionRoot" #> ARRAY[@prm,'OwnedReferenceBranch']::text[], j."OwnedCollectionRoot" #> ARRAY[@prm,'OwnedCollectionBranch',j."Id"]::text[], j."OwnedCollectionRoot" #> ARRAY[j."Id",'OwnedCollectionBranch',1,'OwnedReferenceLeaf']::text[], j."OwnedCollectionRoot" #> '{1,OwnedReferenceBranch}', j."OwnedCollectionRoot" #> ARRAY[j."Id",'OwnedReferenceBranch']::text[], j."OwnedCollectionRoot" #> ARRAY[j."Id",'OwnedCollectionBranch',j."Id"]::text[] FROM "JsonEntitiesBasic" AS j """); } @@ -3293,9 +3293,9 @@ await base AssertSql( """ -@__prm_0='1' +@prm='1' -SELECT j."Id", j."OwnedReferenceRoot" #> '{OwnedCollectionBranch,0,OwnedCollectionLeaf}', j."OwnedReferenceRoot" #> ARRAY['OwnedCollectionBranch',0,'OwnedCollectionLeaf',@__prm_0]::text[], @__prm_0 +SELECT j."Id", j."OwnedReferenceRoot" #> '{OwnedCollectionBranch,0,OwnedCollectionLeaf}', j."OwnedReferenceRoot" #> ARRAY['OwnedCollectionBranch',0,'OwnedCollectionLeaf',@prm]::text[], @prm FROM "JsonEntitiesBasic" AS j """); } @@ -3321,10 +3321,10 @@ public override async Task Json_projection_only_second_element_through_collectio AssertSql( """ -@__prm1_0='0' -@__prm2_1='1' +@prm1='0' +@prm2='1' -SELECT j."Id", j."OwnedReferenceRoot" #> ARRAY['OwnedCollectionBranch',@__prm1_0,'OwnedCollectionLeaf',@__prm2_1]::text[], @__prm1_0, @__prm2_1 +SELECT j."Id", j."OwnedReferenceRoot" #> ARRAY['OwnedCollectionBranch',@prm1,'OwnedCollectionLeaf',@prm2]::text[], @prm1, @prm2 FROM "JsonEntitiesBasic" AS j """); } @@ -3357,9 +3357,9 @@ public override async Task Json_projection_nested_collection_element_using_param AssertSql( """ -@__prm_0='0' +@prm='0' -SELECT j."Id", j."OwnedReferenceRoot", j."OwnedReferenceRoot" #> ARRAY['OwnedCollectionBranch',@__prm_0,'OwnedCollectionLeaf',1]::text[], @__prm_0 +SELECT j."Id", j."OwnedReferenceRoot", j."OwnedReferenceRoot" #> ARRAY['OwnedCollectionBranch',@prm,'OwnedCollectionLeaf',1]::text[], @prm FROM "JsonEntitiesBasic" AS j """); } diff --git a/test/EFCore.PG.FunctionalTests/Query/JsonStringQueryTest.cs b/test/EFCore.PG.FunctionalTests/Query/JsonStringQueryTest.cs index 3608a7dfd..03be46212 100644 --- a/test/EFCore.PG.FunctionalTests/Query/JsonStringQueryTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/JsonStringQueryTest.cs @@ -74,20 +74,20 @@ public void Parameter() AssertSql( """ -@__p_0='1' +@p='1' SELECT j."Id", j."CustomerJson", j."CustomerJsonb", j."SomeString" FROM "JsonEntities" AS j -WHERE j."Id" = @__p_0 +WHERE j."Id" = @p LIMIT 1 """, // """ -@__expected_0='{"Age": 25, "Name": "Joe", "IsVip": false, "Orders": [{"Price": 99.5, "ShippingDate": "2019-10-01", "ShippingAddress": "Some address 1"}, {"Price": 23, "ShippingDate": "2019-10-10", "ShippingAddress": "Some address 2"}], "Statistics": {"Nested": {"IntArray": [3, 4], "SomeProperty": 10}, "Visits": 4, "Purchases": 3}}' (DbType = Object) +@expected='{"Age": 25, "Name": "Joe", "IsVip": false, "Orders": [{"Price": 99.5, "ShippingDate": "2019-10-01", "ShippingAddress": "Some address 1"}, {"Price": 23, "ShippingDate": "2019-10-10", "ShippingAddress": "Some address 2"}], "Statistics": {"Nested": {"IntArray": [3, 4], "SomeProperty": 10}, "Visits": 4, "Purchases": 3}}' (DbType = Object) SELECT j."Id", j."CustomerJson", j."CustomerJsonb", j."SomeString" FROM "JsonEntities" AS j -WHERE j."CustomerJsonb" = @__expected_0 +WHERE j."CustomerJsonb" = @expected LIMIT 2 """); } @@ -106,11 +106,11 @@ public void JsonContains_with_json_element() AssertSql( """ -@__element_1='{"Name": "Joe", "Age": 25}' (DbType = Object) +@element='{"Name": "Joe", "Age": 25}' (DbType = Object) SELECT count(*)::int FROM "JsonEntities" AS j -WHERE j."CustomerJsonb" @> @__element_1 +WHERE j."CustomerJsonb" @> @element """); } @@ -165,11 +165,11 @@ public void JsonContained_with_json_element() AssertSql( """ -@__element_1='{"Name": "Joe", "Age": 25}' (DbType = Object) +@element='{"Name": "Joe", "Age": 25}' (DbType = Object) SELECT count(*)::int FROM "JsonEntities" AS j -WHERE @__element_1 <@ j."CustomerJsonb" +WHERE @element <@ j."CustomerJsonb" """); } diff --git a/test/EFCore.PG.FunctionalTests/Query/LTreeQueryTest.cs b/test/EFCore.PG.FunctionalTests/Query/LTreeQueryTest.cs index c09820ac1..07a2fa682 100644 --- a/test/EFCore.PG.FunctionalTests/Query/LTreeQueryTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/LTreeQueryTest.cs @@ -51,11 +51,11 @@ public void Compare_to_string_parameter() Assert.Equal(1, count); AssertSql( """ -@__p_0='Top.Science' (Nullable = false) (DbType = Object) +@p='Top.Science' (Nullable = false) (DbType = Object) SELECT count(*)::int FROM "LTreeEntities" AS l -WHERE l."LTree" = @__p_0 +WHERE l."LTree" = @p """); } @@ -177,11 +177,11 @@ public void LTree_matches_any_LQuery() AssertSql( """ -@__lqueries_0={ '*.Astrophysics', '*.Geology' } (DbType = Object) +@lqueries={ '*.Astrophysics', '*.Geology' } (DbType = Object) SELECT l."Id", l."LTree", l."LTreeAsString", l."LTrees", l."SomeString" FROM "LTreeEntities" AS l -WHERE l."LTree" ? @__lqueries_0 +WHERE l."LTree" ? @lqueries LIMIT 2 """); } @@ -227,11 +227,11 @@ public void LTree_contains_any_LTree() Assert.Equal(4, count); AssertSql( """ -@__ltrees_0={ 'Top.Science', 'Top.Art' } (DbType = Object) +@ltrees={ 'Top.Science', 'Top.Art' } (DbType = Object) SELECT count(*)::int FROM "LTreeEntities" AS l -WHERE @__ltrees_0 @> l."LTree" +WHERE @ltrees @> l."LTree" """); } @@ -245,11 +245,11 @@ public void LTree_contained_by_any_LTree() Assert.Equal(3, count); AssertSql( """ -@__ltrees_0={ 'Top.Science.Astronomy', 'Top.Art' } (DbType = Object) +@ltrees={ 'Top.Science.Astronomy', 'Top.Art' } (DbType = Object) SELECT count(*)::int FROM "LTreeEntities" AS l -WHERE @__ltrees_0 <@ l."LTree" +WHERE @ltrees <@ l."LTree" """); } @@ -263,11 +263,11 @@ public void Any_LTree_matches_LQuery() AssertSql( """ -@__ltrees_0={ 'Top.Science.Astronomy.Astrophysics', 'Top.Science.Astronomy.Cosmology' } (DbType = Object) +@ltrees={ 'Top.Science.Astronomy.Astrophysics', 'Top.Science.Astronomy.Cosmology' } (DbType = Object) SELECT count(*)::int FROM "LTreeEntities" AS l -WHERE @__ltrees_0 ~ '*.Astrophysics' +WHERE @ltrees ~ '*.Astrophysics' """); } @@ -282,11 +282,11 @@ public void Any_LTree_matches_any_LQuery() AssertSql( """ -@__lqueries_0={ '*.Astrophysics', '*.Geology' } (DbType = Object) +@lqueries={ '*.Astrophysics', '*.Geology' } (DbType = Object) SELECT count(*)::int FROM "LTreeEntities" AS l -WHERE l."LTrees" ? @__lqueries_0 +WHERE l."LTrees" ? @lqueries """); } @@ -316,11 +316,11 @@ public void First_LTree_ancestor() Assert.Equal(4, count); AssertSql( """ -@__ltrees_0={ 'Top.Science', 'Top.Hobbies' } (DbType = Object) +@ltrees={ 'Top.Science', 'Top.Hobbies' } (DbType = Object) SELECT count(*)::int FROM "LTreeEntities" AS l -WHERE @__ltrees_0 ?@> l."LTree" = 'Top.Science' +WHERE @ltrees ?@> l."LTree" = 'Top.Science' """); } @@ -335,11 +335,11 @@ public void First_LTree_descendant() Assert.Equal(3, count); AssertSql( """ -@__ltrees_0={ 'Top.Science.Astronomy', 'Top.Hobbies.Amateurs_Astronomy' } (DbType = Object) +@ltrees={ 'Top.Science.Astronomy', 'Top.Hobbies.Amateurs_Astronomy' } (DbType = Object) SELECT count(*)::int FROM "LTreeEntities" AS l -WHERE @__ltrees_0 ?<@ l."LTree" = 'Top.Science.Astronomy' +WHERE @ltrees ?<@ l."LTree" = 'Top.Science.Astronomy' """); } @@ -354,11 +354,11 @@ public void First_LTree_matches_LQuery() AssertSql( """ -@__ltrees_0={ 'Top.Science.Astronomy.Astrophysics', 'Top.Science.Astronomy.Cosmology' } (DbType = Object) +@ltrees={ 'Top.Science.Astronomy.Astrophysics', 'Top.Science.Astronomy.Cosmology' } (DbType = Object) SELECT count(*)::int FROM "LTreeEntities" AS l -WHERE @__ltrees_0 ?~ '*.Astrophysics' = 'Top.Science.Astronomy.Astrophysics' +WHERE @ltrees ?~ '*.Astrophysics' = 'Top.Science.Astronomy.Astrophysics' """); } @@ -372,11 +372,11 @@ public void First_LTree_matches_LTxtQuery() AssertSql( """ -@__ltrees_0={ 'Top.Science.Astronomy.Astrophysics', 'Top.Science.Astronomy.Cosmology' } (DbType = Object) +@ltrees={ 'Top.Science.Astronomy.Astrophysics', 'Top.Science.Astronomy.Cosmology' } (DbType = Object) SELECT count(*)::int FROM "LTreeEntities" AS l -WHERE @__ltrees_0 ?@ 'Astro*' = 'Top.Science.Astronomy.Astrophysics' +WHERE @ltrees ?@ 'Astro*' = 'Top.Science.Astronomy.Astrophysics' """); } diff --git a/test/EFCore.PG.FunctionalTests/Query/LegacyTimestampQueryTest.cs b/test/EFCore.PG.FunctionalTests/Query/LegacyTimestampQueryTest.cs index 3e0201d9a..57f97fbb1 100644 --- a/test/EFCore.PG.FunctionalTests/Query/LegacyTimestampQueryTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/LegacyTimestampQueryTest.cs @@ -44,11 +44,11 @@ public virtual async Task Where_datetime_now() AssertSql( """ -@__myDatetime_0='2015-04-10T00:00:00.0000000Z' (DbType = DateTime) +@myDatetime='2015-04-10T00:00:00.0000000Z' (DbType = DateTime) SELECT e."Id", e."TimestampDateTime", e."TimestampDateTimeOffset", e."TimestamptzDateTime" FROM "Entities" AS e -WHERE now() <> @__myDatetime_0 +WHERE now() <> @myDatetime """); } @@ -63,11 +63,11 @@ public virtual async Task Where_datetime_utcnow() AssertSql( """ -@__myDatetime_0='2015-04-10T00:00:00.0000000' +@myDatetime='2015-04-10T00:00:00.0000000' SELECT e."Id", e."TimestampDateTime", e."TimestampDateTimeOffset", e."TimestamptzDateTime" FROM "Entities" AS e -WHERE now() AT TIME ZONE 'UTC' <> @__myDatetime_0 +WHERE now() AT TIME ZONE 'UTC' <> @myDatetime """); } diff --git a/test/EFCore.PG.FunctionalTests/Query/MultirangeQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/MultirangeQueryNpgsqlTest.cs index 5f896f298..4639d26d8 100644 --- a/test/EFCore.PG.FunctionalTests/Query/MultirangeQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/MultirangeQueryNpgsqlTest.cs @@ -31,11 +31,11 @@ public void Contains_value() AssertSql( """ -@__value_0='3' +@value='3' SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t -WHERE t."IntMultirange" @> @__value_0 +WHERE t."IntMultirange" @> @value LIMIT 2 """); } @@ -54,11 +54,11 @@ public void Contains_multirange() AssertSql( """ -@__multirange_0={ '[1,2]' } (DbType = Object) +@multirange={ '[1,2]' } (DbType = Object) SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t -WHERE t."IntMultirange" @> @__multirange_0 +WHERE t."IntMultirange" @> @multirange LIMIT 2 """); } @@ -77,11 +77,11 @@ public void Contains_range() AssertSql( """ -@__range_0='[1,2]' (DbType = Object) +@range='[1,2]' (DbType = Object) SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t -WHERE t."IntMultirange" @> @__range_0 +WHERE t."IntMultirange" @> @range LIMIT 2 """); } @@ -100,11 +100,11 @@ public void ContainedBy_multirange() AssertSql( """ -@__multirange_0={ '[1,2]' } (DbType = Object) +@multirange={ '[1,2]' } (DbType = Object) SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t -WHERE @__multirange_0 <@ t."IntMultirange" +WHERE @multirange <@ t."IntMultirange" LIMIT 2 """); } @@ -123,11 +123,11 @@ public void Equals_operator() AssertSql( """ -@__multirange_0={ '[0,5]', '[7,10]' } (DbType = Object) +@multirange={ '[0,5]', '[7,10]' } (DbType = Object) SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t -WHERE t."IntMultirange" = @__multirange_0 +WHERE t."IntMultirange" = @multirange LIMIT 2 """); } @@ -146,11 +146,11 @@ public void Equals_method() AssertSql( """ -@__multirange_0={ '[0,5]', '[7,10]' } (DbType = Object) +@multirange={ '[0,5]', '[7,10]' } (DbType = Object) SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t -WHERE t."IntMultirange" = @__multirange_0 +WHERE t."IntMultirange" = @multirange LIMIT 2 """); } @@ -169,11 +169,11 @@ public void Overlaps_multirange() AssertSql( """ -@__multirange_0={ '[-3,0]', '[100,101]' } (DbType = Object) +@multirange={ '[-3,0]', '[100,101]' } (DbType = Object) SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t -WHERE t."IntMultirange" && @__multirange_0 +WHERE t."IntMultirange" && @multirange LIMIT 2 """); } @@ -192,11 +192,11 @@ public void Overlaps_range() AssertSql( """ -@__range_0='[-3,0]' (DbType = Object) +@range='[-3,0]' (DbType = Object) SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t -WHERE t."IntMultirange" && @__range_0 +WHERE t."IntMultirange" && @range LIMIT 2 """); } @@ -215,11 +215,11 @@ public void IsStrictlyLeftOf_multirange() AssertSql( """ -@__multirange_0={ '[11,13]', '[15,16]' } (DbType = Object) +@multirange={ '[11,13]', '[15,16]' } (DbType = Object) SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t -WHERE t."IntMultirange" << @__multirange_0 +WHERE t."IntMultirange" << @multirange LIMIT 2 """); } @@ -238,11 +238,11 @@ public void IsStrictlyLeftOf_range() AssertSql( """ -@__range_0='[11,13]' (DbType = Object) +@range='[11,13]' (DbType = Object) SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t -WHERE t."IntMultirange" << @__range_0 +WHERE t."IntMultirange" << @range LIMIT 2 """); } @@ -261,11 +261,11 @@ public void IsStrictlyRightOf_multirange() AssertSql( """ -@__multirange_0={ '[-10,-7]', '[-5,3]' } (DbType = Object) +@multirange={ '[-10,-7]', '[-5,3]' } (DbType = Object) SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t -WHERE t."IntMultirange" >> @__multirange_0 +WHERE t."IntMultirange" >> @multirange LIMIT 2 """); } @@ -284,11 +284,11 @@ public void IsStrictlyRightOf_range() AssertSql( """ -@__range_0='[-5,3]' (DbType = Object) +@range='[-5,3]' (DbType = Object) SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t -WHERE t."IntMultirange" >> @__range_0 +WHERE t."IntMultirange" >> @range LIMIT 2 """); } @@ -307,11 +307,11 @@ public void DoesNotExtendLeftOf_multirange() AssertSql( """ -@__multirange_0={ '[2,7]', '[13,18]' } (DbType = Object) +@multirange={ '[2,7]', '[13,18]' } (DbType = Object) SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t -WHERE t."IntMultirange" &> @__multirange_0 +WHERE t."IntMultirange" &> @multirange LIMIT 2 """); } @@ -330,11 +330,11 @@ public void DoesNotExtendLeftOf_range() AssertSql( """ -@__range_0='[2,7]' (DbType = Object) +@range='[2,7]' (DbType = Object) SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t -WHERE t."IntMultirange" &> @__range_0 +WHERE t."IntMultirange" &> @range LIMIT 2 """); } @@ -353,11 +353,11 @@ public void DoesNotExtendRightOf_multirange() AssertSql( """ -@__multirange_0={ '[-5,-3]', '[13,18]' } (DbType = Object) +@multirange={ '[-5,-3]', '[13,18]' } (DbType = Object) SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t -WHERE t."IntMultirange" &< @__multirange_0 +WHERE t."IntMultirange" &< @multirange LIMIT 2 """); } @@ -376,11 +376,11 @@ public void DoesNotExtendRightOf_range() AssertSql( """ -@__range_0='[13,18]' (DbType = Object) +@range='[13,18]' (DbType = Object) SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t -WHERE t."IntMultirange" &< @__range_0 +WHERE t."IntMultirange" &< @range LIMIT 2 """); } @@ -399,11 +399,11 @@ public void IsAdjacentTo_multirange() AssertSql( """ -@__multirange_0={ '[-5,-4]', '[-2,-1]' } (DbType = Object) +@multirange={ '[-5,-4]', '[-2,-1]' } (DbType = Object) SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t -WHERE t."IntMultirange" -|- @__multirange_0 +WHERE t."IntMultirange" -|- @multirange LIMIT 2 """); } @@ -422,11 +422,11 @@ public void IsAdjacentTo_range() AssertSql( """ -@__range_0='[-2,-1]' (DbType = Object) +@range='[-2,-1]' (DbType = Object) SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t -WHERE t."IntMultirange" -|- @__range_0 +WHERE t."IntMultirange" -|- @range LIMIT 2 """); } @@ -445,11 +445,11 @@ public void Union_multirange() AssertSql( """ -@__multirange_0={ '[-5,-1]' } (DbType = Object) +@multirange={ '[-5,-1]' } (DbType = Object) SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t -WHERE t."IntMultirange" + @__multirange_0 = '{[-5,5], [7,10]}'::int4multirange +WHERE t."IntMultirange" + @multirange = '{[-5,5], [7,10]}'::int4multirange LIMIT 2 """); } @@ -468,11 +468,11 @@ public void Intersect_multirange() AssertSql( """ -@__multirange_0={ '[-5,1]', '[9,13]' } (DbType = Object) +@multirange={ '[-5,1]', '[9,13]' } (DbType = Object) SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t -WHERE t."IntMultirange" * @__multirange_0 = '{[0,1], [9,10]}'::int4multirange +WHERE t."IntMultirange" * @multirange = '{[0,1], [9,10]}'::int4multirange LIMIT 2 """); } @@ -517,11 +517,11 @@ public void Except_multirange() AssertSql( """ -@__multirange_0={ '[2,3]' } (DbType = Object) +@multirange={ '[2,3]' } (DbType = Object) SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t -WHERE t."IntMultirange" - @__multirange_0 = '{[0,1], [4,5], [7,10]}'::int4multirange +WHERE t."IntMultirange" - @multirange = '{[0,1], [4,5], [7,10]}'::int4multirange LIMIT 2 """); } @@ -584,11 +584,11 @@ public void IntMultirange() AssertSql( """ -@__value_0='3' +@value='3' SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t -WHERE t."IntMultirange" @> @__value_0 +WHERE t."IntMultirange" @> @value LIMIT 2 """); } @@ -603,11 +603,11 @@ public void LongMultirange() AssertSql( """ -@__p_0='3' +@p='3' SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t -WHERE t."LongMultirange" @> @__p_0 +WHERE t."LongMultirange" @> @p LIMIT 2 """); } @@ -622,11 +622,11 @@ public void DecimalMultirange() AssertSql( """ -@__p_0='3' +@p='3' SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t -WHERE t."DecimalMultirange" @> @__p_0 +WHERE t."DecimalMultirange" @> @p LIMIT 2 """); } @@ -641,11 +641,11 @@ public void Datemultirange_DateOnly() AssertSql( """ -@__value_0='01/03/2020' (DbType = Date) +@value='01/03/2020' (DbType = Date) SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t -WHERE t."DateOnlyDateMultirange" @> @__value_0 +WHERE t."DateOnlyDateMultirange" @> @value LIMIT 2 """); } @@ -660,11 +660,11 @@ public void Datemultirange_DateTime() AssertSql( """ -@__value_0='2020-01-03T00:00:00.0000000' (DbType = Date) +@value='2020-01-03T00:00:00.0000000' (DbType = Date) SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t -WHERE t."DateTimeDateMultirange" @> @__value_0 +WHERE t."DateTimeDateMultirange" @> @value LIMIT 2 """); } diff --git a/test/EFCore.PG.FunctionalTests/Query/NetworkQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/NetworkQueryNpgsqlTest.cs index 3301d9e0b..ef9b37c97 100644 --- a/test/EFCore.PG.FunctionalTests/Query/NetworkQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/NetworkQueryNpgsqlTest.cs @@ -41,12 +41,12 @@ public void Demonstrate_ValueTypeParametersAreDuplicated() AssertSql( """ -@__cidr_2='0.0.0.0/0' (DbType = Object) -@__p_1='0.0.0.0/0' (DbType = Object) +@cidr='0.0.0.0/0' (DbType = Object) +@p='0.0.0.0/0' (DbType = Object) -SELECT n."Cidr" = @__cidr_2 +SELECT n."Cidr" = @cidr FROM "NetTestEntities" AS n -WHERE n."Cidr" >>= @__p_1 +WHERE n."Cidr" >>= @p """); } @@ -164,11 +164,11 @@ public void LessThan_NpgsqlCidr() AssertSql( """ -@__p_1='0.0.0.0/0' (DbType = Object) +@p='0.0.0.0/0' (DbType = Object) SELECT n."Id", n."Cidr", n."Inet", n."Macaddr", n."Macaddr8", n."TextInet", n."TextMacaddr" FROM "NetTestEntities" AS n -WHERE n."Cidr" < @__p_1 +WHERE n."Cidr" < @p """); } @@ -229,11 +229,11 @@ public void LessThanOrEqual_NpgsqlCidr() AssertSql( """ -@__p_1='0.0.0.0/0' (DbType = Object) +@p='0.0.0.0/0' (DbType = Object) SELECT n."Id", n."Cidr", n."Inet", n."Macaddr", n."Macaddr8", n."TextInet", n."TextMacaddr" FROM "NetTestEntities" AS n -WHERE n."Cidr" <= @__p_1 +WHERE n."Cidr" <= @p """); } @@ -295,11 +295,11 @@ public void GreaterThanOrEqual_NpgsqlCidr() AssertSql( """ -@__p_1='0.0.0.0/0' (DbType = Object) +@p='0.0.0.0/0' (DbType = Object) SELECT n."Id", n."Cidr", n."Inet", n."Macaddr", n."Macaddr8", n."TextInet", n."TextMacaddr" FROM "NetTestEntities" AS n -WHERE n."Cidr" >= @__p_1 +WHERE n."Cidr" >= @p """); } @@ -362,11 +362,11 @@ public void GreaterThan_NpgsqlCidr() AssertSql( """ -@__p_1='0.0.0.0/0' (DbType = Object) +@p='0.0.0.0/0' (DbType = Object) SELECT n."Id", n."Cidr", n."Inet", n."Macaddr", n."Macaddr8", n."TextInet", n."TextMacaddr" FROM "NetTestEntities" AS n -WHERE n."Cidr" > @__p_1 +WHERE n."Cidr" > @p """); } @@ -417,11 +417,11 @@ public void ContainedBy_IPAddress_and_IPAddress() AssertSql( """ -@__p_1='0.0.0.0' (DbType = Object) +@p='0.0.0.0' (DbType = Object) SELECT n."Id", n."Cidr", n."Inet", n."Macaddr", n."Macaddr8", n."TextInet", n."TextMacaddr" FROM "NetTestEntities" AS n -WHERE n."Inet" << @__p_1 +WHERE n."Inet" << @p """); } @@ -436,11 +436,11 @@ public void ContainedBy_IPAddress_and_NpgsqlCidr() AssertSql( """ -@__p_1='0.0.0.0/0' (DbType = Object) +@p='0.0.0.0/0' (DbType = Object) SELECT n."Id", n."Cidr", n."Inet", n."Macaddr", n."Macaddr8", n."TextInet", n."TextMacaddr" FROM "NetTestEntities" AS n -WHERE n."Inet" << @__p_1 +WHERE n."Inet" << @p """); } @@ -455,11 +455,11 @@ public void ContainedBy_NpgsqlCidr_and_NpgsqlCidr() AssertSql( """ -@__p_1='0.0.0.0/0' (DbType = Object) +@p='0.0.0.0/0' (DbType = Object) SELECT n."Id", n."Cidr", n."Inet", n."Macaddr", n."Macaddr8", n."TextInet", n."TextMacaddr" FROM "NetTestEntities" AS n -WHERE n."Cidr" << @__p_1 +WHERE n."Cidr" << @p """); } @@ -474,11 +474,11 @@ public void ContainedByOrEqual_IPAddress_and_IPAddress() AssertSql( """ -@__p_1='0.0.0.0' (DbType = Object) +@p='0.0.0.0' (DbType = Object) SELECT n."Id", n."Cidr", n."Inet", n."Macaddr", n."Macaddr8", n."TextInet", n."TextMacaddr" FROM "NetTestEntities" AS n -WHERE n."Inet" <<= @__p_1 +WHERE n."Inet" <<= @p """); } @@ -493,11 +493,11 @@ public void ContainedByOrEqual_IPAddress_and_NpgsqlCidr() AssertSql( """ -@__p_1='0.0.0.0/0' (DbType = Object) +@p='0.0.0.0/0' (DbType = Object) SELECT n."Id", n."Cidr", n."Inet", n."Macaddr", n."Macaddr8", n."TextInet", n."TextMacaddr" FROM "NetTestEntities" AS n -WHERE n."Inet" <<= @__p_1 +WHERE n."Inet" <<= @p """); } @@ -512,11 +512,11 @@ public void ContainedByOrEqual_NpgsqlCidr_and_NpgsqlCidr() AssertSql( """ -@__p_1='0.0.0.0/0' (DbType = Object) +@p='0.0.0.0/0' (DbType = Object) SELECT n."Id", n."Cidr", n."Inet", n."Macaddr", n."Macaddr8", n."TextInet", n."TextMacaddr" FROM "NetTestEntities" AS n -WHERE n."Cidr" <<= @__p_1 +WHERE n."Cidr" <<= @p """); } @@ -531,11 +531,11 @@ public void Contains_IPAddress_and_IPAddress() AssertSql( """ -@__p_1='0.0.0.0' (DbType = Object) +@p='0.0.0.0' (DbType = Object) SELECT n."Id", n."Cidr", n."Inet", n."Macaddr", n."Macaddr8", n."TextInet", n."TextMacaddr" FROM "NetTestEntities" AS n -WHERE n."Inet" >> @__p_1 +WHERE n."Inet" >> @p """); } @@ -550,11 +550,11 @@ public void Contains_NpgsqlCidr_and_IPAddress() AssertSql( """ -@__p_1='0.0.0.0' (DbType = Object) +@p='0.0.0.0' (DbType = Object) SELECT n."Id", n."Cidr", n."Inet", n."Macaddr", n."Macaddr8", n."TextInet", n."TextMacaddr" FROM "NetTestEntities" AS n -WHERE n."Cidr" >> @__p_1 +WHERE n."Cidr" >> @p """); } @@ -569,11 +569,11 @@ public void Contains_NpgsqlCidr_and_NpgsqlCidr() AssertSql( """ -@__p_1='0.0.0.0/0' (DbType = Object) +@p='0.0.0.0/0' (DbType = Object) SELECT n."Id", n."Cidr", n."Inet", n."Macaddr", n."Macaddr8", n."TextInet", n."TextMacaddr" FROM "NetTestEntities" AS n -WHERE n."Cidr" >> @__p_1 +WHERE n."Cidr" >> @p """); } @@ -588,11 +588,11 @@ public void ContainsOrEqual_IPAddress_and_IPAddress() AssertSql( """ -@__p_1='0.0.0.0' (DbType = Object) +@p='0.0.0.0' (DbType = Object) SELECT n."Id", n."Cidr", n."Inet", n."Macaddr", n."Macaddr8", n."TextInet", n."TextMacaddr" FROM "NetTestEntities" AS n -WHERE n."Inet" >>= @__p_1 +WHERE n."Inet" >>= @p """); } @@ -607,11 +607,11 @@ public void ContainsOrEqual_NpgsqlCidr_and_IPAddress() AssertSql( """ -@__p_1='0.0.0.0' (DbType = Object) +@p='0.0.0.0' (DbType = Object) SELECT n."Id", n."Cidr", n."Inet", n."Macaddr", n."Macaddr8", n."TextInet", n."TextMacaddr" FROM "NetTestEntities" AS n -WHERE n."Cidr" >>= @__p_1 +WHERE n."Cidr" >>= @p """); } @@ -626,11 +626,11 @@ public void ContainsOrEqual_NpgsqlCidr_and_NpgsqlCidr() AssertSql( """ -@__p_1='0.0.0.0/0' (DbType = Object) +@p='0.0.0.0/0' (DbType = Object) SELECT n."Id", n."Cidr", n."Inet", n."Macaddr", n."Macaddr8", n."TextInet", n."TextMacaddr" FROM "NetTestEntities" AS n -WHERE n."Cidr" >>= @__p_1 +WHERE n."Cidr" >>= @p """); } @@ -645,11 +645,11 @@ public void ContainsOrContainedBy_IPAddress_and_IPAddress() AssertSql( """ -@__p_1='0.0.0.0' (DbType = Object) +@p='0.0.0.0' (DbType = Object) SELECT n."Id", n."Cidr", n."Inet", n."Macaddr", n."Macaddr8", n."TextInet", n."TextMacaddr" FROM "NetTestEntities" AS n -WHERE n."Inet" && @__p_1 +WHERE n."Inet" && @p """); } @@ -664,11 +664,11 @@ public void ContainsOrContainedBy_IPAddress_and_NpgsqlCidr() AssertSql( """ -@__p_1='0.0.0.0/0' (DbType = Object) +@p='0.0.0.0/0' (DbType = Object) SELECT n."Id", n."Cidr", n."Inet", n."Macaddr", n."Macaddr8", n."TextInet", n."TextMacaddr" FROM "NetTestEntities" AS n -WHERE n."Inet" && @__p_1 +WHERE n."Inet" && @p """); } @@ -683,11 +683,11 @@ public void ContainsOrContainedBy_NpgsqlCidr_and_IPAddress() AssertSql( """ -@__p_1='0.0.0.0' (DbType = Object) +@p='0.0.0.0' (DbType = Object) SELECT n."Id", n."Cidr", n."Inet", n."Macaddr", n."Macaddr8", n."TextInet", n."TextMacaddr" FROM "NetTestEntities" AS n -WHERE n."Cidr" && @__p_1 +WHERE n."Cidr" && @p """); } @@ -702,11 +702,11 @@ public void ContainsOrContainedBy_NpgsqlCidr_and_NpgsqlCidr() AssertSql( """ -@__p_1='0.0.0.0/0' (DbType = Object) +@p='0.0.0.0/0' (DbType = Object) SELECT n."Id", n."Cidr", n."Inet", n."Macaddr", n."Macaddr8", n."TextInet", n."TextMacaddr" FROM "NetTestEntities" AS n -WHERE n."Cidr" && @__p_1 +WHERE n."Cidr" && @p """); } @@ -785,11 +785,11 @@ public void BitwiseAnd_IPAddress() Assert.Equal(0, count); AssertSql( """ -@__p_1='0.0.0.0' (DbType = Object) +@p='0.0.0.0' (DbType = Object) SELECT count(*)::int FROM "NetTestEntities" AS n -WHERE n."Inet" = n."Inet" & @__p_1 OR n."Inet" IS NULL +WHERE n."Inet" = n."Inet" & @p OR n."Inet" IS NULL """); } @@ -804,9 +804,9 @@ public void BitwiseAnd_NpgsqlCidr() AssertSql( """ -@__p_1='0.0.0.0/0' (DbType = Object) +@p='0.0.0.0/0' (DbType = Object) -SELECT n."Cidr" & @__p_1 +SELECT n."Cidr" & @p FROM "NetTestEntities" AS n """); } @@ -822,9 +822,9 @@ public void BitwiseAnd_PhysicalAddress() AssertSql( """ -@__macaddr_1='000000000000' (DbType = Object) +@macaddr='000000000000' (DbType = Object) -SELECT n."Macaddr" & @__macaddr_1 +SELECT n."Macaddr" & @macaddr FROM "NetTestEntities" AS n """); } @@ -856,9 +856,9 @@ public void BitwiseOr_IPAddress() AssertSql( """ -@__p_1='0.0.0.0' (DbType = Object) +@p='0.0.0.0' (DbType = Object) -SELECT n."Inet" | @__p_1 +SELECT n."Inet" | @p FROM "NetTestEntities" AS n """); } @@ -874,9 +874,9 @@ public void BitwiseOr_NpgsqlCidr() AssertSql( """ -@__p_1='0.0.0.0/0' (DbType = Object) +@p='0.0.0.0/0' (DbType = Object) -SELECT n."Cidr" | @__p_1 +SELECT n."Cidr" | @p FROM "NetTestEntities" AS n """); } @@ -892,9 +892,9 @@ public void BitwiseOr_PhysicalAddress() AssertSql( """ -@__macaddr_1='000000000000' (DbType = Object) +@macaddr='000000000000' (DbType = Object) -SELECT n."Macaddr" | @__macaddr_1 +SELECT n."Macaddr" | @macaddr FROM "NetTestEntities" AS n """); } @@ -992,9 +992,9 @@ public void Subtract_IPAddress_and_IPAddress() AssertSql( """ -@__p_1='0.0.0.0' (DbType = Object) +@p='0.0.0.0' (DbType = Object) -SELECT n."Inet" - @__p_1 +SELECT n."Inet" - @p FROM "NetTestEntities" AS n """); } @@ -1010,9 +1010,9 @@ public void Subtract_NpgsqlCidr_and_NpgsqlCidr() AssertSql( """ -@__p_1='0.0.0.0/0' (DbType = Object) +@p='0.0.0.0/0' (DbType = Object) -SELECT n."Cidr" - @__p_1 +SELECT n."Cidr" - @p FROM "NetTestEntities" AS n """); } @@ -1332,9 +1332,9 @@ public void SameFamily_IPAddress() AssertSql( """ -@__p_1='0.0.0.0' (DbType = Object) +@p='0.0.0.0' (DbType = Object) -SELECT inet_same_family(n."Inet", @__p_1) +SELECT inet_same_family(n."Inet", @p) FROM "NetTestEntities" AS n """); } @@ -1350,9 +1350,9 @@ public void SameFamily_NpgsqlCidr() AssertSql( """ -@__p_1='0.0.0.0/0' (DbType = Object) +@p='0.0.0.0/0' (DbType = Object) -SELECT inet_same_family(n."Cidr", @__p_1) +SELECT inet_same_family(n."Cidr", @p) FROM "NetTestEntities" AS n """); } @@ -1368,9 +1368,9 @@ public void Merge_IPAddress() AssertSql( """ -@__p_1='0.0.0.0' (DbType = Object) +@p='0.0.0.0' (DbType = Object) -SELECT inet_merge(n."Inet", @__p_1) +SELECT inet_merge(n."Inet", @p) FROM "NetTestEntities" AS n """); } @@ -1386,9 +1386,9 @@ public void Merge_NpgsqlCidr() AssertSql( """ -@__p_1='0.0.0.0/0' (DbType = Object) +@p='0.0.0.0/0' (DbType = Object) -SELECT inet_merge(n."Cidr", @__p_1) +SELECT inet_merge(n."Cidr", @p) FROM "NetTestEntities" AS n """); } diff --git a/test/EFCore.PG.FunctionalTests/Query/NodaTimeQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/NodaTimeQueryNpgsqlTest.cs index 1ed6bed17..d35187c54 100644 --- a/test/EFCore.PG.FunctionalTests/Query/NodaTimeQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/NodaTimeQueryNpgsqlTest.cs @@ -123,11 +123,11 @@ await AssertQuery( AssertSql( """ -@__date_0='Friday, 20 April 2018' (DbType = Date) +@date='Friday, 20 April 2018' (DbType = Date) SELECT n."Id", n."DateInterval", n."Duration", n."Instant", n."InstantRange", n."Interval", n."LocalDate", n."LocalDate2", n."LocalDateRange", n."LocalDateTime", n."LocalTime", n."Long", n."OffsetTime", n."Period", n."TimeZoneId", n."ZonedDateTime" FROM "NodaTimeTypes" AS n -WHERE make_interval(days => n."LocalDate2" - @__date_0) = INTERVAL 'P1D' +WHERE make_interval(days => n."LocalDate2" - @date) = INTERVAL 'P1D' """); } @@ -342,11 +342,11 @@ await AssertQuery( AssertSql( """ -@__ToInstant_0='2018-04-20T08:31:33Z' (DbType = DateTime) +@ToInstant='2018-04-20T08:31:33Z' (DbType = DateTime) SELECT n."Id", n."DateInterval", n."Duration", n."Instant", n."InstantRange", n."Interval", n."LocalDate", n."LocalDate2", n."LocalDateRange", n."LocalDateTime", n."LocalTime", n."Long", n."OffsetTime", n."Period", n."TimeZoneId", n."ZonedDateTime" FROM "NodaTimeTypes" AS n -WHERE n."LocalDateTime" AT TIME ZONE 'Europe/Berlin' = @__ToInstant_0 +WHERE n."LocalDateTime" AT TIME ZONE 'Europe/Berlin' = @ToInstant """); } @@ -363,11 +363,11 @@ await AssertQuery( AssertSql( """ -@__ToInstant_0='2018-04-20T08:31:33Z' (DbType = DateTime) +@ToInstant='2018-04-20T08:31:33Z' (DbType = DateTime) SELECT n."Id", n."DateInterval", n."Duration", n."Instant", n."InstantRange", n."Interval", n."LocalDate", n."LocalDate2", n."LocalDateRange", n."LocalDateTime", n."LocalTime", n."Long", n."OffsetTime", n."Period", n."TimeZoneId", n."ZonedDateTime" FROM "NodaTimeTypes" AS n -WHERE n."LocalDateTime" AT TIME ZONE n."TimeZoneId" = @__ToInstant_0 +WHERE n."LocalDateTime" AT TIME ZONE n."TimeZoneId" = @ToInstant """); } @@ -1186,11 +1186,11 @@ await AssertQuery( AssertSql( """ -@__interval_0='2018-01-01T00:00:00Z/2020-12-25T00:00:00Z' (DbType = Object) +@interval='2018-01-01T00:00:00Z/2020-12-25T00:00:00Z' (DbType = Object) SELECT n."Id", n."DateInterval", n."Duration", n."Instant", n."InstantRange", n."Interval", n."LocalDate", n."LocalDate2", n."LocalDateRange", n."LocalDateTime", n."LocalTime", n."Long", n."OffsetTime", n."Period", n."TimeZoneId", n."ZonedDateTime" FROM "NodaTimeTypes" AS n -WHERE @__interval_0 @> n."Instant" +WHERE @interval @> n."Instant" """); } @@ -1333,11 +1333,11 @@ await AssertQuery( AssertSql( """ -@__dateInterval_0='[2018-01-01, 2020-12-25]' (DbType = Object) +@dateInterval='[2018-01-01, 2020-12-25]' (DbType = Object) SELECT n."Id", n."DateInterval", n."Duration", n."Instant", n."InstantRange", n."Interval", n."LocalDate", n."LocalDate2", n."LocalDateRange", n."LocalDateTime", n."LocalTime", n."Long", n."OffsetTime", n."Period", n."TimeZoneId", n."ZonedDateTime" FROM "NodaTimeTypes" AS n -WHERE @__dateInterval_0 @> n."LocalDate" +WHERE @dateInterval @> n."LocalDate" """); } @@ -1353,11 +1353,11 @@ await AssertQuery( AssertSql( """ -@__dateInterval_0='[2018-04-22, 2018-04-24]' (DbType = Object) +@dateInterval='[2018-04-22, 2018-04-24]' (DbType = Object) SELECT n."Id", n."DateInterval", n."Duration", n."Instant", n."InstantRange", n."Interval", n."LocalDate", n."LocalDate2", n."LocalDateRange", n."LocalDateTime", n."LocalTime", n."Long", n."OffsetTime", n."Period", n."TimeZoneId", n."ZonedDateTime" FROM "NodaTimeTypes" AS n -WHERE n."DateInterval" @> @__dateInterval_0 +WHERE n."DateInterval" @> @dateInterval """); } @@ -1374,11 +1374,11 @@ await AssertQuery( AssertSql( """ -@__dateInterval_0='[2018-04-22, 2018-04-26]' (DbType = Object) +@dateInterval='[2018-04-22, 2018-04-26]' (DbType = Object) SELECT n."Id", n."DateInterval", n."Duration", n."Instant", n."InstantRange", n."Interval", n."LocalDate", n."LocalDate2", n."LocalDateRange", n."LocalDateTime", n."LocalTime", n."Long", n."OffsetTime", n."Period", n."TimeZoneId", n."ZonedDateTime" FROM "NodaTimeTypes" AS n -WHERE n."DateInterval" * @__dateInterval_0 = '[2018-04-22,2018-04-24]'::daterange +WHERE n."DateInterval" * @dateInterval = '[2018-04-22,2018-04-24]'::daterange """); } @@ -1395,11 +1395,11 @@ await AssertQuery( AssertSql( """ -@__dateInterval_0='[2018-04-22, 2018-04-26]' (DbType = Object) +@dateInterval='[2018-04-22, 2018-04-26]' (DbType = Object) SELECT n."Id", n."DateInterval", n."Duration", n."Instant", n."InstantRange", n."Interval", n."LocalDate", n."LocalDate2", n."LocalDateRange", n."LocalDateTime", n."LocalTime", n."Long", n."OffsetTime", n."Period", n."TimeZoneId", n."ZonedDateTime" FROM "NodaTimeTypes" AS n -WHERE n."DateInterval" + @__dateInterval_0 = '[2018-04-20,2018-04-26]'::daterange +WHERE n."DateInterval" + @dateInterval = '[2018-04-20,2018-04-26]'::daterange """); } @@ -1477,11 +1477,11 @@ await AssertQuery( AssertSql( """ -@__dateRange_0='[2018-01-01, 2020-12-26]' (DbType = Object) +@dateRange='[2018-01-01, 2020-12-26]' (DbType = Object) SELECT n."Id", n."DateInterval", n."Duration", n."Instant", n."InstantRange", n."Interval", n."LocalDate", n."LocalDate2", n."LocalDateRange", n."LocalDateTime", n."LocalTime", n."Long", n."OffsetTime", n."Period", n."TimeZoneId", n."ZonedDateTime" FROM "NodaTimeTypes" AS n -WHERE @__dateRange_0 @> n."LocalDate" +WHERE @dateRange @> n."LocalDate" """); } @@ -1501,11 +1501,11 @@ await AssertQuery( AssertSql( """ -@__p_0='2018-04-20T10:31:33 UTC (+00)' (DbType = DateTime) +@p='2018-04-20T10:31:33 UTC (+00)' (DbType = DateTime) SELECT n."Id", n."DateInterval", n."Duration", n."Instant", n."InstantRange", n."Interval", n."LocalDate", n."LocalDate2", n."LocalDateRange", n."LocalDateTime", n."LocalTime", n."Long", n."OffsetTime", n."Period", n."TimeZoneId", n."ZonedDateTime" FROM "NodaTimeTypes" AS n -WHERE n."Instant" = @__p_0 +WHERE n."Instant" = @p """); } @@ -1559,11 +1559,11 @@ await AssertQuery( AssertSql( """ -@__timeZone_0='Europe/Berlin' +@timeZone='Europe/Berlin' SELECT n."Id", n."DateInterval", n."Duration", n."Instant", n."InstantRange", n."Interval", n."LocalDate", n."LocalDate2", n."LocalDateRange", n."LocalDateTime", n."LocalTime", n."Long", n."OffsetTime", n."Period", n."TimeZoneId", n."ZonedDateTime" FROM "NodaTimeTypes" AS n -WHERE n."Instant" AT TIME ZONE @__timeZone_0 = TIMESTAMP '2018-04-20T12:31:33.666' +WHERE n."Instant" AT TIME ZONE @timeZone = TIMESTAMP '2018-04-20T12:31:33.666' """); } @@ -1807,11 +1807,11 @@ await AssertQuery( AssertSql( """ -@__ToInstant_0='2018-04-20T10:31:33Z' (DbType = DateTime) +@ToInstant='2018-04-20T10:31:33Z' (DbType = DateTime) SELECT n."Id", n."DateInterval", n."Duration", n."Instant", n."InstantRange", n."Interval", n."LocalDate", n."LocalDate2", n."LocalDateRange", n."LocalDateTime", n."LocalTime", n."Long", n."OffsetTime", n."Period", n."TimeZoneId", n."ZonedDateTime" FROM "NodaTimeTypes" AS n -WHERE n."ZonedDateTime" = @__ToInstant_0 +WHERE n."ZonedDateTime" = @ToInstant """); } @@ -1829,11 +1829,11 @@ public async Task ZonedDateTime_Distance() AssertSql( """ -@__p_1='2018-04-01T00:00:00 UTC (+00)' (DbType = DateTime) +@p='2018-04-01T00:00:00 UTC (+00)' (DbType = DateTime) SELECT n."Id", n."DateInterval", n."Duration", n."Instant", n."InstantRange", n."Interval", n."LocalDate", n."LocalDate2", n."LocalDateRange", n."LocalDateTime", n."LocalTime", n."Long", n."OffsetTime", n."Period", n."TimeZoneId", n."ZonedDateTime" FROM "NodaTimeTypes" AS n -ORDER BY n."ZonedDateTime" <-> @__p_1 NULLS FIRST +ORDER BY n."ZonedDateTime" <-> @p NULLS FIRST LIMIT 1 """); } diff --git a/test/EFCore.PG.FunctionalTests/Query/NorthwindAggregateOperatorsQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/NorthwindAggregateOperatorsQueryNpgsqlTest.cs index fd286401b..40ac10e5f 100644 --- a/test/EFCore.PG.FunctionalTests/Query/NorthwindAggregateOperatorsQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/NorthwindAggregateOperatorsQueryNpgsqlTest.cs @@ -26,7 +26,7 @@ await AssertAverage( AssertSql( """ -@__p_0='3' +@p='3' SELECT avg(( SELECT avg(CAST(5 + ( @@ -39,7 +39,7 @@ SELECT max(o0."ProductID") SELECT c."CustomerID" FROM "Customers" AS c ORDER BY c."CustomerID" NULLS FIRST - LIMIT @__p_0 + LIMIT @p ) AS c0 """); } @@ -51,19 +51,19 @@ public override async Task Contains_with_local_uint_array_closure(bool async) // Note: PostgreSQL doesn't support uint, but value converters make this into bigint AssertSql( """ -@__ids_0={ '0', '1' } (DbType = Object) +@ids={ '0', '1' } (DbType = Object) SELECT e."EmployeeID", e."City", e."Country", e."FirstName", e."ReportsTo", e."Title" FROM "Employees" AS e -WHERE e."EmployeeID" = ANY (@__ids_0) +WHERE e."EmployeeID" = ANY (@ids) """, // """ -@__ids_0={ '0' } (DbType = Object) +@ids={ '0' } (DbType = Object) SELECT e."EmployeeID", e."City", e."Country", e."FirstName", e."ReportsTo", e."Title" FROM "Employees" AS e -WHERE e."EmployeeID" = ANY (@__ids_0) +WHERE e."EmployeeID" = ANY (@ids) """); } @@ -75,19 +75,19 @@ public override async Task Contains_with_local_nullable_uint_array_closure(bool AssertSql( """ -@__ids_0={ '0', '1' } (DbType = Object) +@ids={ '0', '1' } (DbType = Object) SELECT e."EmployeeID", e."City", e."Country", e."FirstName", e."ReportsTo", e."Title" FROM "Employees" AS e -WHERE e."EmployeeID" = ANY (@__ids_0) +WHERE e."EmployeeID" = ANY (@ids) """, // """ -@__ids_0={ '0' } (DbType = Object) +@ids={ '0' } (DbType = Object) SELECT e."EmployeeID", e."City", e."Country", e."FirstName", e."ReportsTo", e."Title" FROM "Employees" AS e -WHERE e."EmployeeID" = ANY (@__ids_0) +WHERE e."EmployeeID" = ANY (@ids) """); } @@ -114,19 +114,19 @@ public override async Task Contains_with_local_enumerable_inline_closure_mix(boo AssertSql( """ -@__p_0={ 'ABCDE', 'ALFKI' } (DbType = Object) +@p={ 'ABCDE', 'ALFKI' } (DbType = Object) SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."Phone", c."PostalCode", c."Region" FROM "Customers" AS c -WHERE c."CustomerID" = ANY (array_remove(@__p_0, NULL)) +WHERE c."CustomerID" = ANY (array_remove(@p, NULL)) """, // """ -@__p_0={ 'ABCDE', 'ANATR' } (DbType = Object) +@p={ 'ABCDE', 'ANATR' } (DbType = Object) SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."Phone", c."PostalCode", c."Region" FROM "Customers" AS c -WHERE c."CustomerID" = ANY (array_remove(@__p_0, NULL)) +WHERE c."CustomerID" = ANY (array_remove(@p, NULL)) """); } @@ -136,11 +136,11 @@ public override async Task Contains_with_local_non_primitive_list_closure_mix(bo AssertSql( """ -@__Select_0={ 'ABCDE', 'ALFKI' } (DbType = Object) +@Select={ 'ABCDE', 'ALFKI' } (DbType = Object) SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."Phone", c."PostalCode", c."Region" FROM "Customers" AS c -WHERE c."CustomerID" = ANY (@__Select_0) +WHERE c."CustomerID" = ANY (@Select) """); } @@ -150,19 +150,19 @@ public override async Task Contains_with_local_non_primitive_list_inline_closure AssertSql( """ -@__Select_0={ 'ABCDE', 'ALFKI' } (DbType = Object) +@Select={ 'ABCDE', 'ALFKI' } (DbType = Object) SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."Phone", c."PostalCode", c."Region" FROM "Customers" AS c -WHERE c."CustomerID" = ANY (@__Select_0) +WHERE c."CustomerID" = ANY (@Select) """, // """ -@__Select_0={ 'ABCDE', 'ANATR' } (DbType = Object) +@Select={ 'ABCDE', 'ANATR' } (DbType = Object) SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."Phone", c."PostalCode", c."Region" FROM "Customers" AS c -WHERE c."CustomerID" = ANY (@__Select_0) +WHERE c."CustomerID" = ANY (@Select) """); } diff --git a/test/EFCore.PG.FunctionalTests/Query/NorthwindFunctionsQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/NorthwindFunctionsQueryNpgsqlTest.cs index 5c422ffed..ebd49c4d3 100644 --- a/test/EFCore.PG.FunctionalTests/Query/NorthwindFunctionsQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/NorthwindFunctionsQueryNpgsqlTest.cs @@ -53,11 +53,11 @@ public override async Task String_Join_non_aggregate(bool async) AssertSql( """ -@__foo_0='foo' +@foo='foo' SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."Phone", c."PostalCode", c."Region" FROM "Customers" AS c -WHERE concat_ws('|', c."CompanyName", @__foo_0, '', 'bar') = 'Around the Horn|foo||bar' +WHERE concat_ws('|', c."CompanyName", @foo, '', 'bar') = 'Around the Horn|foo||bar' """); } @@ -140,11 +140,11 @@ await AssertQuery( AssertSql( """ -@__pattern_0='^A' +@pattern='^A' SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."Phone", c."PostalCode", c."Region" FROM "Customers" AS c -WHERE c."CompanyName" ~ ('(?p)' || @__pattern_0) +WHERE c."CompanyName" ~ ('(?p)' || @pattern) """); } @@ -311,13 +311,12 @@ await AssertQuery( AssertSql( """ -@__pattern_0='^A' -@__replacement_1='B' +@pattern='^A' +@replacement='B' -SELECT regexp_replace(c."CompanyName", @__pattern_0, @__replacement_1, 'p') +SELECT regexp_replace(c."CompanyName", @pattern, @replacement, 'p') FROM "Customers" AS c -""" - ); +"""); } [Theory] @@ -453,12 +452,11 @@ await AssertQuery( AssertSql( """ -@__pattern_0='^A' +@pattern='^A' -SELECT regexp_count(c."CompanyName", @__pattern_0, 1, 'p') +SELECT regexp_count(c."CompanyName", @pattern, 1, 'p') FROM "Customers" AS c -""" - ); +"""); } [ConditionalTheory] diff --git a/test/EFCore.PG.FunctionalTests/Query/NorthwindGroupByQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/NorthwindGroupByQueryNpgsqlTest.cs index d413e5c8c..5d963e9bf 100644 --- a/test/EFCore.PG.FunctionalTests/Query/NorthwindGroupByQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/NorthwindGroupByQueryNpgsqlTest.cs @@ -18,6 +18,8 @@ public NorthwindGroupByQueryNpgsqlTest( public virtual void Check_all_tests_overridden() => TestHelpers.AssertAllMethodsOverridden(GetType()); + #region GroupByProperty + public override async Task GroupBy_Property_Select_Average(bool async) { await base.GroupBy_Property_Select_Average(async); @@ -294,6 +296,10 @@ GROUP BY o."OrderDate" """); } + #endregion GroupByProperty + + #region GroupByAnonymousAggregate + public override async Task GroupBy_anonymous_Select_Average(bool async) { await base.GroupBy_anonymous_Select_Average(async); @@ -743,11 +749,11 @@ public override async Task GroupBy_param_Select_Sum_Min_Key_Max_Avg(bool async) AssertSql( """ -@__a_0='2' +@a='2' SELECT COALESCE(sum(o0."OrderID"), 0)::int AS "Sum", min(o0."OrderID") AS "Min", o0."Key", max(o0."OrderID") AS "Max", avg(o0."OrderID"::double precision) AS "Avg" FROM ( - SELECT o."OrderID", @__a_0 AS "Key" + SELECT o."OrderID", @a AS "Key" FROM "Orders" AS o ) AS o0 GROUP BY o0."Key" @@ -760,11 +766,11 @@ public override async Task GroupBy_param_with_element_selector_Select_Sum(bool a AssertSql( """ -@__a_0='2' +@a='2' SELECT COALESCE(sum(o0."OrderID"), 0)::int AS "Sum" FROM ( - SELECT o."OrderID", @__a_0 AS "Key" + SELECT o."OrderID", @a AS "Key" FROM "Orders" AS o ) AS o0 GROUP BY o0."Key" @@ -777,11 +783,11 @@ public override async Task GroupBy_param_with_element_selector_Select_Sum2(bool AssertSql( """ -@__a_0='2' +@a='2' SELECT COALESCE(sum(o0."OrderID"), 0)::int AS "Sum" FROM ( - SELECT o."OrderID", @__a_0 AS "Key" + SELECT o."OrderID", @a AS "Key" FROM "Orders" AS o ) AS o0 GROUP BY o0."Key" @@ -794,11 +800,11 @@ public override async Task GroupBy_param_with_element_selector_Select_Sum3(bool AssertSql( """ -@__a_0='2' +@a='2' SELECT COALESCE(sum(o0."OrderID"), 0)::int AS "Sum" FROM ( - SELECT o."OrderID", @__a_0 AS "Key" + SELECT o."OrderID", @a AS "Key" FROM "Orders" AS o ) AS o0 GROUP BY o0."Key" @@ -811,11 +817,11 @@ public override async Task GroupBy_param_with_element_selector_Select_Sum_Min_Ke AssertSql( """ -@__a_0='2' +@a='2' SELECT COALESCE(sum(o0."OrderID"), 0)::int AS "Sum", o0."Key" FROM ( - SELECT o."OrderID", @__a_0 AS "Key" + SELECT o."OrderID", @a AS "Key" FROM "Orders" AS o ) AS o0 GROUP BY o0."Key" @@ -838,6 +844,10 @@ ORDER BY o0."I0" NULLS FIRST """); } + #endregion GroupByAnonymousAggregate + + #region GroupByWithElementSelectorAggregate + public override async Task GroupBy_Property_scalar_element_selector_Average(bool async) { await base.GroupBy_Property_scalar_element_selector_Average(async); @@ -1090,6 +1100,10 @@ public override async Task GroupBy_conditional_properties(bool async) """); } + #endregion GroupByWithElementSelectorAggregate + + #region GroupByAfterComposition + public override async Task GroupBy_empty_key_Aggregate(bool async) { await base.GroupBy_empty_key_Aggregate(async); @@ -1138,14 +1152,14 @@ public override async Task OrderBy_Skip_GroupBy_Aggregate(bool async) AssertSql( """ -@__p_0='80' +@p='80' SELECT avg(o0."OrderID"::double precision) FROM ( SELECT o."OrderID", o."CustomerID" FROM "Orders" AS o ORDER BY o."OrderID" NULLS FIRST - OFFSET @__p_0 + OFFSET @p ) AS o0 GROUP BY o0."CustomerID" """); @@ -1157,14 +1171,14 @@ public override async Task OrderBy_Take_GroupBy_Aggregate(bool async) AssertSql( """ -@__p_0='500' +@p='500' SELECT min(o0."OrderID") FROM ( SELECT o."OrderID", o."CustomerID" FROM "Orders" AS o ORDER BY o."OrderID" NULLS FIRST - LIMIT @__p_0 + LIMIT @p ) AS o0 GROUP BY o0."CustomerID" """); @@ -1176,15 +1190,15 @@ public override async Task OrderBy_Skip_Take_GroupBy_Aggregate(bool async) AssertSql( """ -@__p_1='500' -@__p_0='80' +@p0='500' +@p='80' SELECT max(o0."OrderID") FROM ( SELECT o."OrderID", o."CustomerID" FROM "Orders" AS o ORDER BY o."OrderID" NULLS FIRST - LIMIT @__p_1 OFFSET @__p_0 + LIMIT @p0 OFFSET @p ) AS o0 GROUP BY o0."CustomerID" """); @@ -1265,9 +1279,9 @@ public override async Task Join_complex_GroupBy_Aggregate(bool async) AssertSql( """ -@__p_0='100' -@__p_2='50' -@__p_1='10' +@p='100' +@p1='50' +@p0='10' SELECT c0."CustomerID" AS "Key", avg(o0."OrderID"::double precision) AS "Count" FROM ( @@ -1275,14 +1289,14 @@ public override async Task Join_complex_GroupBy_Aggregate(bool async) FROM "Orders" AS o WHERE o."OrderID" < 10400 ORDER BY o."OrderDate" NULLS FIRST - LIMIT @__p_0 + LIMIT @p ) AS o0 INNER JOIN ( SELECT c."CustomerID" FROM "Customers" AS c WHERE c."CustomerID" NOT IN ('DRACD', 'FOLKO') ORDER BY c."City" NULLS FIRST - LIMIT @__p_2 OFFSET @__p_1 + LIMIT @p1 OFFSET @p0 ) AS c0 ON o0."CustomerID" = c0."CustomerID" GROUP BY c0."CustomerID" """); @@ -1373,9 +1387,9 @@ public override async Task GroupJoin_complex_GroupBy_Aggregate(bool async) AssertSql( """ -@__p_1='50' -@__p_0='10' -@__p_2='100' +@p0='50' +@p='10' +@p1='100' SELECT o0."CustomerID" AS "Key", avg(o0."OrderID"::double precision) AS "Count" FROM ( @@ -1383,14 +1397,14 @@ SELECT c."CustomerID" FROM "Customers" AS c WHERE c."CustomerID" NOT IN ('DRACD', 'FOLKO') ORDER BY c."City" NULLS FIRST - LIMIT @__p_1 OFFSET @__p_0 + LIMIT @p0 OFFSET @p ) AS c0 INNER JOIN ( SELECT o."OrderID", o."CustomerID" FROM "Orders" AS o WHERE o."OrderID" < 10400 ORDER BY o."OrderDate" NULLS FIRST - LIMIT @__p_2 + LIMIT @p1 ) AS o0 ON c0."CustomerID" = o0."CustomerID" WHERE o0."OrderID" > 10300 GROUP BY o0."CustomerID" @@ -1532,6 +1546,10 @@ GROUP BY c."City" """); } + #endregion GroupByAfterComposition + + #region GroupByAggregateComposition + public override async Task GroupBy_OrderBy_key(bool async) { await base.GroupBy_OrderBy_key(async); @@ -1593,8 +1611,8 @@ public override async Task GroupBy_aggregate_Pushdown(bool async) AssertSql( """ -@__p_0='20' -@__p_1='4' +@p='20' +@p0='4' SELECT o0."CustomerID" FROM ( @@ -1603,10 +1621,10 @@ SELECT o."CustomerID" GROUP BY o."CustomerID" HAVING count(*)::int > 10 ORDER BY o."CustomerID" NULLS FIRST - LIMIT @__p_0 + LIMIT @p ) AS o0 ORDER BY o0."CustomerID" NULLS FIRST -OFFSET @__p_1 +OFFSET @p0 """); } @@ -1616,8 +1634,8 @@ public override async Task GroupBy_aggregate_using_grouping_key_Pushdown(bool as AssertSql( """ -@__p_0='20' -@__p_1='4' +@p='20' +@p0='4' SELECT o0."Key", o0."Max" FROM ( @@ -1626,10 +1644,10 @@ public override async Task GroupBy_aggregate_using_grouping_key_Pushdown(bool as GROUP BY o."CustomerID" HAVING count(*)::int > 10 ORDER BY o."CustomerID" NULLS FIRST - LIMIT @__p_0 + LIMIT @p ) AS o0 ORDER BY o0."Key" NULLS FIRST -OFFSET @__p_1 +OFFSET @p0 """); } @@ -1639,8 +1657,8 @@ public override async Task GroupBy_aggregate_Pushdown_followed_by_projecting_Len AssertSql( """ -@__p_0='20' -@__p_1='4' +@p='20' +@p0='4' SELECT length(o0."CustomerID")::int FROM ( @@ -1649,10 +1667,10 @@ SELECT o."CustomerID" GROUP BY o."CustomerID" HAVING count(*)::int > 10 ORDER BY o."CustomerID" NULLS FIRST - LIMIT @__p_0 + LIMIT @p ) AS o0 ORDER BY o0."CustomerID" NULLS FIRST -OFFSET @__p_1 +OFFSET @p0 """); } @@ -1662,8 +1680,8 @@ public override async Task GroupBy_aggregate_Pushdown_followed_by_projecting_con AssertSql( """ -@__p_0='20' -@__p_1='4' +@p='20' +@p0='4' SELECT 5 FROM ( @@ -1672,10 +1690,10 @@ SELECT o."CustomerID" GROUP BY o."CustomerID" HAVING count(*)::int > 10 ORDER BY o."CustomerID" NULLS FIRST - LIMIT @__p_0 + LIMIT @p ) AS o0 ORDER BY o0."CustomerID" NULLS FIRST -OFFSET @__p_1 +OFFSET @p0 """); } @@ -2047,6 +2065,10 @@ GROUP BY o."CustomerID" """); } + #endregion GroupByAggregateComposition + + #region GroupByAggregateChainComposition + public override async Task GroupBy_Where_Average(bool async) { await base.GroupBy_Where_Average(async); @@ -2270,6 +2292,10 @@ GROUP BY o."EmployeeID" """); } + #endregion GroupByWithoutAggregate + + #region GroupBySelectFirst + public override async Task GroupBy_Shadow(bool async) { await base.GroupBy_Shadow(async); @@ -2408,6 +2434,10 @@ public override async Task Select_GroupBy_SelectMany(bool async) AssertSql(); } + #endregion GroupByEntityType + + #region ResultOperatorsAfterGroupBy + public override async Task Count_after_GroupBy_aggregate(bool async) { await base.Count_after_GroupBy_aggregate(async); @@ -2444,7 +2474,7 @@ public override async Task GroupBy_Select_Distinct_aggregate(bool async) AssertSql( """ -SELECT o."CustomerID" AS "Key", avg(DISTINCT o."OrderID"::double precision) AS "Average", count(DISTINCT o."EmployeeID")::int AS "Count", count(DISTINCT o."EmployeeID") AS "LongCount", max(DISTINCT o."OrderDate") AS "Max", min(DISTINCT o."OrderDate") AS "Min", COALESCE(sum(DISTINCT o."OrderID"), 0)::int AS "Sum" +SELECT o."CustomerID" AS "Key", avg(DISTINCT o."OrderID"::double precision) AS "Average", count(DISTINCT o."EmployeeID")::int AS "Count", count(DISTINCT o."EmployeeID") AS "LongCount", max(o."OrderDate") AS "Max", min(o."OrderDate") AS "Min", COALESCE(sum(DISTINCT o."OrderID"), 0)::int AS "Sum" FROM "Orders" AS o GROUP BY o."CustomerID" """); @@ -2456,7 +2486,7 @@ public override async Task GroupBy_group_Distinct_Select_Distinct_aggregate(bool AssertSql( """ -SELECT o."CustomerID" AS "Key", max(DISTINCT o."OrderDate") AS "Max" +SELECT o."CustomerID" AS "Key", max(o."OrderDate") AS "Max" FROM "Orders" AS o GROUP BY o."CustomerID" """); @@ -2468,7 +2498,7 @@ public override async Task GroupBy_group_Where_Select_Distinct_aggregate(bool as AssertSql( """ -SELECT o."CustomerID" AS "Key", max(DISTINCT o."OrderDate") FILTER (WHERE o."OrderDate" IS NOT NULL) AS "Max" +SELECT o."CustomerID" AS "Key", max(o."OrderDate") FILTER (WHERE o."OrderDate" IS NOT NULL) AS "Max" FROM "Orders" AS o GROUP BY o."CustomerID" """); @@ -2785,6 +2815,10 @@ GROUP BY c."Country" """); } + #endregion GroupBySelectFirst + + #region GroupByEntityType + public override async Task GroupBy_with_group_key_being_navigation(bool async) { await base.GroupBy_with_group_key_being_navigation(async); @@ -2838,14 +2872,14 @@ public override async Task GroupBy_with_order_by_skip_and_another_order_by(bool AssertSql( """ -@__p_0='80' +@p='80' SELECT COALESCE(sum(o0."OrderID"), 0)::int FROM ( SELECT o."OrderID", o."CustomerID" FROM "Orders" AS o ORDER BY o."CustomerID" NULLS FIRST, o."OrderID" NULLS FIRST - OFFSET @__p_0 + OFFSET @p ) AS o0 GROUP BY o0."CustomerID" """); @@ -2976,7 +3010,7 @@ public override async Task GroupBy_aggregate_from_right_side_of_join(bool async) AssertSql( """ -@__p_0='10' +@p='10' SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."Phone", c."PostalCode", c."Region", o0."Max" FROM "Customers" AS c @@ -2986,7 +3020,7 @@ INNER JOIN ( GROUP BY o."CustomerID" ) AS o0 ON c."CustomerID" = o0."Key" ORDER BY o0."Max" NULLS FIRST, c."CustomerID" NULLS FIRST -LIMIT @__p_0 OFFSET @__p_0 +LIMIT @p OFFSET @p """); } @@ -3017,13 +3051,13 @@ public override async Task GroupBy_aggregate_after_skip_0_take_0(bool async) AssertSql( """ -@__p_0='0' +@p='0' SELECT o0."CustomerID" AS "Key", count(*)::int AS "Total" FROM ( SELECT o."CustomerID" FROM "Orders" AS o - LIMIT @__p_0 OFFSET @__p_0 + LIMIT @p OFFSET @p ) AS o0 GROUP BY o0."CustomerID" """); @@ -3035,13 +3069,13 @@ public override async Task GroupBy_skip_0_take_0_aggregate(bool async) AssertSql( """ -@__p_0='0' +@p='0' SELECT o."CustomerID" AS "Key", count(*)::int AS "Total" FROM "Orders" AS o WHERE o."OrderID" > 10500 GROUP BY o."CustomerID" -LIMIT @__p_0 OFFSET @__p_0 +LIMIT @p OFFSET @p """); } @@ -3157,6 +3191,10 @@ GROUP BY o."CustomerID" """); } + #endregion ResultOperatorsAfterGroupBy + + #region GroupByInSubquery + public override async Task Complex_query_with_groupBy_in_subquery1(bool async) { await base.Complex_query_with_groupBy_in_subquery1(async); @@ -3411,6 +3449,10 @@ GROUP BY o."CustomerID" """); } + #endregion GroupByInSubquery + + #region GroupByAndDistinctWithCorrelatedCollection + public override async Task Select_uncorrelated_collection_with_groupby_when_outer_is_distinct(bool async) { await base.Select_uncorrelated_collection_with_groupby_when_outer_is_distinct(async); @@ -3717,6 +3759,24 @@ LEFT JOIN ( """); } + public override async Task Final_GroupBy_TagWith(bool async) + { + await base.Final_GroupBy_TagWith(async); + + AssertSql( + """ +-- foo + +SELECT c."City", c."CustomerID", c."Address", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."Phone", c."PostalCode", c."Region" +FROM "Customers" AS c +ORDER BY c."City" NULLS FIRST +"""); + } + + #endregion Final + + #region GroupByWithoutAggregate + public override async Task GroupBy_Where_with_grouping_result(bool async) { await base.GroupBy_Where_with_grouping_result(async); @@ -3817,6 +3877,8 @@ GROUP BY o."CustomerID" """); } + #endregion GroupByAndDistinctWithCorrelatedCollection + // See aggregate tests over TimeSpan in GearsOfWarQueryNpsgqlTest private void AssertSql(params string[] expected) diff --git a/test/EFCore.PG.FunctionalTests/Query/NorthwindMiscellaneousQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/NorthwindMiscellaneousQueryNpgsqlTest.cs index 521f2ff6c..f92e815ea 100644 --- a/test/EFCore.PG.FunctionalTests/Query/NorthwindMiscellaneousQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/NorthwindMiscellaneousQueryNpgsqlTest.cs @@ -55,9 +55,9 @@ await AssertQuery( AssertSql( """ -@__years_0='2' +@years='2' -SELECT o."OrderDate" + CAST(@__years_0::text || ' years' AS interval) AS "OrderDate" +SELECT o."OrderDate" + CAST(@years::text || ' years' AS interval) AS "OrderDate" FROM "Orders" AS o WHERE o."OrderDate" IS NOT NULL """); @@ -211,6 +211,10 @@ public override async Task Where_bitwise_binary_xor(bool async) """); } + // TODO: #3406 + public override Task Where_nanosecond_and_microsecond_component(bool async) + => AssertTranslationFailed(() => base.Where_nanosecond_and_microsecond_component(async)); + // TODO: Array tests can probably move to the dedicated ArrayQueryTest suite #region Array contains @@ -251,11 +255,11 @@ await AssertQuery( // (see https://github.com/aspnet/EntityFrameworkCore/issues/17598). AssertSql( """ -@__regions_0={ 'UK', 'SP' } (DbType = Object) +@regions={ 'UK', 'SP' } (DbType = Object) SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."Phone", c."PostalCode", c."Region" FROM "Customers" AS c -WHERE c."Region" = ANY (@__regions_0) OR (c."Region" IS NULL AND array_position(@__regions_0, NULL) IS NOT NULL) +WHERE c."Region" = ANY (@regions) OR (c."Region" IS NULL AND array_position(@regions, NULL) IS NOT NULL) """); } @@ -275,11 +279,11 @@ await AssertQuery( // (see https://github.com/aspnet/EntityFrameworkCore/issues/17598). AssertSql( """ -@__regions_0={ 'UK', 'SP', NULL } (DbType = Object) +@regions={ 'UK', 'SP', NULL } (DbType = Object) SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."Phone", c."PostalCode", c."Region" FROM "Customers" AS c -WHERE c."Region" = ANY (@__regions_0) OR (c."Region" IS NULL AND array_position(@__regions_0, NULL) IS NOT NULL) +WHERE c."Region" = ANY (@regions) OR (c."Region" IS NULL AND array_position(@regions, NULL) IS NOT NULL) """); } @@ -325,11 +329,11 @@ public async Task Array_Any_Like(bool async) AssertSql( """ -@__collection_1={ 'A%', 'B%', 'C%' } (DbType = Object) +@collection={ 'A%', 'B%', 'C%' } (DbType = Object) SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."Phone", c."PostalCode", c."Region" FROM "Customers" AS c -WHERE c."Address" LIKE ANY (@__collection_1) +WHERE c."Address" LIKE ANY (@collection) """); } @@ -347,11 +351,11 @@ public async Task Array_All_Like(bool async) AssertSql( """ -@__collection_1={ 'A%', 'B%', 'C%' } (DbType = Object) +@collection={ 'A%', 'B%', 'C%' } (DbType = Object) SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."Phone", c."PostalCode", c."Region" FROM "Customers" AS c -WHERE c."Address" LIKE ALL (@__collection_1) +WHERE c."Address" LIKE ALL (@collection) """); } @@ -369,11 +373,11 @@ public async Task Array_All_Like_negated(bool async) AssertSql( """ -@__collection_1={ 'A%', 'B%', 'C%' } (DbType = Object) +@collection={ 'A%', 'B%', 'C%' } (DbType = Object) SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."Phone", c."PostalCode", c."Region" FROM "Customers" AS c -WHERE NOT (c."Address" LIKE ALL (@__collection_1)) +WHERE NOT (c."Address" LIKE ALL (@collection)) """); } @@ -415,11 +419,11 @@ public async Task Array_Any_ILike(bool async) AssertSql( """ -@__collection_1={ 'a%', 'b%', 'c%' } (DbType = Object) +@collection={ 'a%', 'b%', 'c%' } (DbType = Object) SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."Phone", c."PostalCode", c."Region" FROM "Customers" AS c -WHERE c."Address" ILIKE ANY (@__collection_1) +WHERE c."Address" ILIKE ANY (@collection) """); } @@ -444,11 +448,11 @@ public async Task Array_Any_ILike_negated(bool async) AssertSql( """ -@__collection_1={ 'a%', 'b%', 'c%' } (DbType = Object) +@collection={ 'a%', 'b%', 'c%' } (DbType = Object) SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."Phone", c."PostalCode", c."Region" FROM "Customers" AS c -WHERE NOT (c."Address" ILIKE ANY (@__collection_1)) +WHERE NOT (c."Address" ILIKE ANY (@collection)) """); } @@ -466,11 +470,11 @@ public async Task Array_All_ILike(bool async) AssertSql( """ -@__collection_1={ 'a%', 'b%', 'c%' } (DbType = Object) +@collection={ 'a%', 'b%', 'c%' } (DbType = Object) SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."Phone", c."PostalCode", c."Region" FROM "Customers" AS c -WHERE c."Address" ILIKE ALL (@__collection_1) +WHERE c."Address" ILIKE ALL (@collection) """); } diff --git a/test/EFCore.PG.FunctionalTests/Query/NorthwindWhereQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/NorthwindWhereQueryNpgsqlTest.cs index 552db3a89..21ed30228 100644 --- a/test/EFCore.PG.FunctionalTests/Query/NorthwindWhereQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/NorthwindWhereQueryNpgsqlTest.cs @@ -49,11 +49,11 @@ public override async Task Where_datetime_date_component(bool async) AssertSql( """ -@__myDatetime_0='1998-05-04T00:00:00.0000000' +@myDatetime='1998-05-04T00:00:00.0000000' SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."OrderDate" FROM "Orders" AS o -WHERE date_trunc('day', o."OrderDate") = @__myDatetime_0 +WHERE date_trunc('day', o."OrderDate") = @myDatetime """); } @@ -331,11 +331,11 @@ public async Task Row_value_GreaterThan_with_parameter() AssertSql( """ -@__city1_0='Buenos Aires' +@city1='Buenos Aires' SELECT count(*)::int FROM "Customers" AS c -WHERE (c."City", c."CustomerID") > (@__city1_0, 'OCEAN') +WHERE (c."City", c."CustomerID") > (@city1, 'OCEAN') """); } @@ -355,11 +355,11 @@ public async Task Row_value_GreaterThan_with_parameter_with_ValueTuple_construct AssertSql( """ -@__city1_0='Buenos Aires' +@city1='Buenos Aires' SELECT count(*)::int FROM "Customers" AS c -WHERE (c."City", c."CustomerID") > (@__city1_0, 'OCEAN') +WHERE (c."City", c."CustomerID") > (@city1, 'OCEAN') """); } diff --git a/test/EFCore.PG.FunctionalTests/Query/PrecompiledQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/PrecompiledQueryNpgsqlTest.cs index c64f357b1..f9ac21c3d 100644 --- a/test/EFCore.PG.FunctionalTests/Query/PrecompiledQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/PrecompiledQueryNpgsqlTest.cs @@ -20,11 +20,11 @@ public override async Task BinaryExpression() AssertSql( """ -@__id_0='3' +@id='3' SELECT b."Id", b."Name", b."Json" FROM "Blogs" AS b -WHERE b."Id" > @__id_0 +WHERE b."Id" > @id """); } @@ -48,10 +48,10 @@ public override async Task Conditional_contains_captured_variable() AssertSql( """ -@__yes_0='yes' +@yes='yes' SELECT CASE - WHEN b."Id" = 2 THEN @__yes_0 + WHEN b."Id" = 2 THEN @yes ELSE 'no' END FROM "Blogs" AS b @@ -129,11 +129,11 @@ public override async Task MethodCallExpression_with_evaluatable_with_captured_v AssertSql( """ -@__pattern_0_startswith='foo%' +@pattern_startswith='foo%' SELECT b."Id", b."Name", b."Json" FROM "Blogs" AS b -WHERE b."Name" LIKE @__pattern_0_startswith +WHERE b."Name" LIKE @pattern_startswith """); } @@ -207,9 +207,9 @@ public override async Task MemberInit_contains_captured_variable() AssertSql( """ -@__id_0='8' +@id='8' -SELECT @__id_0 AS "Id", b."Name" +SELECT @id AS "Id", b."Name" FROM "Blogs" AS b """); } @@ -242,9 +242,9 @@ public override async Task NewArray() AssertSql( """ -@__i_0='8' +@i='8' -SELECT ARRAY[b."Id",b."Id" + @__i_0]::integer[] +SELECT ARRAY[b."Id",b."Id" + @i]::integer[] FROM "Blogs" AS b """); } @@ -601,18 +601,18 @@ public override async Task Terminating_Contains() AssertSql( """ -@__p_0='8' +@p='8' -SELECT @__p_0 IN ( +SELECT @p IN ( SELECT b."Id" FROM "Blogs" AS b ) """, // """ -@__p_0='7' +@p='7' -SELECT @__p_0 IN ( +SELECT @p IN ( SELECT b."Id" FROM "Blogs" AS b ) @@ -625,18 +625,18 @@ public override async Task Terminating_ContainsAsync() AssertSql( """ -@__p_0='8' +@p='8' -SELECT @__p_0 IN ( +SELECT @p IN ( SELECT b."Id" FROM "Blogs" AS b ) """, // """ -@__p_0='7' +@p='7' -SELECT @__p_0 IN ( +SELECT @p IN ( SELECT b."Id" FROM "Blogs" AS b ) @@ -683,21 +683,21 @@ public override async Task Terminating_ElementAt() AssertSql( """ -@__p_0='1' +@p='1' SELECT b."Id", b."Name", b."Json" FROM "Blogs" AS b ORDER BY b."Id" NULLS FIRST -LIMIT 1 OFFSET @__p_0 +LIMIT 1 OFFSET @p """, // """ -@__p_0='3' +@p='3' SELECT b."Id", b."Name", b."Json" FROM "Blogs" AS b ORDER BY b."Id" NULLS FIRST -LIMIT 1 OFFSET @__p_0 +LIMIT 1 OFFSET @p """); } @@ -707,21 +707,21 @@ public override async Task Terminating_ElementAtAsync() AssertSql( """ -@__p_0='1' +@p='1' SELECT b."Id", b."Name", b."Json" FROM "Blogs" AS b ORDER BY b."Id" NULLS FIRST -LIMIT 1 OFFSET @__p_0 +LIMIT 1 OFFSET @p """, // """ -@__p_0='3' +@p='3' SELECT b."Id", b."Name", b."Json" FROM "Blogs" AS b ORDER BY b."Id" NULLS FIRST -LIMIT 1 OFFSET @__p_0 +LIMIT 1 OFFSET @p """); } @@ -731,21 +731,21 @@ public override async Task Terminating_ElementAtOrDefault() AssertSql( """ -@__p_0='1' +@p='1' SELECT b."Id", b."Name", b."Json" FROM "Blogs" AS b ORDER BY b."Id" NULLS FIRST -LIMIT 1 OFFSET @__p_0 +LIMIT 1 OFFSET @p """, // """ -@__p_0='3' +@p='3' SELECT b."Id", b."Name", b."Json" FROM "Blogs" AS b ORDER BY b."Id" NULLS FIRST -LIMIT 1 OFFSET @__p_0 +LIMIT 1 OFFSET @p """); } @@ -755,21 +755,21 @@ public override async Task Terminating_ElementAtOrDefaultAsync() AssertSql( """ -@__p_0='1' +@p='1' SELECT b."Id", b."Name", b."Json" FROM "Blogs" AS b ORDER BY b."Id" NULLS FIRST -LIMIT 1 OFFSET @__p_0 +LIMIT 1 OFFSET @p """, // """ -@__p_0='3' +@p='3' SELECT b."Id", b."Name", b."Json" FROM "Blogs" AS b ORDER BY b."Id" NULLS FIRST -LIMIT 1 OFFSET @__p_0 +LIMIT 1 OFFSET @p """); } @@ -1372,10 +1372,10 @@ public override async Task Terminating_ExecuteUpdate() AssertSql( """ -@__suffix_0='Suffix' +@suffix='Suffix' UPDATE "Blogs" AS b -SET "Name" = COALESCE(b."Name", '') || @__suffix_0 +SET "Name" = COALESCE(b."Name", '') || @suffix WHERE b."Id" > 8 """, // @@ -1392,10 +1392,10 @@ public override async Task Terminating_ExecuteUpdateAsync() AssertSql( """ -@__suffix_0='Suffix' +@suffix='Suffix' UPDATE "Blogs" AS b -SET "Name" = COALESCE(b."Name", '') || @__suffix_0 +SET "Name" = COALESCE(b."Name", '') || @suffix WHERE b."Id" > 8 """, // @@ -1591,11 +1591,11 @@ public override async Task Contains_with_parameterized_collection() AssertSql( """ -@__ids_0={ '1', '2', '3' } (DbType = Object) +@ids={ '1', '2', '3' } (DbType = Object) SELECT b."Id", b."Name", b."Json" FROM "Blogs" AS b -WHERE b."Id" = ANY (@__ids_0) +WHERE b."Id" = ANY (@ids) """); } @@ -1778,12 +1778,12 @@ public override async Task Skip() AssertSql( """ -@__p_0='1' +@p='1' SELECT b."Id", b."Name", b."Json" FROM "Blogs" AS b ORDER BY b."Name" NULLS FIRST -OFFSET @__p_0 +OFFSET @p """); } @@ -1793,12 +1793,12 @@ public override async Task Take() AssertSql( """ -@__p_0='1' +@p='1' SELECT b."Id", b."Name", b."Json" FROM "Blogs" AS b ORDER BY b."Name" NULLS FIRST -LIMIT @__p_0 +LIMIT @p """); } @@ -1819,12 +1819,12 @@ public override async Task Two_captured_variables_in_same_lambda() AssertSql( """ -@__yes_0='yes' -@__no_1='no' +@yes='yes' +@no='no' SELECT CASE - WHEN b."Id" = 3 THEN @__yes_0 - ELSE @__no_1 + WHEN b."Id" = 3 THEN @yes + ELSE @no END FROM "Blogs" AS b """); @@ -1832,20 +1832,18 @@ ELSE @__no_1 public override async Task Two_captured_variables_in_different_lambdas() { - //Throws because the base startswith is uses a different case "Blog" vs "blog" and postgresql LIKE is case sensitive unlike SQL Server - //Base test fixed upstream for later versions - await Assert.ThrowsAsync(() => base.Two_captured_variables_in_different_lambdas()); + await base.Two_captured_variables_in_different_lambdas(); -// AssertSql( -// """ -//@__starts_0_startswith='Blog%' -//@__ends_1_endswith='%2' -// -//SELECT b."Id", b."Name", b."Json" -//FROM "Blogs" AS b -//WHERE b."Name" LIKE @__starts_0_startswith AND b."Name" LIKE @__ends_1_endswith -//LIMIT 2 -//"""); + AssertSql( + """ +@starts_startswith='Blog%' +@ends_endswith='%2' + +SELECT b."Id", b."Name", b."Json" +FROM "Blogs" AS b +WHERE b."Name" LIKE @starts_startswith AND b."Name" LIKE @ends_endswith +LIMIT 2 +"""); } public override async Task Same_captured_variable_twice_in_same_lambda() @@ -1854,12 +1852,12 @@ public override async Task Same_captured_variable_twice_in_same_lambda() AssertSql( """ -@__foo_0_startswith='X%' -@__foo_0_endswith='%X' +@foo_startswith='X%' +@foo_endswith='%X' SELECT b."Id", b."Name", b."Json" FROM "Blogs" AS b -WHERE b."Name" LIKE @__foo_0_startswith AND b."Name" LIKE @__foo_0_endswith +WHERE b."Name" LIKE @foo_startswith AND b."Name" LIKE @foo_endswith """); } @@ -1869,12 +1867,12 @@ public override async Task Same_captured_variable_twice_in_different_lambdas() AssertSql( """ -@__foo_0_startswith='X%' -@__foo_0_endswith='%X' +@foo_startswith='X%' +@foo_endswith='%X' SELECT b."Id", b."Name", b."Json" FROM "Blogs" AS b -WHERE b."Name" LIKE @__foo_0_startswith AND b."Name" LIKE @__foo_0_endswith +WHERE b."Name" LIKE @foo_startswith AND b."Name" LIKE @foo_endswith """); } @@ -1929,20 +1927,20 @@ public override async Task Multiple_queries_with_captured_variables() AssertSql( """ -@__id1_0='8' -@__id2_1='9' +@id1='8' +@id2='9' SELECT b."Id", b."Name", b."Json" FROM "Blogs" AS b -WHERE b."Id" = @__id1_0 OR b."Id" = @__id2_1 +WHERE b."Id" = @id1 OR b."Id" = @id2 """, // """ -@__id1_0='8' +@id1='8' SELECT b."Id", b."Name", b."Json" FROM "Blogs" AS b -WHERE b."Id" = @__id1_0 +WHERE b."Id" = @id1 LIMIT 2 """); } diff --git a/test/EFCore.PG.FunctionalTests/Query/PrecompiledSqlPregenerationQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/PrecompiledSqlPregenerationQueryNpgsqlTest.cs index 37958e5b0..21d3a2ac5 100644 --- a/test/EFCore.PG.FunctionalTests/Query/PrecompiledSqlPregenerationQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/PrecompiledSqlPregenerationQueryNpgsqlTest.cs @@ -33,11 +33,11 @@ public override async Task Non_nullable_value_type() AssertSql( """ -@__id_0='8' +@id='8' SELECT b."Id", b."Name" FROM "Blogs" AS b -WHERE b."Id" = @__id_0 +WHERE b."Id" = @id """); } @@ -47,11 +47,11 @@ public override async Task Nullable_value_type() AssertSql( """ -@__id_0='8' (Nullable = true) +@id='8' (Nullable = true) SELECT b."Id", b."Name" FROM "Blogs" AS b -WHERE b."Id" = @__id_0 +WHERE b."Id" = @id """); } @@ -61,11 +61,11 @@ public override async Task Nullable_reference_type() AssertSql( """ -@__name_0='bar' +@name='bar' SELECT b."Id", b."Name" FROM "Blogs" AS b -WHERE b."Name" = @__name_0 +WHERE b."Name" = @name """); } @@ -75,11 +75,11 @@ public override async Task Non_nullable_reference_type() AssertSql( """ -@__name_0='bar' (Nullable = false) +@name='bar' (Nullable = false) SELECT b."Id", b."Name" FROM "Blogs" AS b -WHERE b."Name" = @__name_0 +WHERE b."Name" = @name """); } @@ -89,12 +89,12 @@ public override async Task Nullable_and_non_nullable_value_types() AssertSql( """ -@__id1_0='8' (Nullable = true) -@__id2_1='9' +@id1='8' (Nullable = true) +@id2='9' SELECT b."Id", b."Name" FROM "Blogs" AS b -WHERE b."Id" = @__id1_0 OR b."Id" = @__id2_1 +WHERE b."Id" = @id1 OR b."Id" = @id2 """); } @@ -104,12 +104,12 @@ public override async Task Two_nullable_reference_types() AssertSql( """ -@__name1_0='foo' -@__name2_1='bar' +@name1='foo' +@name2='bar' SELECT b."Id", b."Name" FROM "Blogs" AS b -WHERE b."Name" = @__name1_0 OR b."Name" = @__name2_1 +WHERE b."Name" = @name1 OR b."Name" = @name2 """); } @@ -119,12 +119,12 @@ public override async Task Two_non_nullable_reference_types() AssertSql( """ -@__name1_0='foo' (Nullable = false) -@__name2_1='bar' (Nullable = false) +@name1='foo' (Nullable = false) +@name2='bar' (Nullable = false) SELECT b."Id", b."Name" FROM "Blogs" AS b -WHERE b."Name" = @__name1_0 OR b."Name" = @__name2_1 +WHERE b."Name" = @name1 OR b."Name" = @name2 """); } @@ -134,12 +134,12 @@ public override async Task Nullable_and_non_nullable_reference_types() AssertSql( """ -@__name1_0='foo' -@__name2_1='bar' (Nullable = false) +@name1='foo' +@name2='bar' (Nullable = false) SELECT b."Id", b."Name" FROM "Blogs" AS b -WHERE b."Name" = @__name1_0 OR b."Name" = @__name2_1 +WHERE b."Name" = @name1 OR b."Name" = @name2 """); } @@ -149,14 +149,14 @@ public override async Task Too_many_nullable_parameters_prevent_pregeneration() AssertSql( """ -@__name1_0='foo' -@__name2_1='bar' -@__name3_2='baz' -@__name4_3='baq' +@name1='foo' +@name2='bar' +@name3='baz' +@name4='baq' SELECT b."Id", b."Name" FROM "Blogs" AS b -WHERE b."Name" = @__name1_0 OR b."Name" = @__name2_1 OR b."Name" = @__name3_2 OR b."Name" = @__name4_3 +WHERE b."Name" = @name1 OR b."Name" = @name2 OR b."Name" = @name3 OR b."Name" = @name4 """); } @@ -166,14 +166,14 @@ public override async Task Many_non_nullable_parameters_do_not_prevent_pregenera AssertSql( """ -@__name1_0='foo' (Nullable = false) -@__name2_1='bar' (Nullable = false) -@__name3_2='baz' (Nullable = false) -@__name4_3='baq' (Nullable = false) +@name1='foo' (Nullable = false) +@name2='bar' (Nullable = false) +@name3='baz' (Nullable = false) +@name4='baq' (Nullable = false) SELECT b."Id", b."Name" FROM "Blogs" AS b -WHERE b."Name" = @__name1_0 OR b."Name" = @__name2_1 OR b."Name" = @__name3_2 OR b."Name" = @__name4_3 +WHERE b."Name" = @name1 OR b."Name" = @name2 OR b."Name" = @name3 OR b."Name" = @name4 """); } diff --git a/test/EFCore.PG.FunctionalTests/Query/PrimitiveCollectionsQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/PrimitiveCollectionsQueryNpgsqlTest.cs index 1fd148a09..0d76c0925 100644 --- a/test/EFCore.PG.FunctionalTests/Query/PrimitiveCollectionsQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/PrimitiveCollectionsQueryNpgsqlTest.cs @@ -18,7 +18,7 @@ public override async Task Inline_collection_of_ints_Contains(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE p."Int" IN (10, 999) """); @@ -30,7 +30,7 @@ public override async Task Inline_collection_of_nullable_ints_Contains(bool asyn AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE p."NullableInt" IN (10, 999) """); @@ -42,7 +42,7 @@ public override async Task Inline_collection_of_nullable_ints_Contains_null(bool AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE p."NullableInt" IS NULL OR p."NullableInt" = 999 """); @@ -61,7 +61,7 @@ public override async Task Inline_collection_Count_with_one_value(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE ( SELECT count(*)::int @@ -76,7 +76,7 @@ public override async Task Inline_collection_Count_with_two_values(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE ( SELECT count(*)::int @@ -91,7 +91,7 @@ public override async Task Inline_collection_Count_with_three_values(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE ( SELECT count(*)::int @@ -106,7 +106,7 @@ public override async Task Inline_collection_Contains_with_zero_values(bool asyn AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE FALSE """); @@ -118,7 +118,7 @@ public override async Task Inline_collection_Contains_with_one_value(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE p."Id" = 2 """); @@ -130,7 +130,7 @@ public override async Task Inline_collection_Contains_with_two_values(bool async AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE p."Id" IN (2, 999) """); @@ -142,7 +142,7 @@ public override async Task Inline_collection_Contains_with_three_values(bool asy AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE p."Id" IN (2, 999, 1000) """); @@ -154,12 +154,12 @@ public override async Task Inline_collection_Contains_with_all_parameters(bool a AssertSql( """ -@__i_0='2' -@__j_1='999' +@i='2' +@j='999' -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE p."Id" IN (@__i_0, @__j_1) +WHERE p."Id" IN (@i, @j) """); } @@ -169,11 +169,11 @@ public override async Task Inline_collection_Contains_with_constant_and_paramete AssertSql( """ -@__j_0='999' +@j='999' -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE p."Id" IN (2, @__j_0) +WHERE p."Id" IN (2, @j) """); } @@ -183,11 +183,11 @@ public override async Task Inline_collection_Contains_with_mixed_value_types(boo AssertSql( """ -@__i_0='11' +@i='11' -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE p."Int" IN (999, @__i_0, p."Id", p."Id" + p."Int") +WHERE p."Int" IN (999, @i, p."Id", p."Id" + p."Int") """); } @@ -197,11 +197,11 @@ public override async Task Inline_collection_List_Contains_with_mixed_value_type AssertSql( """ -@__i_0='11' +@i='11' -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE p."Int" IN (999, @__i_0, p."Id", p."Id" + p."Int") +WHERE p."Int" IN (999, @i, p."Id", p."Id" + p."Int") """); } @@ -211,7 +211,7 @@ public override async Task Inline_collection_Contains_as_Any_with_predicate(bool AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE p."Id" IN (2, 999) """); @@ -223,7 +223,7 @@ public override async Task Inline_collection_negated_Contains_as_All(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE p."Id" NOT IN (2, 999) """); @@ -235,7 +235,7 @@ public override async Task Inline_collection_Min_with_two_values(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE LEAST(30, p."Int") = 30 """); @@ -247,7 +247,7 @@ public override async Task Inline_collection_List_Min_with_two_values(bool async AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE LEAST(30, p."Int") = 30 """); @@ -259,7 +259,7 @@ public override async Task Inline_collection_Max_with_two_values(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE GREATEST(30, p."Int") = 30 """); @@ -271,7 +271,7 @@ public override async Task Inline_collection_List_Max_with_two_values(bool async AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE GREATEST(30, p."Int") = 30 """); @@ -283,11 +283,11 @@ public override async Task Inline_collection_Min_with_three_values(bool async) AssertSql( """ -@__i_0='25' +@i='25' -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE LEAST(30, p."Int", @__i_0) = 25 +WHERE LEAST(30, p."Int", @i) = 25 """); } @@ -297,11 +297,11 @@ public override async Task Inline_collection_List_Min_with_three_values(bool asy AssertSql( """ -@__i_0='25' +@i='25' -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE LEAST(30, p."Int", @__i_0) = 25 +WHERE LEAST(30, p."Int", @i) = 25 """); } @@ -311,11 +311,11 @@ public override async Task Inline_collection_Max_with_three_values(bool async) AssertSql( """ -@__i_0='35' +@i='35' -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE GREATEST(30, p."Int", @__i_0) = 35 +WHERE GREATEST(30, p."Int", @i) = 35 """); } @@ -325,11 +325,11 @@ public override async Task Inline_collection_List_Max_with_three_values(bool asy AssertSql( """ -@__i_0='35' +@i='35' -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE GREATEST(30, p."Int", @__i_0) = 35 +WHERE GREATEST(30, p."Int", @i) = 35 """); } @@ -339,11 +339,11 @@ public override async Task Inline_collection_of_nullable_value_type_Min(bool asy AssertSql( """ -@__i_0='25' (Nullable = true) +@i='25' (Nullable = true) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE LEAST(30, p."Int", @__i_0) = 25 +WHERE LEAST(30, p."Int", @i) = 25 """); } @@ -353,11 +353,11 @@ public override async Task Inline_collection_of_nullable_value_type_Max(bool asy AssertSql( """ -@__i_0='35' (Nullable = true) +@i='35' (Nullable = true) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE GREATEST(30, p."Int", @__i_0) = 35 +WHERE GREATEST(30, p."Int", @i) = 35 """); } @@ -367,7 +367,7 @@ public override async Task Inline_collection_of_nullable_value_type_with_null_Mi AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE LEAST(30, p."NullableInt", NULL) = 30 """); @@ -379,7 +379,7 @@ public override async Task Inline_collection_of_nullable_value_type_with_null_Ma AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE GREATEST(30, p."NullableInt", NULL) = 30 """); @@ -391,11 +391,11 @@ public override async Task Inline_collection_with_single_parameter_element_Conta AssertSql( """ -@__i_0='2' +@i='2' -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE p."Id" = @__i_0 +WHERE p."Id" = @i """); } @@ -405,13 +405,13 @@ public override async Task Inline_collection_with_single_parameter_element_Count AssertSql( """ -@__i_0='2' +@i='2' -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE ( SELECT count(*)::int - FROM (VALUES (@__i_0::int)) AS v("Value") + FROM (VALUES (@i::int)) AS v("Value") WHERE v."Value" > p."Id") = 1 """); } @@ -422,11 +422,11 @@ public override async Task Inline_collection_Contains_with_EF_Parameter(bool asy AssertSql( """ -@__p_0={ '2', '999', '1000' } (DbType = Object) +@p={ '2', '999', '1000' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE p."Id" = ANY (@__p_0) +WHERE p."Id" = ANY (@p) """); } @@ -436,13 +436,13 @@ public override async Task Inline_collection_Count_with_column_predicate_with_EF AssertSql( """ -@__p_0={ '2', '999', '1000' } (DbType = Object) +@p={ '2', '999', '1000' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE ( SELECT count(*)::int - FROM unnest(@__p_0) AS p0(value) + FROM unnest(@p) AS p0(value) WHERE p0.value > p."Id") = 2 """); } @@ -453,13 +453,13 @@ public override async Task Parameter_collection_Count(bool async) AssertSql( """ -@__ids_0={ '2', '999' } (DbType = Object) +@ids={ '2', '999' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE ( SELECT count(*)::int - FROM unnest(@__ids_0) AS i(value) + FROM unnest(@ids) AS i(value) WHERE i.value > p."Id") = 1 """); } @@ -470,19 +470,19 @@ public override async Task Parameter_collection_of_ints_Contains_int(bool async) AssertSql( """ -@__ints_0={ '10', '999' } (DbType = Object) +@ints={ '10', '999' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE p."Int" = ANY (@__ints_0) +WHERE p."Int" = ANY (@ints) """, // """ -@__ints_0={ '10', '999' } (DbType = Object) +@ints={ '10', '999' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE NOT (p."Int" = ANY (@__ints_0) AND p."Int" = ANY (@__ints_0) IS NOT NULL) +WHERE NOT (p."Int" = ANY (@ints) AND p."Int" = ANY (@ints) IS NOT NULL) """); } @@ -492,19 +492,19 @@ public override async Task Parameter_collection_HashSet_of_ints_Contains_int(boo AssertSql( """ -@__ints_0={ '10', '999' } (DbType = Object) +@ints={ '10', '999' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE p."Int" = ANY (@__ints_0) +WHERE p."Int" = ANY (@ints) """, // """ -@__ints_0={ '10', '999' } (DbType = Object) +@ints={ '10', '999' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE NOT (p."Int" = ANY (@__ints_0) AND p."Int" = ANY (@__ints_0) IS NOT NULL) +WHERE NOT (p."Int" = ANY (@ints) AND p."Int" = ANY (@ints) IS NOT NULL) """); } @@ -520,11 +520,35 @@ await AssertQuery( AssertSql( """ -@__enums_0={ '0', '3' } (DbType = Object) +@enums={ '0', '3' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE p."Enum" = ANY (@__enums_0) +WHERE p."Enum" = ANY (@enums) +"""); + } + + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public override async Task Parameter_collection_ImmutableArray_of_ints_Contains_int(bool async) + { + await base.Parameter_collection_ImmutableArray_of_ints_Contains_int(async); + + AssertSql( + """ +@ints={ '10', '999' } (Nullable = false) (DbType = Object) + +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" +FROM "PrimitiveCollectionsEntity" AS p +WHERE p."Int" = ANY (@ints) +""", + // + """ +@ints={ '10', '999' } (Nullable = false) (DbType = Object) + +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" +FROM "PrimitiveCollectionsEntity" AS p +WHERE NOT (p."Int" = ANY (@ints) AND p."Int" = ANY (@ints) IS NOT NULL) """); } @@ -534,19 +558,19 @@ public override async Task Parameter_collection_of_ints_Contains_nullable_int(bo AssertSql( """ -@__ints_0={ '10', '999' } (DbType = Object) +@ints={ '10', '999' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE p."NullableInt" = ANY (@__ints_0) OR (p."NullableInt" IS NULL AND array_position(@__ints_0, NULL) IS NOT NULL) +WHERE p."NullableInt" = ANY (@ints) OR (p."NullableInt" IS NULL AND array_position(@ints, NULL) IS NOT NULL) """, // """ -@__ints_0={ '10', '999' } (DbType = Object) +@ints={ '10', '999' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE NOT (p."NullableInt" = ANY (@__ints_0) AND p."NullableInt" = ANY (@__ints_0) IS NOT NULL) AND (p."NullableInt" IS NOT NULL OR array_position(@__ints_0, NULL) IS NULL) +WHERE NOT (p."NullableInt" = ANY (@ints) AND p."NullableInt" = ANY (@ints) IS NOT NULL) AND (p."NullableInt" IS NOT NULL OR array_position(@ints, NULL) IS NULL) """); } @@ -556,19 +580,19 @@ public override async Task Parameter_collection_of_nullable_ints_Contains_int(bo AssertSql( """ -@__nullableInts_0={ '10', '999' } (DbType = Object) +@nullableInts={ '10', '999' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE p."Int" = ANY (@__nullableInts_0) +WHERE p."Int" = ANY (@nullableInts) """, // """ -@__nullableInts_0={ '10', '999' } (DbType = Object) +@nullableInts={ '10', '999' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE NOT (p."Int" = ANY (@__nullableInts_0) AND p."Int" = ANY (@__nullableInts_0) IS NOT NULL) +WHERE NOT (p."Int" = ANY (@nullableInts) AND p."Int" = ANY (@nullableInts) IS NOT NULL) """); } @@ -578,19 +602,41 @@ public override async Task Parameter_collection_of_nullable_ints_Contains_nullab AssertSql( """ -@__nullableInts_0={ NULL, '999' } (DbType = Object) +@nullableInts={ NULL, '999' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE p."NullableInt" = ANY (@__nullableInts_0) OR (p."NullableInt" IS NULL AND array_position(@__nullableInts_0, NULL) IS NOT NULL) +WHERE p."NullableInt" = ANY (@nullableInts) OR (p."NullableInt" IS NULL AND array_position(@nullableInts, NULL) IS NOT NULL) """, // """ -@__nullableInts_0={ NULL, '999' } (DbType = Object) +@nullableInts={ NULL, '999' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE NOT (p."NullableInt" = ANY (@__nullableInts_0) AND p."NullableInt" = ANY (@__nullableInts_0) IS NOT NULL) AND (p."NullableInt" IS NOT NULL OR array_position(@__nullableInts_0, NULL) IS NULL) +WHERE NOT (p."NullableInt" = ANY (@nullableInts) AND p."NullableInt" = ANY (@nullableInts) IS NOT NULL) AND (p."NullableInt" IS NOT NULL OR array_position(@nullableInts, NULL) IS NULL) +"""); + } + + public override async Task Parameter_collection_of_structs_Contains_struct(bool async) + { + await base.Parameter_collection_of_structs_Contains_struct(async); + + AssertSql( + """ +@values={ '22', '33' } (DbType = Object) + +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" +FROM "PrimitiveCollectionsEntity" AS p +WHERE p."WrappedId" = ANY (@values) +""", + // + """ +@values={ '11', '44' } (DbType = Object) + +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" +FROM "PrimitiveCollectionsEntity" AS p +WHERE NOT (p."WrappedId" = ANY (@values) AND p."WrappedId" = ANY (@values) IS NOT NULL) """); } @@ -600,19 +646,19 @@ public override async Task Parameter_collection_of_strings_Contains_string(bool AssertSql( """ -@__strings_0={ '10', '999' } (DbType = Object) +@strings={ '10', '999' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE p."String" = ANY (@__strings_0) +WHERE p."String" = ANY (@strings) """, // """ -@__strings_0={ '10', '999' } (DbType = Object) +@strings={ '10', '999' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE NOT (p."String" = ANY (@__strings_0) AND p."String" = ANY (@__strings_0) IS NOT NULL) +WHERE NOT (p."String" = ANY (@strings) AND p."String" = ANY (@strings) IS NOT NULL) """); } @@ -622,19 +668,19 @@ public override async Task Parameter_collection_of_strings_Contains_nullable_str AssertSql( """ -@__strings_0={ '10', '999' } (DbType = Object) +@strings={ '10', '999' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE p."NullableString" = ANY (@__strings_0) OR (p."NullableString" IS NULL AND array_position(@__strings_0, NULL) IS NOT NULL) +WHERE p."NullableString" = ANY (@strings) OR (p."NullableString" IS NULL AND array_position(@strings, NULL) IS NOT NULL) """, // """ -@__strings_0={ '10', '999' } (DbType = Object) +@strings={ '10', '999' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE NOT (p."NullableString" = ANY (@__strings_0) AND p."NullableString" = ANY (@__strings_0) IS NOT NULL) AND (p."NullableString" IS NOT NULL OR array_position(@__strings_0, NULL) IS NULL) +WHERE NOT (p."NullableString" = ANY (@strings) AND p."NullableString" = ANY (@strings) IS NOT NULL) AND (p."NullableString" IS NOT NULL OR array_position(@strings, NULL) IS NULL) """); } @@ -644,19 +690,19 @@ public override async Task Parameter_collection_of_nullable_strings_Contains_str AssertSql( """ -@__strings_0={ '10', NULL } (DbType = Object) +@strings={ '10', NULL } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE p."String" = ANY (@__strings_0) +WHERE p."String" = ANY (@strings) """, // """ -@__strings_0={ '10', NULL } (DbType = Object) +@strings={ '10', NULL } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE NOT (p."String" = ANY (@__strings_0) AND p."String" = ANY (@__strings_0) IS NOT NULL) +WHERE NOT (p."String" = ANY (@strings) AND p."String" = ANY (@strings) IS NOT NULL) """); } @@ -666,19 +712,19 @@ public override async Task Parameter_collection_of_nullable_strings_Contains_nul AssertSql( """ -@__strings_0={ '999', NULL } (DbType = Object) +@strings={ '999', NULL } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE p."NullableString" = ANY (@__strings_0) OR (p."NullableString" IS NULL AND array_position(@__strings_0, NULL) IS NOT NULL) +WHERE p."NullableString" = ANY (@strings) OR (p."NullableString" IS NULL AND array_position(@strings, NULL) IS NOT NULL) """, // """ -@__strings_0={ '999', NULL } (DbType = Object) +@strings={ '999', NULL } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE NOT (p."NullableString" = ANY (@__strings_0) AND p."NullableString" = ANY (@__strings_0) IS NOT NULL) AND (p."NullableString" IS NOT NULL OR array_position(@__strings_0, NULL) IS NULL) +WHERE NOT (p."NullableString" = ANY (@strings) AND p."NullableString" = ANY (@strings) IS NOT NULL) AND (p."NullableString" IS NOT NULL OR array_position(@strings, NULL) IS NULL) """); } @@ -688,11 +734,11 @@ public override async Task Parameter_collection_of_DateTimes_Contains(bool async AssertSql( """ -@__dateTimes_0={ '2020-01-10T12:30:00.0000000Z', '9999-01-01T00:00:00.0000000Z' } (DbType = Object) +@dateTimes={ '2020-01-10T12:30:00.0000000Z', '9999-01-01T00:00:00.0000000Z' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE p."DateTime" = ANY (@__dateTimes_0) +WHERE p."DateTime" = ANY (@dateTimes) """); } @@ -702,11 +748,11 @@ public override async Task Parameter_collection_of_bools_Contains(bool async) AssertSql( """ -@__bools_0={ 'True' } (DbType = Object) +@bools={ 'True' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE p."Bool" = ANY (@__bools_0) +WHERE p."Bool" = ANY (@bools) """); } @@ -716,11 +762,11 @@ public override async Task Parameter_collection_of_enums_Contains(bool async) AssertSql( """ -@__enums_0={ '0', '3' } (DbType = Object) +@enums={ '0', '3' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE p."Enum" = ANY (@__enums_0) +WHERE p."Enum" = ANY (@enums) """); } @@ -730,7 +776,7 @@ public override async Task Parameter_collection_null_Contains(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE p."Int" = ANY (NULL) """); @@ -742,7 +788,7 @@ public override async Task Parameter_collection_Contains_with_EF_Constant(bool a AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE p."Id" IN (2, 999, 1000) """); @@ -754,7 +800,7 @@ public override async Task Parameter_collection_Where_with_EF_Constant_Where_Any AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE EXISTS ( SELECT 1 @@ -769,7 +815,7 @@ public override async Task Parameter_collection_Count_with_column_predicate_with AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE ( SELECT count(*)::int @@ -796,11 +842,11 @@ await AssertQuery( AssertSql( """ -@__ranges_0={ '[5,15]', '[40,50]' } (DbType = Object) +@ranges={ '[5,15]', '[40,50]' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE @__ranges_0 @> p."Int" +WHERE @ranges @> p."Int" """); } @@ -810,7 +856,7 @@ public override async Task Column_collection_of_ints_Contains(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE p."Ints" @> ARRAY[10]::integer[] """); @@ -822,7 +868,7 @@ public override async Task Column_collection_of_nullable_ints_Contains(bool asyn AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE p."NullableInts" @> ARRAY[10]::integer[] """); @@ -834,7 +880,7 @@ public override async Task Column_collection_of_nullable_ints_Contains_null(bool AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE array_position(p."NullableInts", NULL) IS NOT NULL """); @@ -846,7 +892,7 @@ public override async Task Column_collection_of_strings_contains_null(bool async AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE array_position(p."Strings", NULL) IS NOT NULL """); @@ -858,7 +904,7 @@ public override async Task Column_collection_of_nullable_strings_contains_null(b AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE array_position(p."NullableStrings", NULL) IS NOT NULL """); @@ -870,7 +916,7 @@ public override async Task Column_collection_of_bools_Contains(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE p."Bools" @> ARRAY[TRUE]::boolean[] """); @@ -882,7 +928,7 @@ public override async Task Column_collection_Count_method(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE cardinality(p."Ints") = 2 """); @@ -894,7 +940,7 @@ public override async Task Column_collection_Length(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE cardinality(p."Ints") = 2 """); @@ -906,7 +952,7 @@ public override async Task Column_collection_Count_with_predicate(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE ( SELECT count(*)::int @@ -921,7 +967,7 @@ public override async Task Column_collection_Where_Count(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE ( SELECT count(*)::int @@ -936,7 +982,7 @@ public override async Task Column_collection_index_int(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE p."Ints"[2] = 10 """); @@ -948,7 +994,7 @@ public override async Task Column_collection_index_string(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE p."Strings"[2] = '10' """); @@ -960,7 +1006,7 @@ public override async Task Column_collection_index_datetime(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE p."DateTimes"[2] = TIMESTAMPTZ '2020-01-10T12:30:00Z' """); @@ -972,7 +1018,7 @@ public override async Task Column_collection_index_beyond_end(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE p."Ints"[1000] = 10 """); @@ -984,7 +1030,7 @@ public override async Task Nullable_reference_column_collection_index_equals_nul AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE p."NullableStrings"[3] = p."NullableString" OR (p."NullableStrings"[3] IS NULL AND p."NullableString" IS NULL) """); @@ -996,7 +1042,7 @@ public override async Task Non_nullable_reference_column_collection_index_equals AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE cardinality(p."Strings") > 0 AND p."Strings"[2] = p."NullableString" """); @@ -1008,7 +1054,7 @@ public override async Task Inline_collection_index_Column(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE ( SELECT v."Value" @@ -1024,7 +1070,7 @@ public override async Task Inline_collection_value_index_Column(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE ( SELECT v."Value" @@ -1040,7 +1086,7 @@ public override async Task Inline_collection_List_value_index_Column(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE ( SELECT v."Value" @@ -1056,11 +1102,11 @@ public override async Task Parameter_collection_index_Column_equal_Column(bool a AssertSql( """ -@__ints_0={ '0', '2', '3' } (DbType = Object) +@ints={ '0', '2', '3' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE @__ints_0[p."Int" + 1] = p."Int" +WHERE @ints[p."Int" + 1] = p."Int" """); } @@ -1070,11 +1116,11 @@ public override async Task Parameter_collection_index_Column_equal_constant(bool AssertSql( """ -@__ints_0={ '1', '2', '3' } (DbType = Object) +@ints={ '1', '2', '3' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE @__ints_0[p."Int" + 1] = 1 +WHERE @ints[p."Int" + 1] = 1 """); } @@ -1084,7 +1130,7 @@ public override async Task Column_collection_ElementAt(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE p."Ints"[2] = 10 """); @@ -1096,7 +1142,7 @@ public override async Task Column_collection_First(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE ( SELECT i.value @@ -1111,7 +1157,7 @@ public override async Task Column_collection_FirstOrDefault(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE COALESCE(( SELECT i.value @@ -1126,7 +1172,7 @@ public override async Task Column_collection_Single(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE ( SELECT i.value @@ -1141,7 +1187,7 @@ public override async Task Column_collection_SingleOrDefault(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE COALESCE(( SELECT i.value @@ -1156,7 +1202,7 @@ public override async Task Column_collection_Skip(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE cardinality(p."Ints"[2:]) = 2 """); @@ -1168,7 +1214,7 @@ public override async Task Column_collection_Take(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE 11 = ANY (p."Ints"[:2]) """); @@ -1180,7 +1226,7 @@ public override async Task Column_collection_Skip_Take(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE 11 = ANY (p."Ints"[2:3]) """); @@ -1192,7 +1238,7 @@ public override async Task Column_collection_Where_Skip(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE ( SELECT count(*)::int @@ -1211,7 +1257,7 @@ public override async Task Column_collection_Where_Take(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE ( SELECT count(*)::int @@ -1230,7 +1276,7 @@ public override async Task Column_collection_Where_Skip_Take(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE ( SELECT count(*)::int @@ -1249,7 +1295,7 @@ public override async Task Column_collection_Contains_over_subquery(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE 11 IN ( SELECT i.value @@ -1265,7 +1311,7 @@ public override async Task Column_collection_OrderByDescending_ElementAt(bool as AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE ( SELECT i.value @@ -1281,7 +1327,7 @@ public override async Task Column_collection_Where_ElementAt(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE ( SELECT i.value @@ -1297,7 +1343,7 @@ public override async Task Column_collection_Any(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE cardinality(p."Ints") > 0 """); @@ -1309,7 +1355,7 @@ public override async Task Column_collection_Distinct(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE ( SELECT count(*)::int @@ -1378,14 +1424,14 @@ public override async Task Column_collection_Join_parameter_collection(bool asyn AssertSql( """ -@__ints_0={ '11', '111' } (DbType = Object) +@ints={ '11', '111' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE ( SELECT count(*)::int FROM unnest(p."Ints") AS i(value) - INNER JOIN unnest(@__ints_0) AS i0(value) ON i.value = i0.value) = 2 + INNER JOIN unnest(@ints) AS i0(value) ON i.value = i0.value) = 2 """); } @@ -1395,7 +1441,7 @@ public override async Task Inline_collection_Join_ordered_column_collection(bool AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE ( SELECT count(*)::int @@ -1410,11 +1456,11 @@ public override async Task Parameter_collection_Concat_column_collection(bool as AssertSql( """ -@__ints_0={ '11', '111' } (DbType = Object) +@ints={ '11', '111' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE cardinality(@__ints_0 || p."Ints") = 2 +WHERE cardinality(@ints || p."Ints") = 2 """); } @@ -1424,10 +1470,10 @@ public override async Task Parameter_collection_with_type_inference_for_JsonScal AssertSql( """ -@__values_0={ 'one', 'two' } (DbType = Object) +@values={ 'one', 'two' } (DbType = Object) SELECT CASE - WHEN p."Id" <> 0 THEN @__values_0[p."Int" % 2 + 1] + WHEN p."Id" <> 0 THEN @values[p."Int" % 2 + 1] ELSE 'foo' END FROM "PrimitiveCollectionsEntity" AS p @@ -1440,9 +1486,9 @@ public override async Task Column_collection_Union_parameter_collection(bool asy AssertSql( """ -@__ints_0={ '11', '111' } (DbType = Object) +@ints={ '11', '111' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE ( SELECT count(*)::int @@ -1451,7 +1497,7 @@ SELECT i.value FROM unnest(p."Ints") AS i(value) UNION SELECT i0.value - FROM unnest(@__ints_0) AS i0(value) + FROM unnest(@ints) AS i0(value) ) AS u) = 2 """); } @@ -1462,7 +1508,7 @@ public override async Task Column_collection_Intersect_inline_collection(bool as AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE ( SELECT count(*)::int @@ -1487,11 +1533,11 @@ await AssertQuery( AssertSql( """ -@__ints_0={ '11', '12' } (DbType = Object) +@ints={ '11', '12' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE p."Ints" && @__ints_0 +WHERE p."Ints" && @ints """); } @@ -1501,7 +1547,7 @@ public override async Task Inline_collection_Except_column_collection(bool async AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE ( SELECT count(*)::int @@ -1522,7 +1568,7 @@ public override async Task Column_collection_Where_Union(bool async) AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE ( SELECT count(*)::int @@ -1549,12 +1595,12 @@ await AssertQuery( AssertSql( """ -@__ints1_0={ '11' } (DbType = Object) -@__ints2_1={ '12' } (DbType = Object) +@ints1={ '11' } (DbType = Object) +@ints2={ '12' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE cardinality(@__ints1_0 || p."Ints" || @__ints2_1) = 4 +WHERE cardinality(@ints1 || p."Ints" || @ints2) = 4 """); } @@ -1571,11 +1617,11 @@ public override async Task Column_collection_equality_parameter_collection(bool AssertSql( """ -@__ints_0={ '1', '10' } (DbType = Object) +@ints={ '1', '10' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE p."Ints" = @__ints_0 +WHERE p."Ints" = @ints """); } @@ -1585,7 +1631,7 @@ public override async Task Column_collection_equality_inline_collection(bool asy AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE p."Ints" = ARRAY[1,10]::integer[] """); @@ -1602,12 +1648,12 @@ await AssertQuery( AssertSql( """ -@__i_0='1' -@__j_1='10' +@i='1' +@j='10' -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p -WHERE p."Ints" = ARRAY[@__i_0,@__j_1]::integer[] +WHERE p."Ints" = ARRAY[@i,@j]::integer[] """); } @@ -1624,15 +1670,15 @@ public override async Task Parameter_collection_in_subquery_Union_column_collect AssertSql( """ -@__ints={ '10', '111' } (DbType = Object) +@ints={ '10', '111' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE ( SELECT count(*)::int FROM ( SELECT i.value - FROM unnest(@__ints[2:]) AS i(value) + FROM unnest(@ints[2:]) AS i(value) UNION SELECT i0.value FROM unnest(p."Ints") AS i0(value) @@ -1646,15 +1692,15 @@ public override async Task Parameter_collection_in_subquery_Union_column_collect AssertSql( """ -@__Skip_0={ '111' } (DbType = Object) +@Skip={ '111' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE ( SELECT count(*)::int FROM ( SELECT s.value - FROM unnest(@__Skip_0) AS s(value) + FROM unnest(@Skip) AS s(value) UNION SELECT i.value FROM unnest(p."Ints") AS i(value) @@ -1668,15 +1714,15 @@ public override async Task Parameter_collection_in_subquery_Union_column_collect AssertSql( """ -@__Skip_0={ '111' } (DbType = Object) +@Skip={ '111' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE ( SELECT count(*)::int FROM ( SELECT s.value - FROM unnest(@__Skip_0) AS s(value) + FROM unnest(@Skip) AS s(value) UNION SELECT i2.value FROM ( @@ -1717,13 +1763,13 @@ public override async Task Parameter_collection_in_subquery_Count_as_compiled_qu AssertSql( """ -@__ints={ '10', '111' } (DbType = Object) +@ints={ '10', '111' } (DbType = Object) SELECT count(*)::int FROM "PrimitiveCollectionsEntity" AS p WHERE ( SELECT count(*)::int - FROM unnest(@__ints[2:]) AS i(value) + FROM unnest(@ints[2:]) AS i(value) WHERE i.value > p."Id") = 1 """); } @@ -1734,9 +1780,9 @@ public override async Task Column_collection_in_subquery_Union_parameter_collect AssertSql( """ -@__ints_0={ '10', '111' } (DbType = Object) +@ints={ '10', '111' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE ( SELECT count(*)::int @@ -1745,7 +1791,7 @@ SELECT i.value FROM unnest(p."Ints"[2:]) AS i(value) UNION SELECT i0.value - FROM unnest(@__ints_0) AS i0(value) + FROM unnest(@ints) AS i0(value) ) AS u) = 3 """); } @@ -1997,15 +2043,15 @@ public override async Task Nested_contains_with_Lists_and_no_inferred_type_mappi AssertSql( """ -@__ints_0={ '1', '2', '3' } (DbType = Object) -@__strings_1={ 'one', 'two', 'three' } (DbType = Object) +@ints={ '1', '2', '3' } (DbType = Object) +@strings={ 'one', 'two', 'three' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE CASE - WHEN p."Int" = ANY (@__ints_0) THEN 'one' + WHEN p."Int" = ANY (@ints) THEN 'one' ELSE 'two' -END = ANY (@__strings_1) +END = ANY (@strings) """); } @@ -2015,15 +2061,15 @@ public override async Task Nested_contains_with_arrays_and_no_inferred_type_mapp AssertSql( """ -@__ints_0={ '1', '2', '3' } (DbType = Object) -@__strings_1={ 'one', 'two', 'three' } (DbType = Object) +@ints={ '1', '2', '3' } (DbType = Object) +@strings={ 'one', 'two', 'three' } (DbType = Object) -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE CASE - WHEN p."Int" = ANY (@__ints_0) THEN 'one' + WHEN p."Int" = ANY (@ints) THEN 'one' ELSE 'two' -END = ANY (@__strings_1) +END = ANY (@strings) """); } @@ -2038,12 +2084,86 @@ await AssertQuery( AssertSql( """ -SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."String", p."Strings" +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p WHERE cardinality(array_remove(p."Ints", 1)) = 1 """); } + public override async Task Parameter_collection_of_structs_Contains_nullable_struct(bool async) + { + await base.Parameter_collection_of_structs_Contains_nullable_struct(async); + + AssertSql( + """ +@values={ '22', '33' } (DbType = Object) + +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" +FROM "PrimitiveCollectionsEntity" AS p +WHERE p."NullableWrappedId" = ANY (@values) OR (p."NullableWrappedId" IS NULL AND array_position(@values, NULL) IS NOT NULL) +""", + // + """ +@values={ '11', '44' } (DbType = Object) + +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" +FROM "PrimitiveCollectionsEntity" AS p +WHERE NOT (p."NullableWrappedId" = ANY (@values) AND p."NullableWrappedId" = ANY (@values) IS NOT NULL) AND (p."NullableWrappedId" IS NOT NULL OR array_position(@values, NULL) IS NULL) +"""); + } + + public override Task Parameter_collection_of_structs_Contains_nullable_struct_with_nullable_comparer(bool async) + => Assert.ThrowsAnyAsync( + () => base.Parameter_collection_of_structs_Contains_nullable_struct_with_nullable_comparer(async)); + + public override async Task Parameter_collection_of_nullable_structs_Contains_struct(bool async) + { + await base.Parameter_collection_of_nullable_structs_Contains_struct(async); + + AssertSql( + """ +@values={ NULL, '22' } (DbType = Object) + +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" +FROM "PrimitiveCollectionsEntity" AS p +WHERE p."WrappedId" = ANY (@values) +""", + // + """ +@values={ '11', '44' } (DbType = Object) + +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" +FROM "PrimitiveCollectionsEntity" AS p +WHERE NOT (p."WrappedId" = ANY (@values) AND p."WrappedId" = ANY (@values) IS NOT NULL) +"""); + } + + public override async Task Parameter_collection_of_nullable_structs_Contains_nullable_struct(bool async) + { + await base.Parameter_collection_of_nullable_structs_Contains_nullable_struct(async); + + AssertSql( + """ +@values={ NULL, '22' } (DbType = Object) + +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" +FROM "PrimitiveCollectionsEntity" AS p +WHERE p."NullableWrappedId" = ANY (@values) OR (p."NullableWrappedId" IS NULL AND array_position(@values, NULL) IS NOT NULL) +""", + // + """ +@values={ '11', '44' } (DbType = Object) + +SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" +FROM "PrimitiveCollectionsEntity" AS p +WHERE NOT (p."NullableWrappedId" = ANY (@values) AND p."NullableWrappedId" = ANY (@values) IS NOT NULL) AND (p."NullableWrappedId" IS NOT NULL OR array_position(@values, NULL) IS NULL) +"""); + } + + public override Task Parameter_collection_of_nullable_structs_Contains_nullable_struct_with_nullable_comparer(bool async) + => Assert.ThrowsAnyAsync( + () => base.Parameter_collection_of_nullable_structs_Contains_nullable_struct_with_nullable_comparer(async)); + [ConditionalFact] public virtual void Check_all_tests_overridden() => TestHelpers.AssertAllMethodsOverridden(GetType()); diff --git a/test/EFCore.PG.FunctionalTests/Query/RangeQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/RangeQueryNpgsqlTest.cs index 29772f60e..6fe12c0f5 100644 --- a/test/EFCore.PG.FunctionalTests/Query/RangeQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/RangeQueryNpgsqlTest.cs @@ -48,11 +48,11 @@ public void Contains_range() AssertSql( """ -@__range_0='[8,13]' (DbType = Object) +@range='[8,13]' (DbType = Object) SELECT r."Id", r."DateOnlyDateRange", r."DateTimeDateRange", r."DecimalRange", r."IntRange", r."LongRange", r."UserDefinedRange", r."UserDefinedRangeWithSchema" FROM "RangeTestEntities" AS r -WHERE r."IntRange" @> @__range_0 +WHERE r."IntRange" @> @range LIMIT 2 """); } @@ -67,11 +67,11 @@ public void ContainedBy() AssertSql( """ -@__range_0='[8,13]' (DbType = Object) +@range='[8,13]' (DbType = Object) SELECT r."Id", r."DateOnlyDateRange", r."DateTimeDateRange", r."DecimalRange", r."IntRange", r."LongRange", r."UserDefinedRange", r."UserDefinedRangeWithSchema" FROM "RangeTestEntities" AS r -WHERE @__range_0 <@ r."IntRange" +WHERE @range <@ r."IntRange" LIMIT 2 """); } @@ -86,11 +86,11 @@ public void Equals_operator() AssertSql( """ -@__range_0='[1,10]' (DbType = Object) +@range='[1,10]' (DbType = Object) SELECT r."Id", r."DateOnlyDateRange", r."DateTimeDateRange", r."DecimalRange", r."IntRange", r."LongRange", r."UserDefinedRange", r."UserDefinedRangeWithSchema" FROM "RangeTestEntities" AS r -WHERE r."IntRange" = @__range_0 +WHERE r."IntRange" = @range LIMIT 2 """); } @@ -105,11 +105,11 @@ public void Equals_method() AssertSql( """ -@__range_0='[1,10]' (DbType = Object) +@range='[1,10]' (DbType = Object) SELECT r."Id", r."DateOnlyDateRange", r."DateTimeDateRange", r."DecimalRange", r."IntRange", r."LongRange", r."UserDefinedRange", r."UserDefinedRangeWithSchema" FROM "RangeTestEntities" AS r -WHERE r."IntRange" = @__range_0 +WHERE r."IntRange" = @range LIMIT 2 """); } @@ -124,11 +124,11 @@ public void Overlaps_range() AssertSql( """ -@__range_0='[-5,4]' (DbType = Object) +@range='[-5,4]' (DbType = Object) SELECT r."Id", r."DateOnlyDateRange", r."DateTimeDateRange", r."DecimalRange", r."IntRange", r."LongRange", r."UserDefinedRange", r."UserDefinedRangeWithSchema" FROM "RangeTestEntities" AS r -WHERE r."IntRange" && @__range_0 +WHERE r."IntRange" && @range LIMIT 2 """); } @@ -143,11 +143,11 @@ public void IsStrictlyLeftOf_range() AssertSql( """ -@__range_0='[11,15]' (DbType = Object) +@range='[11,15]' (DbType = Object) SELECT r."Id", r."DateOnlyDateRange", r."DateTimeDateRange", r."DecimalRange", r."IntRange", r."LongRange", r."UserDefinedRange", r."UserDefinedRangeWithSchema" FROM "RangeTestEntities" AS r -WHERE r."IntRange" << @__range_0 +WHERE r."IntRange" << @range LIMIT 2 """); } @@ -162,11 +162,11 @@ public void IsStrictlyRightOf_range() AssertSql( """ -@__range_0='[0,4]' (DbType = Object) +@range='[0,4]' (DbType = Object) SELECT r."Id", r."DateOnlyDateRange", r."DateTimeDateRange", r."DecimalRange", r."IntRange", r."LongRange", r."UserDefinedRange", r."UserDefinedRangeWithSchema" FROM "RangeTestEntities" AS r -WHERE r."IntRange" >> @__range_0 +WHERE r."IntRange" >> @range LIMIT 2 """); } @@ -181,11 +181,11 @@ public void DoesNotExtendLeftOf() AssertSql( """ -@__range_0='[2,20]' (DbType = Object) +@range='[2,20]' (DbType = Object) SELECT r."Id", r."DateOnlyDateRange", r."DateTimeDateRange", r."DecimalRange", r."IntRange", r."LongRange", r."UserDefinedRange", r."UserDefinedRangeWithSchema" FROM "RangeTestEntities" AS r -WHERE @__range_0 &> r."IntRange" +WHERE @range &> r."IntRange" LIMIT 2 """); } @@ -200,11 +200,11 @@ public void DoesNotExtendRightOf() AssertSql( """ -@__range_0='[1,13]' (DbType = Object) +@range='[1,13]' (DbType = Object) SELECT r."Id", r."DateOnlyDateRange", r."DateTimeDateRange", r."DecimalRange", r."IntRange", r."LongRange", r."UserDefinedRange", r."UserDefinedRangeWithSchema" FROM "RangeTestEntities" AS r -WHERE @__range_0 &< r."IntRange" +WHERE @range &< r."IntRange" LIMIT 2 """); } @@ -219,11 +219,11 @@ public void IsAdjacentTo() AssertSql( """ -@__range_0='[2,4]' (DbType = Object) +@range='[2,4]' (DbType = Object) SELECT r."Id", r."DateOnlyDateRange", r."DateTimeDateRange", r."DecimalRange", r."IntRange", r."LongRange", r."UserDefinedRange", r."UserDefinedRangeWithSchema" FROM "RangeTestEntities" AS r -WHERE @__range_0 -|- r."IntRange" +WHERE @range -|- r."IntRange" LIMIT 2 """); } @@ -238,11 +238,11 @@ public void Union() AssertSql( """ -@__range_0='[-2,7]' (DbType = Object) +@range='[-2,7]' (DbType = Object) SELECT r."Id", r."DateOnlyDateRange", r."DateTimeDateRange", r."DecimalRange", r."IntRange", r."LongRange", r."UserDefinedRange", r."UserDefinedRangeWithSchema" FROM "RangeTestEntities" AS r -WHERE r."IntRange" + @__range_0 = '[-2,10]'::int4range +WHERE r."IntRange" + @range = '[-2,10]'::int4range LIMIT 2 """); } @@ -284,11 +284,11 @@ public void Intersect() AssertSql( """ -@__range_0='[-2,3]' (DbType = Object) +@range='[-2,3]' (DbType = Object) SELECT r."Id", r."DateOnlyDateRange", r."DateTimeDateRange", r."DecimalRange", r."IntRange", r."LongRange", r."UserDefinedRange", r."UserDefinedRangeWithSchema" FROM "RangeTestEntities" AS r -WHERE r."IntRange" * @__range_0 = '[1,3]'::int4range +WHERE r."IntRange" * @range = '[1,3]'::int4range LIMIT 2 """); } @@ -330,11 +330,11 @@ public void Except() AssertSql( """ -@__range_0='[1,2]' (DbType = Object) +@range='[1,2]' (DbType = Object) SELECT r."Id", r."DateOnlyDateRange", r."DateTimeDateRange", r."DecimalRange", r."IntRange", r."LongRange", r."UserDefinedRange", r."UserDefinedRangeWithSchema" FROM "RangeTestEntities" AS r -WHERE r."IntRange" - @__range_0 = '[3,10]'::int4range +WHERE r."IntRange" - @range = '[3,10]'::int4range LIMIT 2 """); } @@ -497,11 +497,11 @@ public void LongRange() AssertSql( """ -@__p_0='3' +@p='3' SELECT r."Id", r."DateOnlyDateRange", r."DateTimeDateRange", r."DecimalRange", r."IntRange", r."LongRange", r."UserDefinedRange", r."UserDefinedRangeWithSchema" FROM "RangeTestEntities" AS r -WHERE r."LongRange" @> @__p_0 +WHERE r."LongRange" @> @p LIMIT 2 """); } @@ -516,11 +516,11 @@ public void DecimalRange() AssertSql( """ -@__p_0='3' +@p='3' SELECT r."Id", r."DateOnlyDateRange", r."DateTimeDateRange", r."DecimalRange", r."IntRange", r."LongRange", r."UserDefinedRange", r."UserDefinedRangeWithSchema" FROM "RangeTestEntities" AS r -WHERE r."DecimalRange" @> @__p_0 +WHERE r."DecimalRange" @> @p LIMIT 2 """); } @@ -535,11 +535,11 @@ public void Daterange_DateOnly() AssertSql( """ -@__value_0='01/03/2020' (DbType = Date) +@value='01/03/2020' (DbType = Date) SELECT r."Id", r."DateOnlyDateRange", r."DateTimeDateRange", r."DecimalRange", r."IntRange", r."LongRange", r."UserDefinedRange", r."UserDefinedRangeWithSchema" FROM "RangeTestEntities" AS r -WHERE r."DateOnlyDateRange" @> @__value_0 +WHERE r."DateOnlyDateRange" @> @value LIMIT 2 """); } @@ -554,11 +554,11 @@ public void Daterange_DateTime() AssertSql( """ -@__value_0='2020-01-03T00:00:00.0000000' +@value='2020-01-03T00:00:00.0000000' SELECT r."Id", r."DateOnlyDateRange", r."DateTimeDateRange", r."DecimalRange", r."IntRange", r."LongRange", r."UserDefinedRange", r."UserDefinedRangeWithSchema" FROM "RangeTestEntities" AS r -WHERE r."DateTimeDateRange" @> @__value_0 +WHERE r."DateTimeDateRange" @> @value LIMIT 2 """); } diff --git a/test/EFCore.PG.FunctionalTests/Query/SpatialQueryNpgsqlGeographyTest.cs b/test/EFCore.PG.FunctionalTests/Query/SpatialQueryNpgsqlGeographyTest.cs index 8508607b7..e7f0505e5 100644 --- a/test/EFCore.PG.FunctionalTests/Query/SpatialQueryNpgsqlGeographyTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/SpatialQueryNpgsqlGeographyTest.cs @@ -113,10 +113,10 @@ await AssertQuery( AssertSql( $""" -@__point_1='POINT (0 1)' (DbType = Object) -@__useSpheroid_2='{useSpheroid}' +@point='POINT (0 1)' (DbType = Object) +@useSpheroid='{useSpheroid}' -SELECT p."Id", ST_Distance(p."Point", @__point_1, @__useSpheroid_2) AS "Distance" +SELECT p."Id", ST_Distance(p."Point", @point, @useSpheroid) AS "Distance" FROM "PointEntity" AS p """); } @@ -141,9 +141,9 @@ await AssertQuery( AssertSql( """ -@__point_1='POINT (0 1)' (DbType = Object) +@point='POINT (0 1)' (DbType = Object) -SELECT p."Id", p."Point" <-> @__point_1 AS "Distance" +SELECT p."Id", p."Point" <-> @point AS "Distance" FROM "PointEntity" AS p """); } @@ -173,9 +173,9 @@ public override async Task Intersection(bool async) AssertSql( """ -@__polygon_0='POLYGON ((0 0, 1 0, 1 1, 0 0))' (DbType = Object) +@polygon='POLYGON ((0 0, 1 0, 1 1, 0 0))' (DbType = Object) -SELECT p."Id", ST_Intersection(p."Polygon", @__polygon_0) AS "Intersection" +SELECT p."Id", ST_Intersection(p."Polygon", @polygon) AS "Intersection" FROM "PolygonEntity" AS p """); } @@ -186,9 +186,9 @@ public override async Task Intersects(bool async) AssertSql( """ -@__lineString_0='LINESTRING (0.5 -0.5, 0.5 0.5)' (DbType = Object) +@lineString='LINESTRING (0.5 -0.5, 0.5 0.5)' (DbType = Object) -SELECT l."Id", ST_Intersects(l."LineString", @__lineString_0) AS "Intersects" +SELECT l."Id", ST_Intersects(l."LineString", @lineString) AS "Intersects" FROM "LineStringEntity" AS l """); } @@ -199,9 +199,9 @@ public override async Task IsWithinDistance(bool async) AssertSql( """ -@__point_0='POINT (0 1)' (DbType = Object) +@point='POINT (0 1)' (DbType = Object) -SELECT p."Id", ST_DWithin(p."Point", @__point_0, 1.0) AS "IsWithinDistance" +SELECT p."Id", ST_DWithin(p."Point", @point, 1.0) AS "IsWithinDistance" FROM "PointEntity" AS p """); } @@ -235,10 +235,10 @@ await AssertQuery( AssertSql( $""" -@__point_1='POINT (0 1)' (DbType = Object) -@__useSpheroid_2='{useSpheroid}' +@point='POINT (0 1)' (DbType = Object) +@useSpheroid='{useSpheroid}' -SELECT p."Id", ST_DWithin(p."Point", @__point_1, 1.0, @__useSpheroid_2) AS "IsWithinDistance" +SELECT p."Id", ST_DWithin(p."Point", @point, 1.0, @useSpheroid) AS "IsWithinDistance" FROM "PointEntity" AS p """); } diff --git a/test/EFCore.PG.FunctionalTests/Query/SpatialQueryNpgsqlGeometryTest.cs b/test/EFCore.PG.FunctionalTests/Query/SpatialQueryNpgsqlGeometryTest.cs index 6bf97811b..03cc231b7 100644 --- a/test/EFCore.PG.FunctionalTests/Query/SpatialQueryNpgsqlGeometryTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/SpatialQueryNpgsqlGeometryTest.cs @@ -126,9 +126,9 @@ public override async Task Contains(bool async) AssertSql( """ -@__point_0='POINT (0.25 0.25)' (DbType = Object) +@point='POINT (0.25 0.25)' (DbType = Object) -SELECT p."Id", ST_Contains(p."Polygon", @__point_0) AS "Contains" +SELECT p."Id", ST_Contains(p."Polygon", @point) AS "Contains" FROM "PolygonEntity" AS p """); } @@ -185,9 +185,9 @@ public override async Task Crosses(bool async) AssertSql( """ -@__lineString_0='LINESTRING (0.5 -0.5, 0.5 0.5)' (DbType = Object) +@lineString='LINESTRING (0.5 -0.5, 0.5 0.5)' (DbType = Object) -SELECT l."Id", ST_Crosses(l."LineString", @__lineString_0) AS "Crosses" +SELECT l."Id", ST_Crosses(l."LineString", @lineString) AS "Crosses" FROM "LineStringEntity" AS l """); } @@ -198,9 +198,9 @@ public override async Task Difference(bool async) AssertSql( """ -@__polygon_0='POLYGON ((0 0, 1 0, 1 1, 0 0))' (DbType = Object) +@polygon='POLYGON ((0 0, 1 0, 1 1, 0 0))' (DbType = Object) -SELECT p."Id", ST_Difference(p."Polygon", @__polygon_0) AS "Difference" +SELECT p."Id", ST_Difference(p."Polygon", @polygon) AS "Difference" FROM "PolygonEntity" AS p """); } @@ -248,9 +248,9 @@ public override async Task EqualsTopologically(bool async) AssertSql( """ -@__point_0='POINT (0 0)' (DbType = Object) +@point='POINT (0 0)' (DbType = Object) -SELECT p."Id", ST_Equals(p."Point", @__point_0) AS "EqualsTopologically" +SELECT p."Id", ST_Equals(p."Point", @point) AS "EqualsTopologically" FROM "PointEntity" AS p """); } @@ -355,9 +355,9 @@ public override async Task Intersection(bool async) AssertSql( """ -@__polygon_0='POLYGON ((0 0, 1 0, 1 1, 0 0))' (DbType = Object) +@polygon='POLYGON ((0 0, 1 0, 1 1, 0 0))' (DbType = Object) -SELECT p."Id", ST_Intersection(p."Polygon", @__polygon_0) AS "Intersection" +SELECT p."Id", ST_Intersection(p."Polygon", @polygon) AS "Intersection" FROM "PolygonEntity" AS p """); } @@ -368,9 +368,9 @@ public override async Task Intersects(bool async) AssertSql( """ -@__lineString_0='LINESTRING (0.5 -0.5, 0.5 0.5)' (DbType = Object) +@lineString='LINESTRING (0.5 -0.5, 0.5 0.5)' (DbType = Object) -SELECT l."Id", ST_Intersects(l."LineString", @__lineString_0) AS "Intersects" +SELECT l."Id", ST_Intersects(l."LineString", @lineString) AS "Intersects" FROM "LineStringEntity" AS l """); } @@ -447,9 +447,9 @@ public override async Task IsWithinDistance(bool async) AssertSql( """ -@__point_0='POINT (0 1)' (DbType = Object) +@point='POINT (0 1)' (DbType = Object) -SELECT p."Id", ST_DWithin(p."Point", @__point_0, 1.0) AS "IsWithinDistance" +SELECT p."Id", ST_DWithin(p."Point", @point, 1.0) AS "IsWithinDistance" FROM "PointEntity" AS p """); } @@ -552,9 +552,9 @@ public override async Task Overlaps(bool async) AssertSql( """ -@__polygon_0='POLYGON ((0 0, 1 0, 1 1, 0 0))' (DbType = Object) +@polygon='POLYGON ((0 0, 1 0, 1 1, 0 0))' (DbType = Object) -SELECT p."Id", ST_Overlaps(p."Polygon", @__polygon_0) AS "Overlaps" +SELECT p."Id", ST_Overlaps(p."Polygon", @polygon) AS "Overlaps" FROM "PolygonEntity" AS p """); } @@ -576,9 +576,9 @@ public override async Task Relate(bool async) AssertSql( """ -@__polygon_0='POLYGON ((0 0, 1 0, 1 1, 0 0))' (DbType = Object) +@polygon='POLYGON ((0 0, 1 0, 1 1, 0 0))' (DbType = Object) -SELECT p."Id", ST_Relate(p."Polygon", @__polygon_0, '212111212') AS "Relate" +SELECT p."Id", ST_Relate(p."Polygon", @polygon, '212111212') AS "Relate" FROM "PolygonEntity" AS p """); } @@ -611,9 +611,9 @@ public override async Task SymmetricDifference(bool async) AssertSql( """ -@__polygon_0='POLYGON ((0 0, 1 0, 1 1, 0 0))' (DbType = Object) +@polygon='POLYGON ((0 0, 1 0, 1 1, 0 0))' (DbType = Object) -SELECT p."Id", ST_SymDifference(p."Polygon", @__polygon_0) AS "SymmetricDifference" +SELECT p."Id", ST_SymDifference(p."Polygon", @polygon) AS "SymmetricDifference" FROM "PolygonEntity" AS p """); } @@ -646,9 +646,9 @@ public override async Task Touches(bool async) AssertSql( """ -@__polygon_0='POLYGON ((0 1, 1 0, 1 1, 0 1))' (DbType = Object) +@polygon='POLYGON ((0 1, 1 0, 1 1, 0 1))' (DbType = Object) -SELECT p."Id", ST_Touches(p."Polygon", @__polygon_0) AS "Touches" +SELECT p."Id", ST_Touches(p."Polygon", @polygon) AS "Touches" FROM "PolygonEntity" AS p """); } @@ -659,9 +659,9 @@ public override async Task Union(bool async) AssertSql( """ -@__polygon_0='POLYGON ((0 0, 1 0, 1 1, 0 0))' (DbType = Object) +@polygon='POLYGON ((0 0, 1 0, 1 1, 0 0))' (DbType = Object) -SELECT p."Id", ST_Union(p."Polygon", @__polygon_0) AS "Union" +SELECT p."Id", ST_Union(p."Polygon", @polygon) AS "Union" FROM "PolygonEntity" AS p """); } @@ -696,9 +696,9 @@ public override async Task Within(bool async) AssertSql( """ -@__polygon_0='POLYGON ((-1 -1, 2 -1, 2 2, -1 2, -1 -1))' (DbType = Object) +@polygon='POLYGON ((-1 -1, 2 -1, 2 2, -1 2, -1 -1))' (DbType = Object) -SELECT p."Id", ST_Within(p."Point", @__polygon_0) AS "Within" +SELECT p."Id", ST_Within(p."Point", @polygon) AS "Within" FROM "PointEntity" AS p """); } diff --git a/test/EFCore.PG.FunctionalTests/Query/SqlQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/SqlQueryNpgsqlTest.cs index d666a26f1..692771726 100644 --- a/test/EFCore.PG.FunctionalTests/Query/SqlQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/SqlQueryNpgsqlTest.cs @@ -286,13 +286,13 @@ public override async Task SqlQueryRaw_queryable_with_parameters_and_clo AssertSql( """ p0='London' -@__contactTitle_1='Sales Representative' +@contactTitle='Sales Representative' SELECT m."Address", m."City", m."CompanyName", m."ContactName", m."ContactTitle", m."Country", m."CustomerID", m."Fax", m."Phone", m."Region", m."PostalCode" FROM ( SELECT * FROM "Customers" WHERE "City" = @p0 ) AS m -WHERE m."ContactTitle" = @__contactTitle_1 +WHERE m."ContactTitle" = @contactTitle """); return null; @@ -410,9 +410,9 @@ public override async Task SqlQueryRaw_with_dbParameter_mixed(bool async) // """ @city='London' (Nullable = false) -p1='Sales Representative' +p0='Sales Representative' -SELECT * FROM "Customers" WHERE "City" = @city AND "ContactTitle" = @p1 +SELECT * FROM "Customers" WHERE "City" = @city AND "ContactTitle" = @p0 """); } @@ -637,7 +637,7 @@ SELECT m0."CustomerID" // """ @city='London' (Nullable = false) -p1='Sales Representative' +p0='Sales Representative' SELECT m."CustomerID", m."EmployeeID", m."Freight", m."OrderDate", m."OrderID", m."RequiredDate", m."ShipAddress", m."ShipCity", m."ShipCountry", m."ShipName", m."ShipPostalCode", m."ShipRegion", m."ShipVia", m."ShippedDate" FROM ( @@ -646,32 +646,12 @@ SELECT m0."CustomerID" WHERE m."CustomerID" IN ( SELECT m0."CustomerID" FROM ( - SELECT * FROM "Customers" WHERE "City" = @city AND "ContactTitle" = @p1 + SELECT * FROM "Customers" WHERE "City" = @city AND "ContactTitle" = @p0 ) AS m0 ) """); } - public override async Task Multiple_occurrences_of_SqlQuery_with_db_parameter_adds_parameter_only_once(bool async) - { - await base.Multiple_occurrences_of_SqlQuery_with_db_parameter_adds_parameter_only_once(async); - - AssertSql( - """ -city='Seattle' (Nullable = false) - -SELECT m."Address", m."City", m."CompanyName", m."ContactName", m."ContactTitle", m."Country", m."CustomerID", m."Fax", m."Phone", m."Region", m."PostalCode" -FROM ( - SELECT * FROM "Customers" WHERE "City" = @city -) AS m -INTERSECT -SELECT m0."Address", m0."City", m0."CompanyName", m0."ContactName", m0."ContactTitle", m0."Country", m0."CustomerID", m0."Fax", m0."Phone", m0."Region", m0."PostalCode" -FROM ( - SELECT * FROM "Customers" WHERE "City" = @city -) AS m0 -"""); - } - public override async Task SqlQueryRaw_composed_with_common_table_expression(bool async) { await base.SqlQueryRaw_composed_with_common_table_expression(async); diff --git a/test/EFCore.PG.FunctionalTests/Query/TPCGearsOfWarQueryNpgsqlFixture.cs b/test/EFCore.PG.FunctionalTests/Query/TPCGearsOfWarQueryNpgsqlFixture.cs index a6510bd5e..1e5de06b5 100644 --- a/test/EFCore.PG.FunctionalTests/Query/TPCGearsOfWarQueryNpgsqlFixture.cs +++ b/test/EFCore.PG.FunctionalTests/Query/TPCGearsOfWarQueryNpgsqlFixture.cs @@ -40,6 +40,8 @@ public override ISetSource GetExpectedData() { mission.Timeline = new DateTimeOffset( mission.Timeline.Ticks - (mission.Timeline.Ticks % (TimeSpan.TicksPerMillisecond / 1000)), TimeSpan.Zero); + mission.Duration = new TimeSpan( + mission.Duration.Ticks - (mission.Duration.Ticks % (TimeSpan.TicksPerMillisecond / 1000))); } } @@ -66,10 +68,10 @@ public static async Task SeedForNpgsqlAsync(GearsOfWarContext context) foreach (var mission in missions) { - // var newThing = new DateTimeOffset(orig.Ticks - (orig.Ticks % (TimeSpan.TicksPerMillisecond / 1000)), TimeSpan.Zero); - mission.Timeline = new DateTimeOffset( mission.Timeline.Ticks - (mission.Timeline.Ticks % (TimeSpan.TicksPerMillisecond / 1000)), TimeSpan.Zero); + mission.Duration = new TimeSpan( + mission.Duration.Ticks - (mission.Duration.Ticks % (TimeSpan.TicksPerMillisecond / 1000))); } GearsOfWarData.WireUp( diff --git a/test/EFCore.PG.FunctionalTests/Query/TPCGearsOfWarQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/TPCGearsOfWarQueryNpgsqlTest.cs index 5fae337e4..455b7b4fd 100644 --- a/test/EFCore.PG.FunctionalTests/Query/TPCGearsOfWarQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/TPCGearsOfWarQueryNpgsqlTest.cs @@ -44,13 +44,13 @@ await AssertQuery( AssertSql( """ -@__start_0='1902-01-01T10:00:00.1234567+00:00' (DbType = DateTime) -@__end_1='1902-01-03T10:00:00.1234567+00:00' (DbType = DateTime) -@__dates_2={ '1902-01-02T10:00:00.1234567+00:00' } (DbType = Object) +@start='1902-01-01T10:00:00.1234567+00:00' (DbType = DateTime) +@end='1902-01-03T10:00:00.1234567+00:00' (DbType = DateTime) +@dates={ '1902-01-02T10:00:00.1234567+00:00' } (DbType = Object) SELECT m."Id", m."CodeName", m."Date", m."Difficulty", m."Duration", m."Rating", m."Time", m."Timeline" FROM "Missions" AS m -WHERE @__start_0 <= date_trunc('day', m."Timeline" AT TIME ZONE 'UTC')::timestamptz AND m."Timeline" < @__end_1 AND m."Timeline" = ANY (@__dates_2) +WHERE @start <= date_trunc('day', m."Timeline" AT TIME ZONE 'UTC')::timestamptz AND m."Timeline" < @end AND m."Timeline" = ANY (@dates) """); } @@ -64,11 +64,11 @@ await AssertQuery( AssertSql( """ -@__dateTimeOffset_Date_0='0002-03-01T00:00:00.0000000' +@dateTimeOffset_Date='0002-03-01T00:00:00.0000000' SELECT m."Id", m."CodeName", m."Date", m."Difficulty", m."Duration", m."Rating", m."Time", m."Timeline" FROM "Missions" AS m -WHERE date_trunc('day', m."Timeline" AT TIME ZONE 'UTC')::timestamp >= @__dateTimeOffset_Date_0 +WHERE date_trunc('day', m."Timeline" AT TIME ZONE 'UTC')::timestamp >= @dateTimeOffset_Date """); } @@ -115,6 +115,25 @@ public override Task Where_TimeSpan_Hours(bool async) public override Task Where_TimeOnly_Millisecond(bool async) => Task.CompletedTask; // Translation not implemented + // TODO: #3406 + public override Task Where_datetimeoffset_microsecond_component(bool async) + => AssertTranslationFailed(() => base.Where_datetimeoffset_microsecond_component(async)); + + public override Task Where_datetimeoffset_nanosecond_component(bool async) + => AssertTranslationFailed(() => base.Where_datetimeoffset_nanosecond_component(async)); + + public override Task Where_timespan_microsecond_component(bool async) + => AssertTranslationFailed(() => base.Where_timespan_microsecond_component(async)); + + public override Task Where_timespan_nanosecond_component(bool async) + => AssertTranslationFailed(() => base.Where_timespan_nanosecond_component(async)); + + public override Task Where_timeonly_microsecond_component(bool async) + => AssertTranslationFailed(() => base.Where_timeonly_microsecond_component(async)); + + public override Task Where_timeonly_nanosecond_component(bool async) + => AssertTranslationFailed(() => base.Where_timeonly_nanosecond_component(async)); + private void AssertSql(params string[] expected) => Fixture.TestSqlLoggerFactory.AssertBaseline(expected); } diff --git a/test/EFCore.PG.FunctionalTests/Query/TPTGearsOfWarQueryNpgsqlFixture.cs b/test/EFCore.PG.FunctionalTests/Query/TPTGearsOfWarQueryNpgsqlFixture.cs index 68ca376e4..1011a5061 100644 --- a/test/EFCore.PG.FunctionalTests/Query/TPTGearsOfWarQueryNpgsqlFixture.cs +++ b/test/EFCore.PG.FunctionalTests/Query/TPTGearsOfWarQueryNpgsqlFixture.cs @@ -40,6 +40,8 @@ public override ISetSource GetExpectedData() { mission.Timeline = new DateTimeOffset( mission.Timeline.Ticks - (mission.Timeline.Ticks % (TimeSpan.TicksPerMillisecond / 1000)), TimeSpan.Zero); + mission.Duration = new TimeSpan( + mission.Duration.Ticks - (mission.Duration.Ticks % (TimeSpan.TicksPerMillisecond / 1000))); } } @@ -66,10 +68,10 @@ public static async Task SeedForNpgsqlAsync(GearsOfWarContext context) foreach (var mission in missions) { - // var newThing = new DateTimeOffset(orig.Ticks - (orig.Ticks % (TimeSpan.TicksPerMillisecond / 1000)), TimeSpan.Zero); - mission.Timeline = new DateTimeOffset( mission.Timeline.Ticks - (mission.Timeline.Ticks % (TimeSpan.TicksPerMillisecond / 1000)), TimeSpan.Zero); + mission.Duration = new TimeSpan( + mission.Duration.Ticks - (mission.Duration.Ticks % (TimeSpan.TicksPerMillisecond / 1000))); } GearsOfWarData.WireUp( diff --git a/test/EFCore.PG.FunctionalTests/Query/TPTGearsOfWarQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/TPTGearsOfWarQueryNpgsqlTest.cs index dafbe74e1..441594383 100644 --- a/test/EFCore.PG.FunctionalTests/Query/TPTGearsOfWarQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/TPTGearsOfWarQueryNpgsqlTest.cs @@ -48,13 +48,13 @@ await AssertQuery( AssertSql( """ -@__start_0='1902-01-01T10:00:00.1234567+00:00' (DbType = DateTime) -@__end_1='1902-01-03T10:00:00.1234567+00:00' (DbType = DateTime) -@__dates_2={ '1902-01-02T10:00:00.1234567+00:00' } (DbType = Object) +@start='1902-01-01T10:00:00.1234567+00:00' (DbType = DateTime) +@end='1902-01-03T10:00:00.1234567+00:00' (DbType = DateTime) +@dates={ '1902-01-02T10:00:00.1234567+00:00' } (DbType = Object) SELECT m."Id", m."CodeName", m."Date", m."Difficulty", m."Duration", m."Rating", m."Time", m."Timeline" FROM "Missions" AS m -WHERE @__start_0 <= date_trunc('day', m."Timeline" AT TIME ZONE 'UTC')::timestamptz AND m."Timeline" < @__end_1 AND m."Timeline" = ANY (@__dates_2) +WHERE @start <= date_trunc('day', m."Timeline" AT TIME ZONE 'UTC')::timestamptz AND m."Timeline" < @end AND m."Timeline" = ANY (@dates) """); } @@ -68,11 +68,11 @@ await AssertQuery( AssertSql( """ -@__dateTimeOffset_Date_0='0002-03-01T00:00:00.0000000' +@dateTimeOffset_Date='0002-03-01T00:00:00.0000000' SELECT m."Id", m."CodeName", m."Date", m."Difficulty", m."Duration", m."Rating", m."Time", m."Timeline" FROM "Missions" AS m -WHERE date_trunc('day', m."Timeline" AT TIME ZONE 'UTC')::timestamp >= @__dateTimeOffset_Date_0 +WHERE date_trunc('day', m."Timeline" AT TIME ZONE 'UTC')::timestamp >= @dateTimeOffset_Date """); } @@ -119,6 +119,25 @@ public override Task Where_TimeSpan_Hours(bool async) public override Task Where_TimeOnly_Millisecond(bool async) => Task.CompletedTask; // Translation not implemented + // TODO: #3406 + public override Task Where_datetimeoffset_microsecond_component(bool async) + => AssertTranslationFailed(() => base.Where_datetimeoffset_microsecond_component(async)); + + public override Task Where_datetimeoffset_nanosecond_component(bool async) + => AssertTranslationFailed(() => base.Where_datetimeoffset_nanosecond_component(async)); + + public override Task Where_timespan_microsecond_component(bool async) + => AssertTranslationFailed(() => base.Where_timespan_microsecond_component(async)); + + public override Task Where_timespan_nanosecond_component(bool async) + => AssertTranslationFailed(() => base.Where_timespan_nanosecond_component(async)); + + public override Task Where_timeonly_microsecond_component(bool async) + => AssertTranslationFailed(() => base.Where_timeonly_microsecond_component(async)); + + public override Task Where_timeonly_nanosecond_component(bool async) + => AssertTranslationFailed(() => base.Where_timeonly_nanosecond_component(async)); + private void AssertSql(params string[] expected) => Fixture.TestSqlLoggerFactory.AssertBaseline(expected); } diff --git a/test/EFCore.PG.FunctionalTests/Query/TimestampQueryTest.cs b/test/EFCore.PG.FunctionalTests/Query/TimestampQueryTest.cs index 7b6e17486..8bb5d10b9 100644 --- a/test/EFCore.PG.FunctionalTests/Query/TimestampQueryTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/TimestampQueryTest.cs @@ -120,7 +120,7 @@ await AssertQuery( """ SELECT e."Id", e."TimestampDateTime", e."TimestampDateTimeArray", e."TimestampDateTimeOffset", e."TimestampDateTimeOffsetArray", e."TimestampDateTimeRange", e."TimestamptzDateTime", e."TimestamptzDateTimeArray", e."TimestamptzDateTimeRange" FROM "Entities" AS e -WHERE e."TimestampDateTime" = @__dateTime_0 +WHERE e."TimestampDateTime" = @dateTime """, Fixture.TestSqlLoggerFactory.SqlStatements.Single()); } @@ -139,11 +139,11 @@ await AssertQuery( AssertSql( """ -@__dateTime_0='1998-04-12T15:26:38.0000000' +@dateTime='1998-04-12T15:26:38.0000000' SELECT e."Id", e."TimestampDateTime", e."TimestampDateTimeArray", e."TimestampDateTimeOffset", e."TimestampDateTimeOffsetArray", e."TimestampDateTimeRange", e."TimestamptzDateTime", e."TimestamptzDateTimeArray", e."TimestamptzDateTimeRange" FROM "Entities" AS e -WHERE e."TimestampDateTime" = @__dateTime_0 +WHERE e."TimestampDateTime" = @dateTime """); } @@ -197,11 +197,11 @@ await AssertQuery( AssertSql( """ -@__dateTime_0='1998-04-12T13:26:38.0000000Z' (DbType = DateTime) +@dateTime='1998-04-12T13:26:38.0000000Z' (DbType = DateTime) SELECT e."Id", e."TimestampDateTime", e."TimestampDateTimeArray", e."TimestampDateTimeOffset", e."TimestampDateTimeOffsetArray", e."TimestampDateTimeRange", e."TimestamptzDateTime", e."TimestamptzDateTimeArray", e."TimestamptzDateTimeRange" FROM "Entities" AS e -WHERE e."TimestamptzDateTime" = @__dateTime_0 +WHERE e."TimestamptzDateTime" = @dateTime """); } @@ -317,11 +317,11 @@ await AssertQuery( AssertSql( """ -@__myDatetime_0='2015-04-10T00:00:00.0000000' +@myDatetime='2015-04-10T00:00:00.0000000' SELECT e."Id", e."TimestampDateTime", e."TimestampDateTimeArray", e."TimestampDateTimeOffset", e."TimestampDateTimeOffsetArray", e."TimestampDateTimeRange", e."TimestamptzDateTime", e."TimestamptzDateTimeArray", e."TimestamptzDateTimeRange" FROM "Entities" AS e -WHERE now()::timestamp <> @__myDatetime_0 +WHERE now()::timestamp <> @myDatetime """); } @@ -337,11 +337,11 @@ await AssertQuery( AssertSql( """ -@__myDatetime_0='2015-04-10T00:00:00.0000000Z' (DbType = DateTime) +@myDatetime='2015-04-10T00:00:00.0000000Z' (DbType = DateTime) SELECT e."Id", e."TimestampDateTime", e."TimestampDateTimeArray", e."TimestampDateTimeOffset", e."TimestampDateTimeOffsetArray", e."TimestampDateTimeRange", e."TimestamptzDateTime", e."TimestamptzDateTimeArray", e."TimestamptzDateTimeRange" FROM "Entities" AS e -WHERE now() <> @__myDatetime_0 +WHERE now() <> @myDatetime """); } diff --git a/test/EFCore.PG.FunctionalTests/Query/UdfDbFunctionNpgsqlTests.cs b/test/EFCore.PG.FunctionalTests/Query/UdfDbFunctionNpgsqlTests.cs index 549194272..a1652ec85 100644 --- a/test/EFCore.PG.FunctionalTests/Query/UdfDbFunctionNpgsqlTests.cs +++ b/test/EFCore.PG.FunctionalTests/Query/UdfDbFunctionNpgsqlTests.cs @@ -34,11 +34,11 @@ public override void Scalar_Function_With_Translator_Translates_Static() AssertSql( """ -@__customerId_0='3' +@customerId='3' SELECT length(c."LastName") FROM "Customers" AS c -WHERE c."Id" = @__customerId_0 +WHERE c."Id" = @customerId LIMIT 2 """); } @@ -54,9 +54,9 @@ public override void Scalar_Function_Constant_Parameter_Static() AssertSql( """ -@__customerId_0='1' +@customerId='1' -SELECT "CustomerOrderCount"(@__customerId_0) +SELECT "CustomerOrderCount"(@customerId) FROM "Customers" AS c """); } @@ -96,11 +96,11 @@ public override void Scalar_Function_Anonymous_Type_Select_Parameter_Static() AssertSql( """ -@__customerId_0='1' +@customerId='1' -SELECT c."LastName", "CustomerOrderCount"(@__customerId_0) AS "OrderCount" +SELECT c."LastName", "CustomerOrderCount"(@customerId) AS "OrderCount" FROM "Customers" AS c -WHERE c."Id" = @__customerId_0 +WHERE c."Id" = @customerId LIMIT 2 """); } @@ -112,12 +112,12 @@ public override void Scalar_Function_Anonymous_Type_Select_Nested_Static() AssertSql( """ -@__starCount_1='3' -@__customerId_0='3' +@starCount='3' +@customerId='3' -SELECT c."LastName", "StarValue"(@__starCount_1, "CustomerOrderCount"(@__customerId_0)) AS "OrderCount" +SELECT c."LastName", "StarValue"(@starCount, "CustomerOrderCount"(@customerId)) AS "OrderCount" FROM "Customers" AS c -WHERE c."Id" = @__customerId_0 +WHERE c."Id" = @customerId LIMIT 2 """); } @@ -158,11 +158,11 @@ public override void Scalar_Function_Where_Parameter_Static() AssertSql( """ -@__period_0='0' +@period='0' SELECT c."Id" FROM "Customers" AS c -WHERE c."Id" = "GetCustomerWithMostOrdersAfterDate"("GetReportingPeriodStartDate"(@__period_0)) +WHERE c."Id" = "GetCustomerWithMostOrdersAfterDate"("GetReportingPeriodStartDate"(@period)) LIMIT 2 """); } @@ -216,11 +216,11 @@ public override void Scalar_Function_Let_Not_Parameter_Static() AssertSql( """ -@__customerId_0='2' +@customerId='2' -SELECT c."LastName", "CustomerOrderCount"(@__customerId_0) AS "OrderCount" +SELECT c."LastName", "CustomerOrderCount"(@customerId) AS "OrderCount" FROM "Customers" AS c -WHERE c."Id" = @__customerId_0 +WHERE c."Id" = @customerId LIMIT 2 """); } @@ -232,12 +232,12 @@ public override void Scalar_Function_Let_Nested_Static() AssertSql( """ -@__starCount_1='3' -@__customerId_0='1' +@starCount='3' +@customerId='1' -SELECT c."LastName", "StarValue"(@__starCount_1, "CustomerOrderCount"(@__customerId_0)) AS "OrderCount" +SELECT c."LastName", "StarValue"(@starCount, "CustomerOrderCount"(@customerId)) AS "OrderCount" FROM "Customers" AS c -WHERE c."Id" = @__customerId_0 +WHERE c."Id" = @customerId LIMIT 2 """); } @@ -336,11 +336,11 @@ public override void Scalar_Function_With_Translator_Translates_Instance() AssertSql( """ -@__customerId_0='3' +@customerId='3' SELECT length(c."LastName") FROM "Customers" AS c -WHERE c."Id" = @__customerId_0 +WHERE c."Id" = @customerId LIMIT 2 """); } @@ -352,9 +352,9 @@ public override void Scalar_Function_Constant_Parameter_Instance() AssertSql( """ -@__customerId_1='1' +@customerId='1' -SELECT "CustomerOrderCount"(@__customerId_1) +SELECT "CustomerOrderCount"(@customerId) FROM "Customers" AS c """); } @@ -394,11 +394,11 @@ public override void Scalar_Function_Anonymous_Type_Select_Parameter_Instance() AssertSql( """ -@__customerId_0='1' +@customerId='1' -SELECT c."LastName", "CustomerOrderCount"(@__customerId_0) AS "OrderCount" +SELECT c."LastName", "CustomerOrderCount"(@customerId) AS "OrderCount" FROM "Customers" AS c -WHERE c."Id" = @__customerId_0 +WHERE c."Id" = @customerId LIMIT 2 """); } @@ -410,12 +410,12 @@ public override void Scalar_Function_Anonymous_Type_Select_Nested_Instance() AssertSql( """ -@__starCount_2='3' -@__customerId_0='3' +@starCount='3' +@customerId='3' -SELECT c."LastName", "StarValue"(@__starCount_2, "CustomerOrderCount"(@__customerId_0)) AS "OrderCount" +SELECT c."LastName", "StarValue"(@starCount, "CustomerOrderCount"(@customerId)) AS "OrderCount" FROM "Customers" AS c -WHERE c."Id" = @__customerId_0 +WHERE c."Id" = @customerId LIMIT 2 """); } @@ -456,11 +456,11 @@ public override void Scalar_Function_Where_Parameter_Instance() AssertSql( """ -@__period_1='0' +@period='0' SELECT c."Id" FROM "Customers" AS c -WHERE c."Id" = "GetCustomerWithMostOrdersAfterDate"("GetReportingPeriodStartDate"(@__period_1)) +WHERE c."Id" = "GetCustomerWithMostOrdersAfterDate"("GetReportingPeriodStartDate"(@period)) LIMIT 2 """); } @@ -514,11 +514,11 @@ public override void Scalar_Function_Let_Not_Parameter_Instance() AssertSql( """ -@__customerId_1='2' +@customerId='2' -SELECT c."LastName", "CustomerOrderCount"(@__customerId_1) AS "OrderCount" +SELECT c."LastName", "CustomerOrderCount"(@customerId) AS "OrderCount" FROM "Customers" AS c -WHERE c."Id" = @__customerId_1 +WHERE c."Id" = @customerId LIMIT 2 """); } @@ -530,12 +530,12 @@ public override void Scalar_Function_Let_Nested_Instance() AssertSql( """ -@__starCount_2='3' -@__customerId_1='1' +@starCount='3' +@customerId='1' -SELECT c."LastName", "StarValue"(@__starCount_2, "CustomerOrderCount"(@__customerId_1)) AS "OrderCount" +SELECT c."LastName", "StarValue"(@starCount, "CustomerOrderCount"(@customerId)) AS "OrderCount" FROM "Customers" AS c -WHERE c."Id" = @__customerId_1 +WHERE c."Id" = @customerId LIMIT 2 """); } diff --git a/test/EFCore.PG.FunctionalTests/Scaffolding/NpgsqlDatabaseModelFactoryTest.cs b/test/EFCore.PG.FunctionalTests/Scaffolding/NpgsqlDatabaseModelFactoryTest.cs index eb0179a68..6357a3676 100644 --- a/test/EFCore.PG.FunctionalTests/Scaffolding/NpgsqlDatabaseModelFactoryTest.cs +++ b/test/EFCore.PG.FunctionalTests/Scaffolding/NpgsqlDatabaseModelFactoryTest.cs @@ -412,28 +412,28 @@ FOREIGN KEY ("ForeignKeyId1", "ForeignKeyId2") REFERENCES "db2"."PrincipalTable" // ReSharper disable once PossibleNullReferenceException Assert.Equal("db2", sequence.Schema); - Assert.Single(dbModel.Tables.Where(t => t.Schema == "db.2" && t.Name == "QuotedTableName")); - Assert.DoesNotContain(dbModel.Tables, t => t.Schema == "db.2" && t.Name == "Table.With.Dot"); - Assert.Single(dbModel.Tables.Where(t => t.Schema == "db.2" && t.Name == "SimpleTableName")); - Assert.Single(dbModel.Tables.Where(t => t.Schema == "db.2" && t.Name == "JustTableName")); - - Assert.DoesNotContain(dbModel.Tables, t => t.Schema == "public" && t.Name == "QuotedTableName"); - Assert.Single(dbModel.Tables.Where(t => t.Schema == "public" && t.Name == "Table.With.Dot")); - Assert.Single(dbModel.Tables.Where(t => t.Schema == "public" && t.Name == "SimpleTableName")); - Assert.Single(dbModel.Tables.Where(t => t.Schema == "public" && t.Name == "JustTableName")); - - Assert.Single(dbModel.Tables.Where(t => t.Schema == "db2" && t.Name == "QuotedTableName")); - Assert.Single(dbModel.Tables.Where(t => t.Schema == "db2" && t.Name == "Table.With.Dot")); - Assert.Single(dbModel.Tables.Where(t => t.Schema == "db2" && t.Name == "SimpleTableName")); - Assert.Single(dbModel.Tables.Where(t => t.Schema == "db2" && t.Name == "JustTableName")); - - var principalTable = Assert.Single(dbModel.Tables.Where(t => t.Schema == "db2" && t.Name == "PrincipalTable")); + Assert.Single(dbModel.Tables, t => t is { Schema: "db.2", Name: "QuotedTableName" }); + Assert.DoesNotContain(dbModel.Tables, t => t is { Schema: "db.2", Name: "Table.With.Dot" }); + Assert.Single(dbModel.Tables, t => t is { Schema: "db.2", Name: "SimpleTableName" }); + Assert.Single(dbModel.Tables, t => t is { Schema: "db.2", Name: "JustTableName" }); + + Assert.DoesNotContain(dbModel.Tables, t => t is { Schema: "public", Name: "QuotedTableName" }); + Assert.Single(dbModel.Tables, t => t is { Schema: "public", Name: "Table.With.Dot" }); + Assert.Single(dbModel.Tables, t => t is { Schema: "public", Name: "SimpleTableName" }); + Assert.Single(dbModel.Tables, t => t is { Schema: "public", Name: "JustTableName" }); + + Assert.Single(dbModel.Tables, t => t is { Schema: "db2", Name: "QuotedTableName" }); + Assert.Single(dbModel.Tables, t => t is { Schema: "db2", Name: "Table.With.Dot" }); + Assert.Single(dbModel.Tables, t => t is { Schema: "db2", Name: "SimpleTableName" }); + Assert.Single(dbModel.Tables, t => t is { Schema: "db2", Name: "JustTableName" }); + + var principalTable = Assert.Single(dbModel.Tables, t => t is { Schema: "db2", Name: "PrincipalTable" }); // ReSharper disable once PossibleNullReferenceException Assert.NotNull(principalTable.PrimaryKey); Assert.Single(principalTable.UniqueConstraints); Assert.Single(principalTable.Indexes); - var dependentTable = Assert.Single(dbModel.Tables.Where(t => t.Schema == "db2" && t.Name == "DependentTable")); + var dependentTable = Assert.Single(dbModel.Tables, t => t is { Schema: "db2", Name: "DependentTable" }); // ReSharper disable once PossibleNullReferenceException Assert.Single(dependentTable.ForeignKeys); }, @@ -486,8 +486,8 @@ public void Create_columns() Assert.Equal("Blogs", c.Table.Name); }); - Assert.Single(table.Columns.Where(c => c.Name == "Id")); - Assert.Single(table.Columns.Where(c => c.Name == "Name")); + Assert.Single(table.Columns, c => c.Name == "Id"); + Assert.Single(table.Columns, c => c.Name == "Name"); }, """ DROP TABLE "Blogs" @@ -514,8 +514,8 @@ public void Create_view_columns() Assert.Equal("BlogsView", c.Table.Name); }); - Assert.Single(table.Columns.Where(c => c.Name == "Id")); - Assert.Single(table.Columns.Where(c => c.Name == "Name")); + Assert.Single(table.Columns, c => c.Name == "Id"); + Assert.Single(table.Columns, c => c.Name == "Name"); }, """DROP VIEW "BlogsView";"""); @@ -540,8 +540,8 @@ public void Create_materialized_view_columns() Assert.Equal("BlogsView", c.Table.Name); }); - Assert.Single(table.Columns.Where(c => c.Name == "Id")); - Assert.Single(table.Columns.Where(c => c.Name == "Name")); + Assert.Single(table.Columns, c => c.Name == "Id"); + Assert.Single(table.Columns, c => c.Name == "Name"); }, """DROP MATERIALIZED VIEW "BlogsView";"""); @@ -633,8 +633,8 @@ public void Create_indexes() Assert.Equal("IndexTable", c.Table.Name); }); - Assert.Single(table.Indexes.Where(c => c.Name == "IX_NAME")); - Assert.Single(table.Indexes.Where(c => c.Name == "IX_INDEX")); + Assert.Single(table.Indexes, c => c.Name == "IX_NAME"); + Assert.Single(table.Indexes, c => c.Name == "IX_INDEX"); }, """ DROP TABLE "IndexTable" @@ -717,13 +717,13 @@ char_domain public.char_domain NULL [], dbModel => { - var textDomainColumn = Assert.Single(dbModel.Tables.Single().Columns.Where(c => c.Name == "text_domain")); + var textDomainColumn = Assert.Single(dbModel.Tables.Single().Columns, c => c.Name == "text_domain"); Assert.Equal("text", textDomainColumn?.StoreType); - var charDomainColumn = Assert.Single(dbModel.Tables.Single().Columns.Where(c => c.Name == "char_domain")); + var charDomainColumn = Assert.Single(dbModel.Tables.Single().Columns, c => c.Name == "char_domain"); Assert.Equal("character(3)", charDomainColumn?.StoreType); - var nonDomainColumn = Assert.Single(dbModel.Tables.Single().Columns.Where(c => c.Name == "id")); + var nonDomainColumn = Assert.Single(dbModel.Tables.Single().Columns, c => c.Name == "id"); Assert.Equal("integer", nonDomainColumn?.StoreType); }, """ @@ -1383,7 +1383,7 @@ FOREIGN KEY ("ForeignKeyId2") REFERENCES "AnotherPrincipalTable"("Id") ON DELETE Assert.Equal(2, foreignKeys.Count); - var principalFk = Assert.Single(foreignKeys.Where(f => f.PrincipalTable.Name == "PrincipalTable")); + var principalFk = Assert.Single(foreignKeys, f => f.PrincipalTable.Name == "PrincipalTable"); // ReSharper disable once PossibleNullReferenceException Assert.Equal("public", principalFk.Table.Schema); @@ -1394,7 +1394,7 @@ FOREIGN KEY ("ForeignKeyId2") REFERENCES "AnotherPrincipalTable"("Id") ON DELETE Assert.Equal(["Id"], principalFk.PrincipalColumns.Select(ic => ic.Name).ToList()); Assert.Equal(ReferentialAction.Cascade, principalFk.OnDelete); - var anotherPrincipalFk = Assert.Single(foreignKeys.Where(f => f.PrincipalTable.Name == "AnotherPrincipalTable")); + var anotherPrincipalFk = Assert.Single(foreignKeys, f => f.PrincipalTable.Name == "AnotherPrincipalTable"); // ReSharper disable once PossibleNullReferenceException Assert.Equal("public", anotherPrincipalFk.Table.Schema); @@ -1554,7 +1554,7 @@ public void Warn_missing_schema() { Assert.Empty(dbModel.Tables); - var (_, Id, Message, _, _) = Assert.Single(Fixture.ListLoggerFactory.Log.Where(t => t.Level == LogLevel.Warning)); + var (_, Id, Message, _, _) = Assert.Single(Fixture.ListLoggerFactory.Log, t => t.Level == LogLevel.Warning); Assert.Equal(NpgsqlResources.LogMissingSchema(new TestLogger()).EventId, Id); Assert.Equal( @@ -1576,7 +1576,7 @@ public void Warn_missing_table() { Assert.Empty(dbModel.Tables); - var (_, Id, Message, _, _) = Assert.Single(Fixture.ListLoggerFactory.Log.Where(t => t.Level == LogLevel.Warning)); + var (_, Id, Message, _, _) = Assert.Single(Fixture.ListLoggerFactory.Log, t => t.Level == LogLevel.Warning); Assert.Equal(NpgsqlResources.LogMissingTable(new TestLogger()).EventId, Id); Assert.Equal( @@ -1604,7 +1604,7 @@ public void Warn_missing_principal_table_for_foreign_key() [], _ => { - var (_, Id, Message, _, _) = Assert.Single(Fixture.ListLoggerFactory.Log.Where(t => t.Level == LogLevel.Warning)); + var (_, Id, Message, _, _) = Assert.Single(Fixture.ListLoggerFactory.Log, t => t.Level == LogLevel.Warning); Assert.Equal(NpgsqlResources.LogPrincipalTableNotInSelectionSet(new TestLogger()).EventId, Id); Assert.Equal( @@ -1671,7 +1671,7 @@ public void SequenceNonSerial() // with a DefaultValue. This is consistent with the SqlServer scaffolding behavior. Assert.Null(column.ValueGenerated); - Assert.Single(dbModel.Sequences.Where(s => s.Name == "SomeSequence")); + Assert.Single(dbModel.Sequences, s => s.Name == "SomeSequence"); }, """ DROP TABLE "NonSerialSequence"; diff --git a/test/EFCore.PG.FunctionalTests/TestUtilities/TestRelationalCommandBuilderFactory.cs b/test/EFCore.PG.FunctionalTests/TestUtilities/TestRelationalCommandBuilderFactory.cs index 6dcc65fd1..38d349250 100644 --- a/test/EFCore.PG.FunctionalTests/TestUtilities/TestRelationalCommandBuilderFactory.cs +++ b/test/EFCore.PG.FunctionalTests/TestUtilities/TestRelationalCommandBuilderFactory.cs @@ -51,6 +51,13 @@ public IRelationalCommandBuilder Append(string value) return this; } + public IRelationalCommandBuilder Append(FormattableString value) + { + Instance.Append(value); + + return this; + } + public IRelationalCommandBuilder AppendLine() { Instance.AppendLine();