Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
oakoss avatar

Electricsql

  • 69 installs
  • 14 repo stars
  • Updated March 2, 2026
  • oakoss/agent-skills

Helps with databases tasks during AI-assisted development.

About

electricsql is a Claude Code skill for databases. It helps solo builders move faster with AI-assisted coding.

  • electricsql
  • Databases
  • AI-coding skill

Electricsql by the numbers

  • 69 all-time installs (skills.sh)
  • +1 installs in the week ending Aug 4, 2026 (Skillselion tracking)
  • Ranked #362 of 911 Databases skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/oakoss/agent-skills --skill electricsql

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs69
repo stars14
Last updatedMarch 2, 2026
Repositoryoakoss/agent-skills

What it does

Helps with databases tasks during AI-assisted development.

Files

SKILL.mdMarkdownGitHub ↗

ElectricSQL

Overview

ElectricSQL is a sync engine that streams partial replicas of Postgres data to local clients via Shapes. It handles the read path — syncing rows from Postgres to the client in real-time using logical replication. Writes flow back through your existing API; Electric syncs the confirmed state back to all connected clients.

When to use: Real-time sync from Postgres to client apps, local-first architectures needing live data from Postgres, replacing polling with streaming updates, apps using TanStack DB with Electric collections, multi-client collaborative apps backed by Postgres.

When NOT to use: Non-Postgres databases, apps needing client-to-server sync built into the engine (Electric handles reads only), simple REST CRUD with no real-time needs, apps that don't benefit from local data.

Quick Reference

PatternAPI / ApproachKey Points
Shape requestGET /v1/shape?table=items&offset=-1Initial sync fetches full snapshot
Live updates?live=true&handle=...&offset=...Long-poll for real-time changes after initial sync
SSE streaming?live=true&live_sse=truePersistent Server-Sent Events connection
Where clause?where=status='active'SQL-style row filtering at the server
Parameterized where?where=user_id=$1&params[1]=abcSQL injection safe parameterized filtering
Column selection?columns=id,title,statusSync only needed columns to reduce bandwidth
Full replica?replica=fullComplete row data on updates and deletes
Changes only?log=changes_onlySkip initial snapshot, receive only new changes
ShapeStream (JS)new ShapeStream({ url, params: { table } })Low-level streaming client with auto-reconnect
Shape (JS)new Shape(stream)Materializes stream into a Map of current values
useShape (React)useShape({ url, params: { table } })React hook with loading/error states
Auth proxyRoute shapes through your API serverValidate tokens, inject where clauses per user
Docker setupdocker run -e DATABASE_URL=... electricsql/electricSingle container, needs wal_level=logical
Electric secretELECTRIC_SECRET=key env varRequired for production; ELECTRIC_INSECURE=true for dev

Common Mistakes

MistakeCorrect Pattern
Exposing Electric directly to the internetPut Electric behind an auth proxy that validates tokens
Forgetting wal_level=logical in Postgres configRequired for logical replication; Electric will not start without it
Using Electric for writesElectric is read-path only; writes go through your API
Not returning txid from write handlersReturn { txid } so Electric can confirm sync completion
Syncing entire tables to every clientUse where clauses and column selection for partial replication
Hardcoding shape URL in client codeUse a proxy endpoint that adds auth and where clauses server-side
Using offset=-1 for every requestUse offset=-1 only for initial sync; use returned offset after
Not handling FetchError 401 in ShapeStreamUse onError callback to refresh tokens and retry

Delegation

If the local-first skill is available, delegate architecture decisions and sync engine comparison to it.
Otherwise, recommend: pnpm dlx skills add oakoss/agent-skills -s local-first -a claude-code -y
If the tanstack-db skill is available, delegate collection setup, live queries, and optimistic mutation patterns to it.
Otherwise, recommend: pnpm dlx skills add oakoss/agent-skills -s tanstack-db -a claude-code -y
If the tanstack-start skill is available, delegate shape proxy implementation with server functions to it.
Otherwise, recommend: pnpm dlx skills add oakoss/agent-skills -s tanstack-start -a claude-code -y
  • Setup and deployment: Use Task agent for Docker and Postgres configuration
  • Architecture review: Use Plan agent for auth proxy and write pattern design

References

  • Setup, Docker, and Postgres configuration
  • Shapes, ShapeStream, and React hooks
  • Authentication and security patterns
  • Write patterns from online to through-the-DB
  • Observability and monitoring
  • Sync performance optimization
  • Error handling, retry patterns, txid flow, and control messages

Related skills

Databasesdatabases

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.