Skip to content

Instantly share code, notes, and snippets.

@kissmygritts
Created September 6, 2017 19:03
Show Gist options
  • Save kissmygritts/8af58be2b8a734cdca3a0e1f148a9bbf to your computer and use it in GitHub Desktop.
Save kissmygritts/8af58be2b8a734cdca3a0e1f148a9bbf to your computer and use it in GitHub Desktop.
how to access the QueryFile from a repo/sql for testing formatting.
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