pocketbase icon indicating copy to clipboard operation
pocketbase copied to clipboard

Introduce backups service.

Open slobberchops opened this issue 1 year ago • 1 comments

  • Support create(), get_full_list(), download() and delete()

  • Refactored Client.send() to support binary responses.

  • Added Client.send_raw() which returns raw bytes from HTTP response.

It was not possible to support any of the standard API CRUD operations provided by the BaseCrudService on account of the Backups API returning very different structures in most requests and responses. It would have required changing the interface for the class which seemed dangerous. Therefore, the API for Backups is a little more bespoke.

The tests for the Backups API is also a little different in that it seems like a somewhat heavier type of operation than other operations and lent itself better to doing verification that the underlying APIs were in fact called.

The download interface also has an optional parameter for file_token. Not providing one is easier to use, but could create a poor usage pattern as it is more inefficient for multiple download calls. If the reviewer could provide feedback as to whether it is desirable or acceptable it would be welcome.

slobberchops avatar May 11 '24 14:05 slobberchops

I have verified that test workflow runs and all tests pass for all supported Python versions.

slobberchops avatar May 11 '24 14:05 slobberchops

@slobberchops Thanks a lot for your contribution. Sorry for the wait.

vaphes avatar May 25 '24 16:05 vaphes

Pull Request Test Coverage Report for Build 9044392827

Details

  • 43 of 43 (100.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.5%) to 91.117%

Totals Coverage Status
Change from base Build 8850640839: 0.5%
Covered Lines: 834
Relevant Lines: 888

💛 - Coveralls

coveralls avatar May 25 '24 16:05 coveralls

Pull Request Test Coverage Report for Build 9044392827

Details

  • 43 of 43 (100.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.5%) to 91.117%

Totals Coverage Status
Change from base Build 8850640839: 0.5%
Covered Lines: 834
Relevant Lines: 888

💛 - Coveralls

coveralls avatar May 25 '24 16:05 coveralls