airrecord icon indicating copy to clipboard operation
airrecord copied to clipboard

add bulk operations: create, update, delete; and find_or_create + count methods for single records

Open Yevhenii-Kushvid opened this issue 1 year ago • 4 comments

In recent project I faced the issue of performance, and found in AriTable api bulk operation: here is my proposal implementation of them for airrecord gem.

  • Table#bulk_create
  • Table#bulk_update
  • Table#bulk_delete

and additional helper for record finding

  • Table#find_or_create
  • Table#count

link to API documentation

Yevhenii-Kushvid avatar Nov 17 '24 06:11 Yevhenii-Kushvid

Thanks for your work. I don't know if this gem is still watched/maintained. It looks like it's not. Anyway, if I manage to make it work on my project, I'll definitely integrate your work too!

AdrienGiboire avatar Mar 27 '25 14:03 AdrienGiboire

It's come up a couple times already: https://github.com/sirupsen/airrecord/pull/84 https://github.com/sirupsen/airrecord/pull/91

I'm not strictly opposed to adding batch operations, but it needs testing and documentation, (would also be nice to have some information on how much performance you gain with this approach so people know when it makes sense to use it).

Meekohi avatar Mar 27 '25 17:03 Meekohi

Both mentioned PR came with tests. The first one was left unaddressed for months. The second one was closed due to increased complexity.

Also, I don't get this point:

would also be nice to have some information on how much performance you gain with this approach so people know when it makes sense to use it

Airtable API offers bulk operations. Why not support it in Airrecord?

Regarding performances and when to use it, that sounds like an Airtable concern, not an Airrecord. Plus, how come one would have to justify how running multiple requests is worst than running a bigger one?

What am I missing?

AdrienGiboire avatar Mar 28 '25 13:03 AdrienGiboire

I don't think you're missing anything -- some combination of those two PRs that includes tests and documentation would probably be pretty good! Neither PR on its own was ready to merge, nor is this one.

Meekohi avatar Mar 29 '25 14:03 Meekohi