this repo has no description
Electric SQL synced collection#
Live queries use Electric SQL to keep client-side data in sync with the server database in real time. Instead of polling or manual refetching, database changes are pushed to connected clients automatically.
How it works#
- The client establishes a sync connection to the Electric SQL server
- A live query is defined using the TanStack DB collection API
- When database records change, updates stream to connected clients
- The UI re-renders automatically with fresh data
Benefits#
- Real-time updates: Changes appear immediately without manual refresh
- Offline support: Local data remains available during connectivity interruptions
- Multi-user: All connected clients see each other's changes in real time
Trade-offs#
Live queries require the Electric SQL sync infrastructure. They introduce additional complexity compared to simple REST fetching but are the right choice for collaborative or real-time applications where data freshness matters.