Backends
Data
Query your Postgres tables from the client, with row-level security and generated types.
ts
const { data: todos } = await phz
.from('todos')
.select('id, title, done')
.eq('done', false)
.order('created_at', { ascending: false });
await phz.from('todos').insert({ title: 'Ship it' });
await phz.from('todos').update({ done: true }).eq('id', id);
await phz.rpc('my_function', { arg: 1 });Row-level security applies to every query made with the publishable key and a signed-in user's session.
Types
terminal
npx @pherwerz/cloud gen types --db-url "$DATABASE_URL" --out database.types.tsts
import type { Database } from './database.types';
export const phz = createClient<Database>(url, publishableKey);Table names, columns, filters, select results and insert and update
payloads are then all type-checked.