pg-require-sql

1.0.0 • Public • Published

pg-require-sql

js-standard-style Circle CI Dependency Status

'Require' sql files for use with pg-connect.

Installation

npm install --save pg-require-sql

Usage

Given a project like

|- index.js
|- sql-directory
  |- get-record.sql

the following will query

var Promise = require('bluebird')
var path = require('path')
var getConnection = require('pg-connect')(connectionString)
var requireSql = require('pg-require-sql')
 
var sql = requireSql(path.join(__dirname, 'sql-directory'))
 
Promise.using(
  getConnection(),
  sql.getRecord(['foo'])
).
then(function (results) {
  // ... use the results
})

Readme

Keywords

Package Sidebar

Install

npm i pg-require-sql

Weekly Downloads

37

Version

1.0.0

License

MIT

Last publish

Collaborators

  • showvhick-winmore
  • arpit1024
  • rahulbharadwaj
  • jasif-wm
  • shyam.mohan
  • qbibrahim
  • sidharth.n
  • hariqb
  • arjuncprasannan
  • renjith_ram_qburst
  • anasqburst
  • jyothis-qb
  • qburst-pratyush
  • cdrohithmqb
  • sudheeshqburst
  • davoodul
  • mable-liza-mathew
  • sowmyab
  • anoop-kuttikkattu
  • munisa
  • dheerajds
  • arjunqb
  • ashishqburst
  • lanetix-system
  • manu-kodiyan-winmore
  • dnm-winmore
  • mkdyanugk
  • vigneshk7
  • soumyaarun
  • aswanth
  • sajith.qb
  • dhiluraj-qburst
  • anandqb
  • arun-dtk
  • vikasqb
  • acpradosh1234
  • apechimp