@lunora/db 1.0.0-alpha.1 → 1.0.0-alpha.100
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/LICENSE.md +6 -0
- package/README.md +19 -1
- 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 +1 -0
- package/dist/index.d.mts +140 -135
- package/dist/index.d.ts +140 -135
- package/dist/index.mjs +1 -6
- 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/CHECKPOINT_FALLBACK_MS-DVkxHO2j.mjs +1 -0
- package/dist/packem_shared/DIRECT_TRANSACTION_METADATA_KEY-O-hmqO42.mjs +1 -0
- package/dist/packem_shared/OUTBOX_MUTATION_FN_NAME-BfFCughR.mjs +1 -0
- package/dist/packem_shared/applyPlanToCollections-C_eyqNF9.mjs +1 -0
- package/dist/packem_shared/collection-options.d-bmH3BTGq.d.mts +364 -0
- package/dist/packem_shared/collection-options.d-bmH3BTGq.d.ts +364 -0
- package/dist/packem_shared/defineCollections-Cz4-m1Mp.mjs +1 -0
- package/dist/packem_shared/index.d-BzXEOiP5.d.mts +174 -0
- package/dist/packem_shared/index.d-DQsjGcjP.d.ts +235 -0
- package/dist/packem_shared/index.d-DlfHbDas.d.ts +174 -0
- package/dist/packem_shared/index.d-DrpzHIoj.d.mts +235 -0
- package/package.json +12 -3
- package/dist/packem_shared/defineCollections-Cqtf9ffi.mjs +0 -109
- package/dist/packem_shared/toMap-CRulWqZ7.mjs +0 -65
package/LICENSE.md
CHANGED
|
@@ -103,3 +103,9 @@ Unless required by applicable law or agreed to in writing, software distributed
|
|
|
103
103
|
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
104
104
|
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
105
105
|
specific language governing permissions and limitations under the License.
|
|
106
|
+
|
|
107
|
+
<!-- DEPENDENCIES -->
|
|
108
|
+
<!-- /DEPENDENCIES -->
|
|
109
|
+
|
|
110
|
+
<!-- TYPE_DEPENDENCIES -->
|
|
111
|
+
<!-- /TYPE_DEPENDENCIES -->
|
package/README.md
CHANGED
|
@@ -85,7 +85,25 @@ export const createCollections = (client: LunoraClient) =>
|
|
|
85
85
|
|
|
86
86
|
> `vis generate lunora-collections` scaffolds this from your `schema.ts` + functions.
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
Keep a **single `db` instance**, and treat its collections as the one source of
|
|
89
|
+
truth per table — don't mirror rows into your own store. A derived index (a tree,
|
|
90
|
+
a search index, an undo capture) built from a copy of the rows can silently read
|
|
91
|
+
stale data while the UI renders through `useLiveQuery`. See [One source of truth
|
|
92
|
+
per table](https://lunora.sh/docs/packages/db#one-source-of-truth-per-table).
|
|
93
|
+
|
|
94
|
+
### Local-first sync engine
|
|
95
|
+
|
|
96
|
+
Beyond whole-table collections, the `@lunora/db/collections` and
|
|
97
|
+
`@lunora/db/mutators` subpaths expose the local-first sync engine:
|
|
98
|
+
`lunoraCollectionOptions({ shape })` syncs a **partial replication shape** (only
|
|
99
|
+
the rows a client needs, scoped by a server-resolved predicate) over the poke
|
|
100
|
+
diff protocol, and `defineMutator` + `bindMutators` run **optimistic custom
|
|
101
|
+
mutators** (a local body first, a server-authoritative impl second, rebased on
|
|
102
|
+
every sync tick). The framework adapters add a `useMutator` / `createMutator` /
|
|
103
|
+
`mutator` hook over a bound handle. See the
|
|
104
|
+
**[local-first guide](https://lunora.sh/docs/concepts/local-first)**.
|
|
105
|
+
|
|
106
|
+
> This README covers the basics. For the full API, options, and guides, see the **[documentation](https://lunora.sh/docs/packages/db)**.
|
|
89
107
|
|
|
90
108
|
## Related
|
|
91
109
|
|