pg-concat
Takes an array of parts and returns the necessary PostgreSQL expression to concatenate them.
Usage
const pgConcat = require('pg-concat')
const concatString = pgConcat(
[
{ columnName: 'incident_no' },
'/',
{ columnName: 'year', default: 1900 },
]
)
// concatString = 'incident_no||'/'||COALESCE(year, 1900)'
Install
$ npm install pg-concat --save