Skip to content

API for accessing ETag values #55

@alexanderwhatley

Description

@alexanderwhatley

As discussed in #54, I think it would be a good idea of exposing API functions that can explicitly access the value of the ETag of the firebase db.

We could have the following API for the Reference class:

get(self, etag=False) # When etag is True, behaves like _get_with_etag()
set(self, value, etag=None) # When etag is not None, behaves like _update_with_etag()
get_etag(self) # Retrieves the etag without the corresponding data
check_etag(self, etag) # Returns a boolean indicating whether or not the etag is correct

These API functions could come in handy for low level operations that the user may want to perform that the proposed transaction functionality may not be able to handle. An example would be if the user keeps a cache of some of the firebase data, the user will likely want to keep track of the ETag for each part of the database, so he can check whether the data in some part of the cache is up to date.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions