@wmfs/pg-concat
v1.17.0
Published
Takes an object with parts from table and outputs sql statement.
Downloads
22
Readme
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