Electric SQL syncs Postgres with local SQLite for local-first apps with real-time sync.
Sync + Local Queries
const electric = await electrify(db, schema, { url: "https://electric.example.com" });
// Sync specific data
await electric.db.posts.sync({ where: { status: "published" } });
// Instant local reads
const posts = await electric.db.posts.findMany({ orderBy: { createdAt: "desc" } });
// Instant local writes (synced in background)
await electric.db.posts.create({ data: { title: "Hello", authorId: userId } });
React
const { results } = useLiveQuery(electric.db.posts.liveMany());
Key Features
- Local-first with Postgres sync
- Instant reads/writes
- Conflict-free replication
- Works offline
- React live queries
Need to scrape or monitor web data at scale? Check out my web scraping actors on Apify or email spinov001@gmail.com for custom solutions.
Top comments (0)