sql-str 
A tiny (667B) utility for building SQL statement strings~!
This module exposes three module definitions:
- ES Module:
dist/sql-str.mjs
- CommonJS:
dist/sql-str.js
- UMD:
dist/sql-str.min.js
Install
$ npm install --save sql-str
Usage
import { toQuery } from 'sql-str';
let toAdd = { username: 'lukeed', age: 100 };
let insert = toQuery('users', 'insert', { values:toAdd, returning:true });
let where = { age:'≥18', username:'≠foobar' };
let select = toQuery('users', 'select', { where, limit:25, offset:50 });
API
toQuery(table, action, opts)
Returns: Object
toOperator(value)
Returns: Array
Splits the value into a [operator, value] tuple. If the value does not start with an operator, then = is assumed.
License
MIT © Luke Edwards