Skip to content

Instantly share code, notes, and snippets.

@alanhoff
Created November 6, 2014 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alanhoff/b7b1394efb92c3a9a46c to your computer and use it in GitHub Desktop.
Save alanhoff/b7b1394efb92c3a9a46c to your computer and use it in GitHub Desktop.
// Biblioteca responsável pela conexão no banco de dados
var level = require('levelup');
var config = require(__dirname + '/config');
var db = level(config.get('connection'));
var conns = {
_db: db // Para acesso direto ao LevelDB
};
conns.find = function(value, callback){
//do something...
// this._db ou db
db.get(value, callback);
}
module.exports = conns;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment