Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeleteRangeByKey does not work with PostgreSQL #608

Open
Alexey39dev opened this issue Oct 18, 2024 · 1 comment
Open

DeleteRangeByKey does not work with PostgreSQL #608

Alexey39dev opened this issue Oct 18, 2024 · 1 comment
Assignees

Comments

@Alexey39dev
Copy link

Alexey39dev commented Oct 18, 2024

Description

Postgre database.
I am doing a batch deletion of rows from a table and I get an error message.

Code

Set<T>().DeleteRangeByKey(query);

Exception

Exception message:

Oops! The following provider 'Npgsql.NpgsqlConnection is not yet supported by the method DeleteByKey and DeleteRangeByKey. We add provider on demand, so if you wish we support it, report this message to '[email protected]' , v=6.103.5.0

Stack trace:

System.Exception: Oops! The following provider 'Npgsql.NpgsqlConnection is not yet supported by the method DeleteByKey and DeleteRangeByKey. We add provider on demand, so if you wish we support it, report this message to '[email protected]' , v=6.103.5.0
   at Z.EntityFramework.Extensions.DeleteByKeyExecutor`1.Prepare()
   at Z.EntityFramework.Extensions.DeleteByKeyManager.?[?](DbSet`1 ?, IEnumerable`1 ?)
   at DbSetExtensions.DeleteRangeByKey[TEntity,T](DbSet`1 dbSet, IEnumerable`1 entities)
   at DeleteRangeByKeyExample.AppDbContext.BatchDelete[T](IQueryable`1 query, Int32 batchCount) in C:\Temp\DeleteRangeByKeyExample\Model.cs:line 53
   at DeleteRangeByKeyExample.Program.Main(String[] args) in C:\Temp\DeleteRangeByKeyExample\Program.cs:line 37
   at DeleteRangeByKeyExample.Program.<Main>(String[] args)

Further technical details

  • EF version: [EF Core v6.0.8]
  • EF Extensions version: [EFE Core Core v6.103.5]
  • Database Server version: [PostgreSQL 16.3 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0, 64-bit]
  • Database Provider version (NuGet): [Npgsql.EntityFrameworkCore.PostgreSQL v6.0.2]

Project:
DeleteRangeByKeyExample.zip

@JonathanMagnan JonathanMagnan self-assigned this Oct 18, 2024
@JonathanMagnan
Copy link
Member

Hello @Alexey39dev ,

Indeed, the DeleteRangeByKey method doesn't currently support PostgreSQL.

We currently have too many requests to add to our short-term plan, but we will need to complete that for 2025.

Best Regards,

Jon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants