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

creating graph in sublevel #52

Closed
elf-pavlik opened this issue Jan 2, 2014 · 2 comments · Fixed by #53
Closed

creating graph in sublevel #52

elf-pavlik opened this issue Jan 2, 2014 · 2 comments · Fixed by #53

Comments

@elf-pavlik
Copy link
Member

$ npm install levelup leveldown level-sublevel levelgraph

then running code

var LevelUp = require('levelup'),
    Sublevel = require('level-sublevel'),
    LevelGraph = require('levelgraph');

var db = Sublevel(LevelUp('dev.ldb')),  
    graphdb = LevelGraph(db.sublevel('graph'));

results in

/code/play/levelgraph-sublevel/node_modules/levelgraph/lib/levelgraph.js:75
    , close: leveldb.close.bind(leveldb)
                           ^
TypeError: Cannot call method 'bind' of undefined
    at levelgraph (/code/play/levelgraph-sublevel/node_modules/levelgraph/lib/levelgraph.js:75:28)
    at Object.<anonymous> (/code/play/levelgraph-sublevel/index.js:6:15)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:901:3
@mcollina
Copy link
Collaborator

mcollina commented Jan 2, 2014

This is fun, I planned to add close to sublevel ;). I think we can just
function wrap close instead of using bind, and let it throw if close is not
there, or silently do nothing. Would you like to assemble a PR for this?

@elf-pavlik
Copy link
Member Author

I don't have much experience with LevelDB... would prefer to focus on few other RDF related issues first and in between follow commits of you and other experienced in this field folks so I can catch up on all the LevelDB arcane techniques 🎒

mcollina added a commit that referenced this issue Jan 3, 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 a pull request may close this issue.

2 participants