@lunora/db 1.0.0-alpha.1 → 1.0.0-alpha.10
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 +12 -0
- package/__assets__/package-og.svg +1 -1
- package/dist/collections/index.d.mts +5 -0
- package/dist/collections/index.d.ts +5 -0
- package/dist/collections/index.mjs +2 -0
- package/dist/index.d.mts +7 -141
- package/dist/index.d.ts +7 -141
- package/dist/index.mjs +4 -2
- package/dist/mutators/index.d.mts +5 -0
- package/dist/mutators/index.d.ts +5 -0
- package/dist/mutators/index.mjs +1 -0
- package/dist/packem_shared/OUTBOX_MUTATION_FN_NAME-Cf8iP6Wa.mjs +102 -0
- package/dist/packem_shared/bindMutators-DNhICkoy.mjs +66 -0
- package/dist/packem_shared/collection-options.d-lJBOVJgq.d.mts +216 -0
- package/dist/packem_shared/collection-options.d-lJBOVJgq.d.ts +216 -0
- package/dist/packem_shared/createCheckpointRegistry-SvwBczzv.mjs +127 -0
- package/dist/packem_shared/define-collections.d-C01DaKJO.d.ts +159 -0
- package/dist/packem_shared/define-collections.d-Cc1p0x3t.d.mts +159 -0
- package/dist/packem_shared/define-mutators.d-DhO8mWz0.d.ts +80 -0
- package/dist/packem_shared/define-mutators.d-HWj94_nL.d.mts +80 -0
- package/dist/packem_shared/defineCollections-BWB7CJzY.mjs +105 -0
- package/package.json +11 -3
- package/dist/packem_shared/defineCollections-Cqtf9ffi.mjs +0 -109
- package/dist/packem_shared/toMap-CRulWqZ7.mjs +0 -65
package/README.md
CHANGED
|
@@ -85,6 +85,18 @@ export const createCollections = (client: LunoraClient) =>
|
|
|
85
85
|
|
|
86
86
|
> `vis generate lunora-collections` scaffolds this from your `schema.ts` + functions.
|
|
87
87
|
|
|
88
|
+
### Local-first sync engine
|
|
89
|
+
|
|
90
|
+
Beyond whole-table collections, the `@lunora/db/collections` and
|
|
91
|
+
`@lunora/db/mutators` subpaths expose the local-first sync engine:
|
|
92
|
+
`lunoraCollectionOptions({ shape })` syncs a **partial replication shape** (only
|
|
93
|
+
the rows a client needs, scoped by a server-resolved predicate) over the poke
|
|
94
|
+
diff protocol, and `defineMutator` + `bindMutators` run **optimistic custom
|
|
95
|
+
mutators** (a local body first, a server-authoritative impl second, rebased on
|
|
96
|
+
every sync tick). The framework adapters add a `useMutator` / `createMutator` /
|
|
97
|
+
`mutator` hook over a bound handle. See the
|
|
98
|
+
**[local-first guide](https://lunora.sh/docs/concepts/local-first)**.
|
|
99
|
+
|
|
88
100
|
> This README covers the basics. For the full API, options, and guides, see the **[documentation](https://lunora.sh/docs/addons/db)**.
|
|
89
101
|
|
|
90
102
|
## Related
|