You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ROADMAP.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,7 @@ Today datum uses last-write-wins based on `updated_at`. For collaborative editin
20
20
21
21
## Recently shipped
22
22
23
+
-**DevTools (v0.8.0)** — `datum-sync/devtools` adds a floating browser panel with a SQL REPL (full PostGIS), schema inspector, and live sync status. Activated by `initDatumDevtools(db)`. Toggle with `Ctrl+Shift+D`. Zero production bundle impact via dynamic import. Try it at the [live demo](https://a-saed.github.io/datum/demo/).
23
24
-**Typed column support (v0.7.0)** — datum auto-introspects the server table at startup and mirrors the exact column structure in PGlite. Any columns beyond the 4 required ones (`id`, `geom`, `updated_at`, `properties`) are synced automatically and queryable with normal SQL on both sides — no extra configuration.
24
25
-**Per-user authentication (v0.6.0)** — JWT auth (HS256/RS256/ES256). Token in `subscribe` message, all claims forwarded as `datum.<key>` Postgres session variables for RLS. Auto token refresh before expiry. Startup warning when connected as superuser. Fully opt-in.
25
26
-**Security and correctness hardening (0.5.0)** — Ack-based write sync (server acks writes before client marks synced; retries on reconnect). WS per-connection read limits, read deadlines, ping/pong keepalive. Write batch capped at 500. Rate limiter uses real client IP (X-Forwarded-For aware). Delta broadcast uses full geometry bbox (not just first vertex) for correct routing of polygons and lines. Graceful shutdown on SIGTERM. Outbox ordered by insertion seq not feature timestamp.
Copy file name to clipboardExpand all lines: docs/api.md
+64Lines changed: 64 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -228,6 +228,70 @@ function FeatureList() {
228
228
229
229
---
230
230
231
+
## DevTools (`datum-sync/devtools`)
232
+
233
+
A floating browser panel for inspecting the local PGlite database, schema, and sync state while building. Zero production bundle impact — loaded only when you import it.
For multiple tables, pass an array — a dropdown appears in the toolbar to switch between clients:
254
+
255
+
```ts
256
+
initDatumDevtools([featuresDb, waypointsDb])
257
+
```
258
+
259
+
Calling `initDatumDevtools` more than once is a no-op (idempotent).
260
+
261
+
**Toggle:**`Ctrl+Shift+D` (Windows/Linux) or `Cmd+Shift+D` (Mac). The panel remembers its open/closed state and height across page reloads via `localStorage`.
262
+
263
+
### Tabs
264
+
265
+
| Tab | What it shows |
266
+
|---|---|
267
+
|**Query**| SQL REPL against local PGlite. Full PostGIS available. `Cmd+Enter` to run. |
268
+
|**Schema**| Every column from the server's schema message — name, type, role badge, nullable. Schema hash and "mirrored from server ✓" confirmation. |
269
+
|**Status**| Connection state, pending write count, schema hash, schema version. When a schema wipe occurs, shows a diff of added/removed columns. |
270
+
271
+
### `onSchemaChange` callback
272
+
273
+
Called whenever the local DB is wiped and recreated (schema changed or first visit). Available in `DatumConfig` and as a post-connect subscription:
Press `Ctrl+Shift+D` to toggle the panel. Three tabs: **Query** (SQL REPL), **Schema** (column inspector), **Status** (sync state). No extra dependencies — included in `datum-sync`.
108
+
94
109
## Next steps
95
110
96
111
-[How It Works](/how-it-works) — understand the local-first model, bbox subscriptions, and sync cycle
97
-
-[API Reference](/api) — full TypeScript client, React hooks, and server documentation
112
+
-[API Reference](/api) — full TypeScript client, React hooks, devtools, and server documentation
0 commit comments