var promise = require('bluebird'); var options = { promiseLib: promise }; var pgp = require('pg-promise')(options); var connection = Connections.pg_sjy_gis; var db = pgp(connection); exports.getAll = function (tab_name) { var res = db.query('select * from ' + tab_name); return res; };