https://github.com/zeroboo/nodejs-coalesce
Implementations of coalesce function in postgres sql
https://github.com/zeroboo/nodejs-coalesce
javascript nodejs npm-module
Last synced: 2 months ago
JSON representation
Implementations of coalesce function in postgres sql
- Host: GitHub
- URL: https://github.com/zeroboo/nodejs-coalesce
- Owner: zeroboo
- Created: 2019-09-17T09:32:35.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T18:40:40.000Z (over 2 years ago)
- Last Synced: 2025-02-07T03:24:05.773Z (4 months ago)
- Topics: javascript, nodejs, npm-module
- Language: JavaScript
- Size: 31.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nodejs-coalesce
Implementation of SQL's coalesce function: return the first argument that is not null# Features
From Postgres document: [https://www.postgresql.org/docs/9.5/functions-conditional.html](https://www.postgresql.org/docs/9.5/functions-conditional.html)> The `COALESCE` function returns the first of its arguments that is not null. Null is returned only if all arguments are null.
# Usage
### Install
```npm
npm install pg-coalesce
```
### Using:
```javascript
const coalesce = require("pg-coalesce");console.log(coalesce(null, "Hello world")); //Hello world
```