Noncommital Premarital Mischief

    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
    })

    Install

    npm i pg-require-sql

    DownloadsWeekly Downloads

    22

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • jyothis-qb
    • qburst-pratyush
    • cdrohithmqb
    • arunks_qburst
    • sudheeshqburst
    • davoodul
    • athul-qburst
    • 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