0.1.2 • Published 5 years ago

sql-behind v0.1.2

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

sql-behind

program CODE and SQL are stored in separate files

Installation

$ npm install sql-behind

Usage

// test.js
var sqlBehind = require('sql-behind');

var retSB = sqlBehind('query1', {FLD1:'1', FLD2:'a'});

if(retSB){
    console.log('sqlString: ' + retSB.sqlString);
    console.log('paramArray: ' + retSB.paramArray);
} else {
    console.log('sql not found');
}

sql-behind file example

-- test.sql
/**
 * @name query1
 * @desc Get data from TBL1
 * @param :FLD1 - Search condition of FLD1
 * @param :FLD2 - Search condition of FLD2
 * @return TBL1 result set
 */
SELECT
  FLD1
 ,FLD2
 ,FLD2
FROM TBL1
WHERE FLD1 = :FLD1
  AND FLD2 = :FLD2

Licence

MIT

Author

nmrmsys

0.1.2

5 years ago

0.1.1

6 years ago

0.0.3

6 years ago

0.1.0

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago