Skip to content

nmccready/bookshelf.raw.safe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bookshelf.raw.safe

Bookshelf raw extensions to handle things in a safe manner

The idea is to pass error handling up the chain to express, and to always be returning (bluebird) promises.

var safeBookShelf = require('bookshelf.raw.safe')(loggerOfYourChoice);
var safeQuery = safeBookShelf.safeQuery;

# db = bookshelf instance / connection
# next is an error callback function passing an error up (intended for express)

var callingFnName = 'getAll';
var getAll = function(){
  safeQuery(db, sqlString, next, callingFnName);
};

About

Bookshelf raw extensions to handle things in a safe manner

Resources

Stars

Watchers

Forks

Packages

No packages published