Realtime
Subscribe to any deployed read query.
Open views share one connection and advance together on each commit. Unshared rows leave at once, and readable records host live presence rooms.
Read the live queries docsLive queries
Subscribe to a query by name.
The client receives the initial result and then field-level patches over one shared stream as commits change matching rows. Lists and detail views on a screen advance on the same snapshot.
Live streams APIimport { deployed } from 'napalm-client' const subscription = napalm.subscribe(deployed('listNotes'), {}, { onRows: ({ rows }) => renderNotes(rows), onError: (error) => reportError(error),}) // Later, when the view unmounts:subscription.close()Revoked access
Revoked rows leave the screen at once.
Every live update checks your schema’s access policies as the authenticated caller. Unsharing a note or revoking a key drops restricted rows from open streams on the same commit.
update Notefilter .id = <uuid>$noteset { shared_with -= (select Person filter .id = <uuid>$person) }Terminal watch
Watch a live query from the terminal.
napalm watch streams the initial rows and every commit patch to your terminal while you edit schemas, triggers and access rules.
napalm watch notes "select Note { title, updated_at }"Presence rooms
Share live presence on any readable record.
Join a record’s room over the same live connection to share cursors, status and peer messages without writing to the database. Callers without read access receive not_found, and members leave the room when access ends.
Presence roomsconst room = napalm.presence(noteId) room.set({ cursor: { line: 18, ch: 4 }, status: 'editing' })room.send({ kind: 'selection', range: [120, 148] }) const stopPeers = room.onChange((peers) => renderCursors(peers))const stopMessages = room.onMessage(({ data }) => applySelection(data)) // When the editor closes:room.leave()React and Flutter
Generate live hooks for React and Flutter.
napalm generate creates typed React hooks and Dart streams for every read-only query. Open components share one connection, and hidden tabs pause to save slots.
import { useGetNote } from './napalm/hooks' export function NoteView({ id }: { id: string }) { const { rows } = useGetNote({ id }) return <h1>{rows?.[0]?.title}</h1>}Subscription budget
Open 1,000 subscriptions for each GiB of engine memory.
One project-wide budget covers every open stream, engine and branch. Larger engines raise the budget. Client SDKs pause hidden views to free slots, and reconnecting streams resume from the last bookmark without stale reads.
1,000subscriptions for each GiB of engine memory