An open API service indexing awesome lists of open source software.

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

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
```