@sveltebase/sync 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,6 +11,7 @@ Reactive, local-first database synchronization library built for **Svelte 5** an
|
|
|
11
11
|
- **Delta Syncing (Incremental Load)**: Automatically pulls only modified records since the last sync time to conserve network bandwidth.
|
|
12
12
|
- **Hibernate Friendly**: Client-initiated heartbeats allow Cloudflare Durable Objects to sleep when idle, cutting active execution costs down to near zero.
|
|
13
13
|
- **Vite Integration**: Custom dev plugin simulating Durable Objects and bindings proxy locally without full worker compilation loops.
|
|
14
|
+
- **Database Agnostic**: Completely decoupled from the underlying storage. You are not locked into Cloudflare D1; the sync handler hooks (`fetch`, `create`, `update`, `delete`) are simple, asynchronous JavaScript callbacks where you can connect to PostgreSQL, MySQL, Supabase, Neon, MongoDB, or any database of your choice.
|
|
14
15
|
|
|
15
16
|
---
|
|
16
17
|
|
|
@@ -141,7 +142,11 @@ Use it in your Svelte 5 components:
|
|
|
141
142
|
|
|
142
143
|
### Step 2: Define Sync Handlers (Server)
|
|
143
144
|
|
|
144
|
-
|
|
145
|
+
> [!NOTE]
|
|
146
|
+
> **Database Agnostic (No Lock-In):**
|
|
147
|
+
> While the examples below connect to **Cloudflare D1 SQLite** (using Drizzle ORM), `@sveltebase/sync` is completely database-agnostic. The `fetch`, `create`, `update`, and `delete` handlers are standard asynchronous functions. You can fetch, save, or delete data using **any database** of your choice (PostgreSQL, MySQL, Supabase, Neon, MongoDB, etc.) by writing the appropriate database connection logic inside these hooks.
|
|
148
|
+
|
|
149
|
+
Define the handlers that translate IndexedDB operations (fetch, create, update, delete) to database queries:
|
|
145
150
|
|
|
146
151
|
```typescript
|
|
147
152
|
// src/lib/server/sync-todos.ts
|