zzzprojects / EntityFramework-Extensions

Entity Framework Bulk Operations | Improve Entity Framework performance with Bulk SaveChanges, Insert, update, delete and merge for SQL Server, SQL Azure, SQL Compact, MySQL and SQLite.
https://entityframework-extensions.net
346 stars 57 forks source link

DeleteRangeByKey does not work with PostgreSQL #608

Open Alexey39dev opened 3 days ago

Alexey39dev commented 3 days ago

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 'info@zzzprojects.com' , 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 'info@zzzprojects.com' , 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

Project: DeleteRangeByKeyExample.zip

JonathanMagnan commented 3 days ago

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