From 7f6f140099a6c1e46d49a2056cf989390c50c6ef Mon Sep 17 00:00:00 2001 From: James Arthur Date: Tue, 3 Dec 2024 22:26:46 +0100 Subject: [PATCH] example: working through the db pattern. --- .../patterns/4-through-the-db/index.tsx | 4 +- .../patterns/4-through-the-db/sync.ts | 2 + examples/write-patterns/shared/app/db.ts | 14 ++-- examples/write-patterns/shared/backend/api.js | 71 ++++++++++++++++++- .../shared/migrations/01-create-todos.sql | 2 +- 5 files changed, 81 insertions(+), 12 deletions(-) diff --git a/examples/write-patterns/patterns/4-through-the-db/index.tsx b/examples/write-patterns/patterns/4-through-the-db/index.tsx index ca072b1d8c..1b3ec880a8 100644 --- a/examples/write-patterns/patterns/4-through-the-db/index.tsx +++ b/examples/write-patterns/patterns/4-through-the-db/index.tsx @@ -31,7 +31,7 @@ await pglite.electric.syncShapeToTable({ url: `${ELECTRIC_URL}/v1/shape`, table: 'todos', }, - shapeKey: 'todos', + shapeKey: 'p4_todos', table: 'p4_todos_synced', primaryKey: ['id'], }) @@ -110,7 +110,7 @@ function ThroughTheDB() {

- 4. Through the DB sync + 4. Through the DB