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

Adding Level adapter support for Sublevel and Multilevel #224

Merged
merged 2 commits into from
Sep 2, 2014
Merged

Adding Level adapter support for Sublevel and Multilevel #224

merged 2 commits into from
Sep 2, 2014

Conversation

mshick
Copy link
Contributor

@mshick mshick commented Sep 2, 2014

I needed support for both these for a current project. Fairly straightforward implementation using Net.connect().

Summary of changes:

  • Update local module requires to support LevelUp and Multilevel as well as Level
  • Update adapter init to branch logic for Multilevel vs. plain Level
  • Update config to support a sublevel name, and handle in init (will attempt a local require for level-sublevel, and throw an error if it doesn't exist).
  • Update config to disable / modify keyPrefix (to avoid duplicate prefixes when using sublevels)
  • Add connect/disconnect methods which I really uncertain of. Docs indicate they are just for getting connection feedback, but the mongo adapter seems to use them for acquiring the db connection itself. I followed the docs.

@mde
Copy link
Contributor

mde commented Sep 2, 2014

Adapter adapters, this is great! Excellent work, thanks for implementing this. I'm going to get the tests passing then merge this.

@mshick
Copy link
Contributor Author

mshick commented Sep 2, 2014

Thanks! Adapter adapters sounds scary to me, but hopefully this is a special case...

@mde
Copy link
Contributor

mde commented Sep 2, 2014

Exactly -- "adapters all the way down" doesn't sound optimal. The tests were breaking due to a recent Jake update. Should be merged shortly. :)

mde added a commit that referenced this pull request Sep 2, 2014
Adding Level adapter support for Sublevel and Multilevel
@mde mde merged commit 2a16d73 into geddy:master Sep 2, 2014
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

Successfully merging this pull request may close these issues.

2 participants