@lotics/app-sdk 0.125.7 → 0.125.9
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/docs/data_fetching.md +3 -3
- package/docs/queries.md +1 -1
- package/docs/workflows.md +8 -8
- package/package.json +1 -1
package/docs/data_fetching.md
CHANGED
|
@@ -246,9 +246,9 @@ Reads paginate two different ways, and the difference is load-bearing:
|
|
|
246
246
|
opaque cursor instead of counting an offset, so a deep scroll stays O(page) and — the reason it
|
|
247
247
|
matters — **never skips or duplicates a row as the set shifts** under concurrent inserts/deletes.
|
|
248
248
|
The cursor is internal: the hook sends it and reads the next one back; you never see it. The
|
|
249
|
-
server keysets
|
|
250
|
-
|
|
251
|
-
|
|
249
|
+
server keysets the sort's column keys (the runtime `sort`, else the template's own order on the
|
|
250
|
+
columns it projects, else the record id) and falls back to offset transparently for a `first`
|
|
251
|
+
key it can't seek. So an infinite feed needs **no
|
|
252
252
|
dedupe** — key rows by `__source_record_id` for stable React keys, not to guard against repeats.
|
|
253
253
|
- **`page`, `limit`, `queryAll` and manual `rpc("query", { limit, offset })` use offset
|
|
254
254
|
pagination** — count `offset` rows, skip them, return the next page. Two consequences a keyset
|
package/docs/queries.md
CHANGED
|
@@ -878,7 +878,7 @@ template as derived nodes, in this order: `filter` (narrow) → `sort` (order)
|
|
|
878
878
|
`offset` (`limit` clamped to the 10,000-row cap, §10); `useQuery` with `more` opts into **keyset
|
|
879
879
|
(seek)** by sending `keyset: true` + the prior page's `cursor`, and the server returns the next
|
|
880
880
|
`next_cursor` (null on the last page). Seek stays O(page) and never skips/duplicates a row as the
|
|
881
|
-
set shifts, falling back to offset for a
|
|
881
|
+
set shifts, falling back to offset for a `first` key it can't seek.
|
|
882
882
|
- **`count: true`** — returns `{ total }` only: a COUNT over the *filtered* set, ignoring
|
|
883
883
|
sort/limit/offset. Drives "Page 1 of N". With **`count_by: "<column>"`** the same scan also
|
|
884
884
|
returns `counts` — rows per value of that projected column (a multi-value row under each value,
|
package/docs/workflows.md
CHANGED
|
@@ -356,13 +356,14 @@ for (const line of trigger.app_workflow.inputs.lines) {
|
|
|
356
356
|
Precedence is JS's: `? :`, `||`, `??`, `&&`, `== != === !==`, `< <= > >=`, `+ -`, `* / %`,
|
|
357
357
|
prefix `!` and `-`. Both equality forms work as in JS — `==`/`!=` loose, `===`/`!==` strict.
|
|
358
358
|
|
|
359
|
-
Not supported: `**`, bitwise operators, `
|
|
359
|
+
Not supported: `**`, bitwise operators, `instanceof`, `delete`, `void`. `typeof x` answers
|
|
360
|
+
JavaScript's words (a null is `"object"`); `k in o` tests an object's own keys.
|
|
360
361
|
`??=`, `||=` and `&&=` are statements (see *The sugar list*), not expressions.
|
|
361
362
|
|
|
362
|
-
**`undefined`
|
|
363
|
-
`x
|
|
364
|
-
|
|
365
|
-
`
|
|
363
|
+
**`undefined` reads as `null`.** `x == undefined` is `x == null`, and `x === undefined` /
|
|
364
|
+
`x !== undefined` are `isNull(x)` / `isNotNull(x)`: none of them tells a missing key from a null one.
|
|
365
|
+
Test whether a key was sent with `includes(keys(o), "k")` (see *Writing records*). A write tells them
|
|
366
|
+
apart: a field given `undefined` is left as it is, where `null` clears it.
|
|
366
367
|
|
|
367
368
|
**Ordered comparison against null is `false`, never a throw.** `<`/`>`/`<=`/`>=` with a
|
|
368
369
|
null/undefined operand evaluate to `false`. A mismatch between two *non-null* operands still
|
|
@@ -393,7 +394,6 @@ body does not look like what you typed.
|
|
|
393
394
|
| `[...a, b]` | `concat(a, [b])` |
|
|
394
395
|
| `{ ...a, b: 1 }` | `merge(merge({}, a), { b: 1 })` — later sources win, as in JS — and reads back as the spread, typed as you wrote it |
|
|
395
396
|
| `{ table_id }` | `{ table_id: table_id }` — in expressions **and** tool inputs |
|
|
396
|
-
| `undefined` | `null` |
|
|
397
397
|
| `xs.push(a, b);` | `xs = concat(xs, [a, b])` — statement form |
|
|
398
398
|
| `o.a.items.push(v);` | `o = merge(o, { a: merge(o.a, { items: concat(o.a.items, [v]) }) })` |
|
|
399
399
|
| `o.a.b = v;` | `o = merge(o, { a: merge(o.a, { b: v }) })` — also `o.a.b += v`, `o.n++` |
|
|
@@ -469,7 +469,7 @@ is what matters, and expect to re-extract it if you edit the source read back.
|
|
|
469
469
|
`get → set` is a fixed point on the stored tree, not on your text. A body read back prints the
|
|
470
470
|
canonical form — `concat` for a spread, `merge` for an object spread, `{x: x}` for shorthand,
|
|
471
471
|
`toString`/`lower` for a cast or a method call, the arrow spelling for either callback form,
|
|
472
|
-
`
|
|
472
|
+
`let` for a `const` the body mutates, and the inlined body at each call
|
|
473
473
|
site of a declared `function`. `?.` and `??` re-sugar, and a tool-result destructure prints back
|
|
474
474
|
as the destructuring statement (`const { records } = await query_records({…});`, with renames and
|
|
475
475
|
defaults intact); where a `?.` guard lands mid-path it prints as the explicit `isNull(…) ? null :
|
|
@@ -625,7 +625,7 @@ if (includes(keys(i), "phone")) { // NOT `isNull(i.phone)` — that swallows t
|
|
|
625
625
|
|
|
626
626
|
An omitted input carries no key at all and a cleared one carries the key with `null`, so presence
|
|
627
627
|
is the only test that separates them — and it has to be `keys`: a body reads `undefined` as `null`,
|
|
628
|
-
so `i.phone === undefined` is
|
|
628
|
+
so `i.phone === undefined` is `isNull(i.phone)`, which a cleared input passes too.
|
|
629
629
|
`""` is never a clear: the validator coerces it to omitted before the body runs.
|
|
630
630
|
|
|
631
631
|
Value shapes, which the generated types enforce exactly:
|
package/package.json
CHANGED