Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/supabase/postgrest-js
Isomorphic JavaScript client for PostgREST.
https://github.com/supabase/postgrest-js
postgrest supabase
Last synced: 27 days ago
JSON representation
Isomorphic JavaScript client for PostgREST.
- Host: GitHub
- URL: https://github.com/supabase/postgrest-js
- Owner: supabase
- License: mit
- Created: 2020-01-27T05:32:19.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-11T20:53:27.000Z (7 months ago)
- Last Synced: 2024-04-13T21:54:15.945Z (7 months ago)
- Topics: postgrest, supabase
- Language: TypeScript
- Homepage: https://supabase.com
- Size: 2.13 MB
- Stars: 917
- Watchers: 28
- Forks: 123
- Open Issues: 92
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - supabase/postgrest-js - Isomorphic JavaScript client for PostgREST. (TypeScript)
README
# `postgrest-js`
[![Build](https://github.com/supabase/postgrest-js/workflows/CI/badge.svg)](https://github.com/supabase/postgrest-js/actions?query=branch%3Amaster)
[![Package](https://img.shields.io/npm/v/@supabase/postgrest-js)](https://www.npmjs.com/package/@supabase/postgrest-js)
[![License: MIT](https://img.shields.io/npm/l/@supabase/postgrest-js)](#license)Isomorphic JavaScript client for [PostgREST](https://postgrest.org). The goal of this library is to make an "ORM-like" restful interface.
Full documentation can be found [here](https://supabase.github.io/postgrest-js/v2).
### Quick start
Install
```bash
npm install @supabase/postgrest-js
```Usage
```js
import { PostgrestClient } from '@supabase/postgrest-js'const REST_URL = 'http://localhost:3000'
const postgrest = new PostgrestClient(REST_URL)
```- select(): https://supabase.com/docs/reference/javascript/select
- insert(): https://supabase.com/docs/reference/javascript/insert
- update(): https://supabase.com/docs/reference/javascript/update
- delete(): https://supabase.com/docs/reference/javascript/delete#### Custom `fetch` implementation
`postgrest-js` uses the [`cross-fetch`](https://www.npmjs.com/package/cross-fetch) library to make HTTP requests, but an alternative `fetch` implementation can be provided as an option. This is most useful in environments where `cross-fetch` is not compatible, for instance Cloudflare Workers:
```js
import { PostgrestClient } from '@supabase/postgrest-js'const REST_URL = 'http://localhost:3000'
const postgrest = new PostgrestClient(REST_URL, {
fetch: (...args) => fetch(...args),
})
```## License
This repo is licensed under MIT License.
## Sponsors
We are building the features of Firebase using enterprise-grade, open source products. We support existing communities wherever possible, and if the products don’t exist we build them and open source them ourselves. Thanks to these sponsors who are making the OSS ecosystem better for everyone.
[![New Sponsor](https://user-images.githubusercontent.com/10214025/90518111-e74bbb00-e198-11ea-8f88-c9e3c1aa4b5b.png)](https://github.com/sponsors/supabase)