MightyOrm / Mighty

A new, small, dynamic micro-ORM. Highly compatible with Massive, but with many essential new features.
BSD 3-Clause "New" or "Revised" License
101 stars 20 forks source link

Bulk operations? #15

Closed mlouage closed 4 years ago

mlouage commented 4 years ago

Hello

Is there support for bulk operations? If not, is it on the roadmap?

Many thanks.

Maarten

mikebeaton commented 4 years ago

Save, Update and Delete have versions which take multiple items.

Do they do what you need?

If so, you'd be correct to point out that this isn't documented where it should be.

mikebeaton commented 4 years ago

Hi @mlouage,

Thoughts? Do these actually do what you needed?

I have self-assigned this with regards to the need to document that these variants exist.

mlouage commented 4 years ago

Hi @MikeBeaton

Sorry for not getting back to you earlier. I must say I haven't looked at it any further, I switched to using plain ADO.NET. Maybe for future reference, is the bulk operation for insert for example, generating SQL or must I write it myself like with ADO.NET?

In my specific case I use Postgres with Npgsql ADO.NET provider and I'm using the binary copy to facilitate the bulk insert.

mikebeaton commented 4 years ago

Thanks for the update. :)

From following the link I can see that you're talking about bulk population of tables e.g. from binary data. No, Mighty doesn't and won't support that kind of bulk data transfer into databases - I was just talking about CRUD operations on multiple objects at once.

FWIW Yes, the operations I referred you to (like all the CRUD-style operations in Mighty) do write the SQL for you. (But Mighty equally supports fetching from custom SQL when that is what you need.)

Finally, since you're on PostgreSQL using Npgsql, I'll just mention that Mighty has code specifically to provide automatic cursor dereferencing when used with Npgsql, which no longer directly provides that itself - in case that's something you might need at any point.

mlouage commented 4 years ago

Thanks for taking the time for answering and providing context. I'm sure I will remember MightyOrm for a next project!