query-creator
v0.0.6
Published
Create SQL queries
Downloads
10
Maintainers
Readme
Sql Query Creator
A small nodejs module to create nice SQL queries without any dependency
Install
npm install query-creator
And then, import it:
const qc = require("query-creator");
Usage
let query = qc.new()
.select([
'fieldOne',
'fieldTwo'
], 'myTable')
.where( 'fieldOne = ?', [4])
.groupBy( 'fieldTwo' )
.val();
// now, query variable is :
// SELECT fieldOne, fieldTwo FROM myTable WHERE fieldOne = 4 GROUP BY fieldTwo;