From 0819fd96a79d75b830c13ee6e97541a990302798 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=BCl=C3=B6p=20Kov=C3=A1cs?= <43729152+fulopkovacs@users.noreply.github.com> Date: Thu, 19 Mar 2026 10:41:52 +0100 Subject: [PATCH 1/3] docs: update code block language to typescript --- docs/collections/electric-collection.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/collections/electric-collection.md b/docs/collections/electric-collection.md index 228098762..44e4c05dc 100644 --- a/docs/collections/electric-collection.md +++ b/docs/collections/electric-collection.md @@ -189,7 +189,7 @@ Electric is typically deployed behind a proxy server that handles shape configur Here is an example proxy implementation using TanStack Starter: -```js +```typescript import { createServerFileRoute } from "@tanstack/react-start/server" import { ELECTRIC_PROTOCOL_QUERY_PARAMS } from "@electric-sql/client" From 2c509a1da5c19901f3241239e29aaf20fbc477bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=BCl=C3=B6p=20Kov=C3=A1cs?= <43729152+fulopkovacs@users.noreply.github.com> Date: Thu, 19 Mar 2026 10:42:58 +0100 Subject: [PATCH 2/3] docs: correct TanStack Starter to Start --- docs/collections/electric-collection.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/collections/electric-collection.md b/docs/collections/electric-collection.md index 44e4c05dc..93102b324 100644 --- a/docs/collections/electric-collection.md +++ b/docs/collections/electric-collection.md @@ -187,7 +187,7 @@ async function generateTxId(tx) { Electric is typically deployed behind a proxy server that handles shape configuration, authentication and authorization. This provides better security and allows you to control what data users can access without exposing Electric to the client. -Here is an example proxy implementation using TanStack Starter: +Here is an example proxy implementation using TanStack Start: ```typescript import { createServerFileRoute } from "@tanstack/react-start/server" From 91a697a7933649a031ae43412bfe6794ea6e739b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=BCl=C3=B6p=20Kov=C3=A1cs?= <43729152+fulopkovacs@users.noreply.github.com> Date: Thu, 19 Mar 2026 10:52:49 +0100 Subject: [PATCH 3/3] docs: fix the default timeout of `awaitTxId` (it's 5s instead of 30s) see: https://github.com/fulopkovacs/db/blob/2c509a1da5c19901f3241239e29aaf20fbc477bd/packages/electric-db-collection/src/electric.ts#L643-L648 --- docs/collections/electric-collection.md | 2 +- .../db-core/collection-setup/references/electric-adapter.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/collections/electric-collection.md b/docs/collections/electric-collection.md index 93102b324..f5a475bb9 100644 --- a/docs/collections/electric-collection.md +++ b/docs/collections/electric-collection.md @@ -311,7 +311,7 @@ Manually wait for a specific transaction ID to be synchronized: // Wait for specific txid await todosCollection.utils.awaitTxId(12345) -// With custom timeout (default is 30 seconds) +// With custom timeout (default is 5 seconds) await todosCollection.utils.awaitTxId(12345, 10000) ``` diff --git a/packages/db/skills/db-core/collection-setup/references/electric-adapter.md b/packages/db/skills/db-core/collection-setup/references/electric-adapter.md index c575db064..38f0e07b2 100644 --- a/packages/db/skills/db-core/collection-setup/references/electric-adapter.md +++ b/packages/db/skills/db-core/collection-setup/references/electric-adapter.md @@ -78,7 +78,7 @@ onInsert: async ({ transaction }) => { ## Utility Methods (`collection.utils`) -- `awaitTxId(txid, timeout?)` -- wait for txid in Electric stream; default timeout 30s +- `awaitTxId(txid, timeout?)` -- wait for txid in Electric stream; default timeout 5s - `awaitMatch(matchFn, timeout?)` -- wait for message matching predicate; default timeout 3000ms ### Helper Exports