pgsql-write-builders
Generates INSERT and UPDATE SQL statements for Postgres from JS objects and arrays
Installation:
npm i pgsql-write-builders
Usage:
'use strict'const writeSql = const thingsToInsert = name: 'Thing 1' color: 'Red' name: 'Thing 2' color: 'Blue' writeSql const thingToUpdate = id: 100 name: 'Thing 1 (edited)' color: 'Green' writeSql // Promises are also supported writeSql writeSql
Why:
Writing UPDATE and INSERT SQL statements isn't terribly fun, this helps a little with that :)