Playground & Docs
Maps @vibecode-db/client queries to standard REST endpoint conventions. No peer dependencies required.
import { createClient } from '@vibecode-db/client';
import { RestAdapter } from '@vibecode-db/client/adapters/rest';
const adapter = new RestAdapter({
baseUrl: 'https://api.example.com',
headers: {
Authorization: 'Bearer your-token',
},
});
const client = createClient('', '', { adapter });
| Operation | HTTP Method | URL |
|---|---|---|
select('*') | GET | /table?filters |
insert(data) | POST | /table |
update(data).eq('id', x) | PATCH | /table/x |
delete().eq('id', x) | DELETE | /table/x |
upsert(data) | PUT | /table |
rpc('fn', args) | POST | /rpc/fn |
| Option | Type | Description |
|---|---|---|
baseUrl | string | Base URL for the REST API |
headers | Record<string, string> | Default headers for all requests |
fetch | typeof fetch | Custom fetch function (defaults to global) |
const adapter = new RestAdapter({
baseUrl: 'https://api.example.com',
fetch: myCustomFetch,
});