Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions conceptual/EFCore.PG/release-notes/10.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,5 +159,31 @@ See the [10.0.0 milestone](https://github.com/npgsql/efcore.pg/milestone/68?clos

## Breaking changes

### Array `Contains` translation now defaults to `ANY`

Translation for array `Contains` was changed in 10.0: `arrayColumn.Contains(element)` now defaults to `element = ANY(arrayColumn)` (instead of `arrayColumn @> ARRAY[element]`). This can impact performance depending on your indexes: `@>` can be much faster with a GIN index over the array column, while `ANY` can be better when that GIN index is missing.

Previous SQL:

```sql
WHERE array_column @> ARRAY[@__element_0]::text[]
```

New default SQL:

```sql
WHERE @__element_0 = ANY (array_column)
```

To tell EF that a GIN index exists and revert to the previous `@>` translation, model that index:

```csharp
modelBuilder.Entity<Item>()
.HasIndex(i => i.ArrayColumn)
.HasMethod("gin");
```

### Other breaking changes

* `EF.Functions.Network()` and `EF.Functions.Merge()` have been changed to return the new .NET [`IPNetwork`](https://learn.microsoft.com/dotnet/api/system.net.ipnetwork) instead of the obsolete `NpgsqlCidr`. The new `IPNetwork` type works with all other functions as well (but no breaking changes were necessary).
* The PostgreSQL network type `cidr` is now scaffolded to the new .NET [`IPNetwork`](https://learn.microsoft.com/dotnet/api/system.net.ipnetwork) type. The older Npgsql representation for `cidr` - the `NpgsqlCidr` type - has been obsoleted and will be removed in a future release.