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

Refactor the Datastore API to be generic #11

Open
michaelsbradleyjr opened this issue Jun 22, 2022 · 0 comments
Open

Refactor the Datastore API to be generic #11

michaelsbradleyjr opened this issue Jun 22, 2022 · 0 comments

Comments

@michaelsbradleyjr
Copy link
Contributor

michaelsbradleyjr commented Jun 22, 2022

This will allow more flexibility re: key and data parameters.

Because Nim's method facility doesn't support generics and because multi-methods are deprecated, we'll need to choose from one of several options:

  • vtable approach as seen in e.g. nim-faststreams
  • The approach taken in nim-eth's kvstore.nim
  • Defining the core API in datastore/datastore.nim such that it is intended to be consumed by implementors of Datastore via include instead of import.

Note: the last option is currently considered the least desirable per previous team discussion, but I've included it in the list of possible approaches because it can work even if there are reasons to avoid it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant