Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-09-27T21:46:58.000Z (4 months ago)
- Last Synced: 2024-10-14T11:08:17.758Z (3 months ago)
- Topics: pg, postgresql, tymly
- Language: JavaScript
- Homepage:
- Size: 303 KB
- Stars: 0
- Watchers: 8
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# pg-concat
[![Tymly Package](https://img.shields.io/badge/tymly-package-blue.svg)](https://tymly.io/) [![npm (scoped)](https://img.shields.io/npm/v/@wmfs/pg-concat.svg)](https://www.npmjs.com/package/@wmfs/pg-concat) [![CircleCI](https://circleci.com/gh/wmfs/pg-concat.svg?style=svg)](https://circleci.com/gh/wmfs/pg-concat) [![codecov](https://codecov.io/gh/wmfs/pg-concat/branch/master/graph/badge.svg)](https://codecov.io/gh/wmfs/pg-concat) [![CodeFactor](https://www.codefactor.io/repository/github/wmfs/pg-concat/badge)](https://www.codefactor.io/repository/github/wmfs/pg-concat) [![Dependabot badge](https://img.shields.io/badge/Dependabot-active-brightgreen.svg)](https://dependabot.com/) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) [![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/wmfs/tymly/blob/master/packages/pg-concat/LICENSE)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fwmfs%2Fpg-concat.svg?type=shield)](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)[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fwmfs%2Fpg-concat.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fwmfs%2Fpg-concat?ref=badge_large)