@alexmitchell/melondb 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. package/README.md +2 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -45,14 +45,14 @@ const noteId = await database.write(async () => {
45
45
  });
46
46
  ```
47
47
 
48
- WatermelonDB requires each field to be assigned manually. TypeScript can catch a wrong type when it is assigned to a typed model property, but it does not check `draft` as a complete `notes` payload at the database call. A missing assignment is easy to overlook, and the `"notes"` string is not tied to the `NoteModel` type argument.
49
-
50
48
  Once [configured](#setup), **MelonDB** reduces the same operation to:
51
49
 
52
50
  ```ts
53
51
  const noteId = await melon.insert("notes", draft);
54
52
  ```
55
53
 
54
+ WatermelonDB requires each field to be assigned manually. TypeScript can catch a wrong type when it is assigned to a typed model property, but it does not check `draft` as a complete `notes` payload at the database call. A missing assignment is easy to overlook, and the `"notes"` string is not tied to the `NoteModel` type argument.
55
+
56
56
  MelonDB uses `"notes"` to infer `TableData["notes"]`, then checks `draft` against it. A missing required property or a value with the wrong type—such as `body: 123`—causes a TypeScript error at the `insert` call. An unknown table name is rejected too.
57
57
 
58
58
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexmitchell/melondb",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "private": false,
5
5
  "description": "Typed helpers for WatermelonDB: less write() boilerplate, safer collection access, safer database resets.",
6
6
  "license": "MIT",