open-index/open-npm huggingface dataset:
npm package: @postgrestx/core
Description: Minimal PostgREST client: typed options, preferences, error normalization.
Latest version: 0.2.1

# @postgrestx/core

Minimal PostgREST client: typed options, preferences, error normalization.

👉 Full docs: https://samuelagm.github.io/postgrestx/core • API: https://samuelagm.github.io/postgrestx/api/core/src/README

---

## Install

```bash
pnpm add @postgrestx/core
```

## Tiny Example

```ts
import { PostgrestClient, createFetchHttpClient } from '@postgrestx/core'
const client = new PostgrestClient(
  'https://example.com',
  createFetchHttpClient(),
)
const { data } = await client.select('people', { select: 'id,name', limit: 10 })
```

See docs for filters, ranges, mutations, RPC, preferences, and type generation.

---

## Type Generation (CLI)

```bash
pnpm --filter @postgrestx/core exec postgrestx-generate --input openapi.json --out packages/core/src/types/generated
```

More usage & testing hooks in the documentation.

---

## License

MIT
npm package: @postgrestx/tanstack
Description: React + TanStack Query hooks for PostgREST.
Latest version: 0.2.1

# @postgrestx/tanstack

React + TanStack Query hooks for PostgREST.

👉 Full React guide: https://samuelagm.github.io/postgrestx/tanstack • API: https://samuelagm.github.io/postgrestx/api/tanstack/src/README

---

## Install

```bash
pnpm add @postgrestx/tanstack @postgrestx/core @tanstack/react-query react react-dom
```

## Minimal Setup

```tsx
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { PostgrestProvider } from '@postgrestx/tanstack'
import { PostgrestClient, createFetchHttpClient } from '@postgrestx/core'

const client = new PostgrestClient(
  'https://example.com',
  createFetchHttpClient(),
)
const qc = new QueryClient()

export function App({ children }: { children: React.ReactNode }) {
  return (
    <QueryClientProvider client={qc}>
      <PostgrestProvider value={{ client }}>{children}</PostgrestProvider>
    </QueryClientProvider>
  )
}
```

## Example Hook

```tsx
import { useList } from '@postgrestx/tanstack'

function Users() {
  const q = useList('users', { select: 'id,name', limit: 10 })
  if (q.isLoading) return <p>Loading…</p>
  return (
    <ul>
      {q.data?.data.map((u) => (
        <li key={u.id}>{u.name}</li>
      ))}
    </ul>
  )
}
```

Included hooks: `useList`, `useItem`, `useInfiniteList`, `useInsert`, `useUpdate`, `useDelete`, `useUpsert`, `useRpc` plus `pgKey`, `invalidateTable`, `invalidateRpc`.

See docs for infinite queries, mutations, custom factories, cache keys.

---

## License

MIT