General purpose type-safe TypeScript client for PostgREST.
The PostgREST Client is a type-safe TypeScript client designed for use with PostgREST. It allows for efficient and straightforward interaction with PostgREST APIs, offering a comprehensive suite of features for various operations.
prefer: return=
headerprefer: missing=
headerprefer: resolution=
headerprefer: return=
headerTo get started with the PostgREST Client detailed instructions are available in our Getting Started Documentation.
Using schema from PostgREST documentation for examples.
import {
PostgrestClient,
type PostgresTable,
} from '@sassoftware/postgrest-client';
type DB = {
films: PostgresTable<{ id: number; title: string }, 'id'>;
};
const pgClient = new PostgrestClient<DB>({ base: '/api' });
const { rows } = await pgClient.get({ query: pgClient.query('films') });
For more examples and detailed usage instructions, visit our Queries Documentation.
We welcome your contributions! Please read CONTRIBUTING.md for details on how to submit contributions to this project.
This project is licensed under the Apache 2.0 License.