Created
September 6, 2017 19:03
-
-
Save kissmygritts/8af58be2b8a734cdca3a0e1f148a9bbf to your computer and use it in GitHub Desktop.
how to access the QueryFile from a repo/sql for testing formatting.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const promise = require('bluebird') | |
const _ = require('lodash') | |
const argv = require('minimist')(process.argv.slice(2)) | |
const config = require('../config/database.json')[argv.e] | |
const options = { promiseLib: promise } | |
const pgp = require('pg-promise')(options) | |
const db = pgp(config) | |
const sql = require('../sql') | |
module.exports = { | |
tables: () => { | |
const query = pgp.helpers.concat(_.values(sql.tables)) | |
console.log(query) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment