Realtime

Stream live updates from any deployed read query.

Open views share one connection and advance together on each commit. Revoking read access drops restricted rows right away, and any readable record can host a presence room.

Read the live queries docs

Live queries

Receive compact row diffs as transactions commit.

Subscribers receive the initial query result followed by minimal row patches over one shared stream as commits land. Lists, counters and detail panes on a screen advance together on one snapshot.

Live streams API
app/notes.ts
import { 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()

Live access enforcement

Pull revoked records off the screen on the same commit.

Every outbound patch re-checks your schema’s access policies for that subscriber. Unsharing a document or revoking a credential removes restricted rows from open streams immediately.

dbschema/queries/unshareNote.edgeql
update Notefilter .id = <uuid>$noteset { shared_with -= (select Person filter .id = <uuid>$person) }
Access rules on live streams

CLI watcher

Inspect live query patches straight from your terminal.

Run napalm watch while developing to print the initial rows and watch real-time commit diffs arrive as you test mutations, triggers and access rules.

Terminal
napalm watch notes "select Note { title, updated_at }"
Client SDKs and CLI watcher

Presence rooms

Broadcast cursors and room state on any readable record.

Join a record’s room over the same live connection to share cursors, typing status and peer messages without database writes. Callers without read access receive not_found, and members disconnect if access ends.

Presence rooms
app/editor.ts
const 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()

UI bindings

Drop generated hooks into React, Next.js and Flutter.

napalm generate emits typed React hooks and Dart streams for every read-only query. Mounted components share one connection, and hidden tabs pause automatically.

src/NoteView.tsx
import { useGetNote } from './napalm/hooks' export function NoteView({ id }: { id: string }) {  const { rows } = useGetNote({ id })  return <h1>{rows?.[0]?.title}</h1>}
TypeScript live hooks

Stream capacity

Support 1,000 active subscriptions per GiB of engine memory.

Active subscriptions draw from one pool across your query engines with zero per-message fees. Scaling engine memory raises the ceiling online, and reconnecting streams resume from their last bookmark.

1,000subscriptions per GiB of engine memory

The subscription limit