Options
All
  • Public
  • Public/Protected
  • All
Menu

postgrest-js

Build Package License: MIT

Isomorphic JavaScript client for PostgREST. The goal of this library is to make an "ORM-like" restful interface.

Full documentation can be found here.

Quick start

Install

npm install @supabase/postgrest-js

Usage

import { PostgrestClient } from '@supabase/postgrest-js'

const REST_URL = 'http://localhost:3000'
const postgrest = new PostgrestClient(REST_URL)

Custom fetch implementation

postgrest-js uses the 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:

import { PostgrestClient } from '@supabase/postgrest-js'

const REST_URL = 'http://localhost:3000'
const postgrest = new PostgrestClient(REST_URL, { fetch: fetch })

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

Index

Type aliases

Fetch

Fetch: typeof fetch

FilterOperator

FilterOperator: "eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "like" | "ilike" | "is" | "in" | "cs" | "cd" | "sl" | "sr" | "nxl" | "nxr" | "adj" | "ov" | "fts" | "plfts" | "phfts" | "wfts" | "not.eq" | "not.neq" | "not.gt" | "not.gte" | "not.lt" | "not.lte" | "not.like" | "not.ilike" | "not.is" | "not.in" | "not.cs" | "not.cd" | "not.sl" | "not.sr" | "not.nxl" | "not.nxr" | "not.adj" | "not.ov" | "not.fts" | "not.plfts" | "not.phfts" | "not.wfts"

Filters

PostgrestError

PostgrestError: { code: string; details: string; hint: string; message: string }

Type declaration

  • code: string
  • details: string
  • hint: string
  • message: string

PostgrestMaybeSingleResponse

PostgrestMaybeSingleResponse<T>: PostgrestSingleResponse<T | null>

Type parameters

  • T

PostgrestResponse

Type parameters

  • T

PostgrestSingleResponse

Type parameters

  • T

Variables

Const version

version: "0.0.0-automated" = "0.0.0-automated"

Object literals

Const DEFAULT_HEADERS

DEFAULT_HEADERS: object

X-Client-Info

X-Client-Info: string = `postgrest-js/${version}`

Legend

  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited method
  • Property
  • Protected property

Generated using TypeDoc