# postgrest-request

> Request abstraction for postgrest

Latest version **0.0.1** (published 2015-07-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install postgrest-request
pnpm add postgrest-request
yarn add postgrest-request
bun add postgrest-request
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2015-07-26 |
| First published | 2015-07-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+7 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 11 |
| Author | Jared Lewis |
| Maintainers | lewisjared |
| Keywords | http, postgres, postgrest, request |

## Links

- npm: https://www.npmjs.com/package/postgrest-request
- Repository: https://github.com/lewisjared/postgrest-request
- Homepage: https://github.com/lewisjared/postgrest-request#readme
- Issues: https://github.com/lewisjared/postgrest-request/issues
- npm.io page: https://npm.io/package/postgrest-request

## Dependencies (3)

- [util](https://npm.io/package/util.md) ^0.10.3
- [lodash](https://npm.io/package/lodash.md) ^3.10.0
- [superagent](https://npm.io/package/superagent.md) ^1.2.0

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2015-07-26

## README

# Postgres-request
![Travis build status](https://travis-ci.org/lewisjared/postgrest-request.svg?branch=master)

Providing a interface to query a [postgrest](https://github.com/begriffs/postgrest) instance.

## Installation
```
npm install postgrest-request
```

## Usage
postgrest-request wraps the functionality of [superagent](http://visionmedia.github.io/superagent/). Therefore the query syntax is identical. Full
documentation for building queries is available from [superagent](http://visionmedia.github.io/superagent/).

The following code segment queries https://postgrest.herokuapp.com/festival

```
var config = {
  host: 'postgrest.herokuapp.com',
  method: 'https',
  post: 443
};
var postgrest = require('postgrest-request')(config);

postgrest.get('/festival')
  .end(function (err, data ) {
    console.log(err, data.body);
  });
```

### Filtering
The request can be filtered using the `.where()` option. The following code snippet gets all festivals with a rating greater than 7.
```
postgrest.get('/festival')
  .where({
    gt: {
      rating: 7
    }
  })
  .end(function (err, data ) {
    console.log(err, data.body);
  });
```
See https://github.com/begriffs/postgrest/wiki/Routing#filtering for filtering options

## License
MIT

---
_Source: https://npm.io/package/postgrest-request · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
