ipfs / go-datastore

key-value datastore interfaces
MIT License
230 stars 65 forks source link

add context parameter to datastore interface #174

Closed lanzafame closed 3 years ago

lanzafame commented 3 years ago

This PR adds context.Context as the first parameter to the datastore interface. This allows for tracing and metrics tools to pass through the datastore interface, providing a better understanding of performance.

To allow for backwards compatibility, I would recommend that this be part of go-datastore/v2 allowing downstream packages to upgrade at their leisure.

lanzafame commented 3 years ago

@Stebalien thoughts? I can't request reviewers anymore it seems...

Stebalien commented 3 years ago

Is this just a rebase of https://github.com/ipfs/go-datastore/pull/161/files?

lanzafame commented 3 years ago

It isn't because I failed to search PRs when checking whether this was done, and only searched issues. 🤦

aschmahmann commented 3 years ago

Oops, sorry @lanzafame clicked the wrong PR by accident. We're merging #181

lanzafame commented 3 years ago

@aschmahmann no worries, just happy to see this has finally happened