https://github.com/wmfs/pg-concat
Takes an array of parts and returns the necessary PostgreSQL expression to concatenate them.
https://github.com/wmfs/pg-concat
pg postgresql tymly
Last synced: 3 months ago
JSON representation
Takes an array of parts and returns the necessary PostgreSQL expression to concatenate them.
- Host: GitHub
- URL: https://github.com/wmfs/pg-concat
- Owner: wmfs
- License: mit
- Created: 2018-06-08T10:40:04.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2025-02-16T00:42:02.000Z (5 months ago)
- Last Synced: 2025-04-19T10:21:33.834Z (3 months ago)
- Topics: pg, postgresql, tymly
- Language: JavaScript
- Homepage:
- Size: 306 KB
- Stars: 0
- Watchers: 6
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# pg-concat
[](https://tymly.io/) [](https://www.npmjs.com/package/@wmfs/pg-concat) [](https://circleci.com/gh/wmfs/pg-concat) [](https://codecov.io/gh/wmfs/pg-concat) [](https://www.codefactor.io/repository/github/wmfs/pg-concat) [](https://dependabot.com/) [](http://commitizen.github.io/cz-cli/)
[](https://standardjs.com) [](https://github.com/wmfs/tymly/blob/master/packages/pg-concat/LICENSE)
[](https://app.fossa.io/projects/git%2Bgithub.com%2Fwmfs%2Fpg-concat?ref=badge_shield)> 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
```bash
$ npm install pg-concat --save
```## License
[MIT](https://github.com/wmfs/pg-concat/blob/master/LICENSE)[](https://app.fossa.io/projects/git%2Bgithub.com%2Fwmfs%2Fpg-concat?ref=badge_large)