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

support setItems and getItems for operation batching #198

Closed
1 task done
ManUtopiK opened this issue Apr 10, 2023 · 2 comments · Fixed by #240
Closed
1 task done

support setItems and getItems for operation batching #198

ManUtopiK opened this issue Apr 10, 2023 · 2 comments · Fixed by #240
Labels
enhancement New feature or request

Comments

@ManUtopiK
Copy link

ManUtopiK commented Apr 10, 2023

Describe the feature

I'm currently building a driver for gitlab. #199
I just forked the github driver, write tests, adapted fetchFiles and getItem for gitlab api, and done !

What I want to do is to provide a feature to setItem with a create/commit http post request.
But I don't want to commit each files one by one, I want to commit a bunch of files, with a commit message passed in opts and update the store internally with the http response.

A setItems function could be useful to do that. I think it could also be implemented for the github driver.

Additional information

  • Would you be willing to help implement this feature?
@ManUtopiK
Copy link
Author

Maybe also getItems, to fetch a bunch of files in one shot...

@pi0
Copy link
Member

pi0 commented Apr 10, 2023

Both seems good ideas for support operation batching! PR more than welcome 💯

Core exposes them and reuses whenever driver allows. Otherwise falls back to individual setItem/getItem with Promise.all.

Only note to consider for getItems and little bit tricky to implement, is to call this on a path mountpoin when there is more than one driver mounted. We need to first map paths to their drivers and group the batches with sub-function calls.

@pi0 pi0 added the enhancement New feature or request label Apr 10, 2023
@pi0 pi0 changed the title Add a setItems function. support setItems and getItems for operation batching Apr 10, 2023
@pi0 pi0 closed this as completed in #240 Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants