Mutations
A mutation is a query and a patch together. The query selects the entities, and the patch gives the new state of each one. Stardust commits every change in one transaction. Each example reads the same five entities as Queries.
The document
A mutation document has query and patch. The query is an ordinary
query, and the patch follows the form in
Patches.
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 00 | 54 52 4F 4E | magic TRON |
| 04 | 2C 3F65 | txt "?e" |
| 07 | 0E 0D 00 0100 010000 00 04000000 | array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @4 |
| 14 | 2C 3F65 | txt "?e" |
| 17 | 4C 64657074 | txt "dept" |
| 1C | 3C 6F7073 | txt "ops" |
| 20 | 0E 15 00 0700 030000 00 14000000 170000 00 1C000000 | array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @14 → @17 → @1C |
| 35 | 0E 0D 00 0100 010000 00 20000000 | array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @20 |
| 42 | 5C 7768657265 | txt "where" |
| 48 | 0F 0A 42000000 3500 0000 | map leaf, size 10: @42 → @35 |
| 52 | 4C 66696E64 | txt "find" |
| 57 | 0F 0A 52000000 0700 0000 | map leaf, size 10: @52 → @7 |
| 61 | 07 0E 0A000000 4800 0000 57000000 | map branch, size 14, depth 0 (root), slots 1, 3: @48 → @57 |
| 6F | 6C 737461747573 | txt "status" |
| 76 | 6C 616374697665 | txt "active" |
| 7D | 0F 0A 6F000000 7600 0000 | map leaf, size 10: @6F → @76 |
| 87 | 2C 3F65 | txt "?e" |
| 8A | 0F 0A 87000000 7D00 0000 | map leaf, size 10: @87 → @7D |
| 94 | 5C 7175657279 | txt "query" |
| 9A | 0F 0A 94000000 6100 0000 | map leaf, size 10: @94 → @61 |
| A4 | 5C 7061746368 | txt "patch" |
| AA | 0F 0A A4000000 8A00 0000 | map leaf, size 10: @A4 → @8A |
| B4 | 07 0E 40020000 9A00 0000 AA000000 | map branch, size 14, depth 2, slots 6, 9: @9A → @AA |
| C2 | 07 0A 01000000 B400 0000 | map branch, size 10, depth 1, slots 0: @B4 |
| CC | 07 0A 80000000 C200 0000 | map branch, size 10, depth 0 (root), slots 7: @C2 |
| D6 | CC000000 00000000 | root → @CC; previous: none |
Each key of the patch is a target. A key that begins with ? uses an entity
variable bound by the query. A temporary name such as #_new makes a new entity, as in a patch.
Preview and commit
The native mutation run commits the selection and resolved patch together. The core also has a preview path that validates the same selection, resolution and store rules without writing facts. The public ABI does not currently expose that preview.
The result blocks on this page show the core report's status and counts. The public mutation result uses lowercase status names and also gives the commit time and generated entity ids.
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 00 | 54 52 4F 4E | magic TRON |
| 04 | 6C 737461747573 | txt "status" |
| 0B | 9C 436F6D6D697474 6564 | txt "Committed" |
| 15 | 0F 0A 04000000 0B00 0000 | map leaf, size 10: @4 → @B |
| 1F | BC 7472616E736163 74696F6E | txt "transaction" |
| 2B | 02 07000000000000 00 | i64 7 |
| 34 | 0F 0A 1F000000 2B00 0000 | map leaf, size 10: @1F → @2B |
| 3E | 9C 67656E65726174 6564 | txt "generated" |
| 48 | 02 00000000000000 00 | i64 0 |
| 51 | 0F 0A 3E000000 4800 0000 | map leaf, size 10: @3E → @48 |
| 5B | 5C 6661637473 | txt "facts" |
| 61 | 02 01000000000000 00 | i64 1 |
| 6A | 0F 0A 5B000000 6100 0000 | map leaf, size 10: @5B → @61 |
| 74 | 07 16 01620000 1500 0000 34000000 5100 0000 6A000000 | map branch, size 22, depth 0 (root), slots 0, 9, 13, 14: @15 → @34 → @51 → @6A |
| 8A | 74000000 00000000 | root → @74; previous: none |
The three statuses
| Status | Meaning |
|---|---|
Committed | The patch writes facts in a new transaction |
No_Change | The selection matches and every field already agrees |
No_Match | The selection matches no entity |
A second run of the same mutation changes nothing, so Stardust commits no new transaction.
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 00 | 54 52 4F 4E | magic TRON |
| 04 | 6C 737461747573 | txt "status" |
| 0B | 9C 4E6F5F4368616E 6765 | txt "No_Change" |
| 15 | 0F 0A 04000000 0B00 0000 | map leaf, size 10: @4 → @B |
| 1F | BC 7472616E736163 74696F6E | txt "transaction" |
| 2B | 02 00000000000000 00 | i64 0 |
| 34 | 0F 0A 1F000000 2B00 0000 | map leaf, size 10: @1F → @2B |
| 3E | 9C 67656E65726174 6564 | txt "generated" |
| 48 | 02 00000000000000 00 | i64 0 |
| 51 | 0F 0A 3E000000 4800 0000 | map leaf, size 10: @3E → @48 |
| 5B | 5C 6661637473 | txt "facts" |
| 61 | 02 00000000000000 00 | i64 0 |
| 6A | 0F 0A 5B000000 6100 0000 | map leaf, size 10: @5B → @61 |
| 74 | 07 16 01620000 1500 0000 34000000 5100 0000 6A000000 | map branch, size 22, depth 0 (root), slots 0, 9, 13, 14: @15 → @34 → @51 → @6A |
| 8A | 74000000 00000000 | root → @74; previous: none |
A selection that matches no entity gives the same counts. No entity is in the
department legal:
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 00 | 54 52 4F 4E | magic TRON |
| 04 | 2C 3F65 | txt "?e" |
| 07 | 0E 0D 00 0100 010000 00 04000000 | array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @4 |
| 14 | 2C 3F65 | txt "?e" |
| 17 | 4C 64657074 | txt "dept" |
| 1C | 5C 6C6567616C | txt "legal" |
| 22 | 0E 15 00 0700 030000 00 14000000 170000 00 1C000000 | array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @14 → @17 → @1C |
| 37 | 0E 0D 00 0100 010000 00 22000000 | array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @22 |
| 44 | 5C 7768657265 | txt "where" |
| 4A | 0F 0A 44000000 3700 0000 | map leaf, size 10: @44 → @37 |
| 54 | 4C 66696E64 | txt "find" |
| 59 | 0F 0A 54000000 0700 0000 | map leaf, size 10: @54 → @7 |
| 63 | 07 0E 0A000000 4A00 0000 59000000 | map branch, size 14, depth 0 (root), slots 1, 3: @4A → @59 |
| 71 | 6C 737461747573 | txt "status" |
| 78 | 6C 616374697665 | txt "active" |
| 7F | 0F 0A 71000000 7800 0000 | map leaf, size 10: @71 → @78 |
| 89 | 2C 3F65 | txt "?e" |
| 8C | 0F 0A 89000000 7F00 0000 | map leaf, size 10: @89 → @7F |
| 96 | 5C 7175657279 | txt "query" |
| 9C | 0F 0A 96000000 6300 0000 | map leaf, size 10: @96 → @63 |
| A6 | 5C 7061746368 | txt "patch" |
| AC | 0F 0A A6000000 8C00 0000 | map leaf, size 10: @A6 → @8C |
| B6 | 07 0E 40020000 9C00 0000 AC000000 | map branch, size 14, depth 2, slots 6, 9: @9C → @AC |
| C4 | 07 0A 01000000 B600 0000 | map branch, size 10, depth 1, slots 0: @B6 |
| CE | 07 0A 80000000 C400 0000 | map branch, size 10, depth 0 (root), slots 7: @C4 |
| D8 | CE000000 00000000 | root → @CE; previous: none |
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 00 | 54 52 4F 4E | magic TRON |
| 04 | 6C 737461747573 | txt "status" |
| 0B | 8C 4E6F5F4D617463 68 | txt "No_Match" |
| 14 | 0F 0A 04000000 0B00 0000 | map leaf, size 10: @4 → @B |
| 1E | BC 7472616E736163 74696F6E | txt "transaction" |
| 2A | 02 00000000000000 00 | i64 0 |
| 33 | 0F 0A 1E000000 2A00 0000 | map leaf, size 10: @1E → @2A |
| 3D | 9C 67656E65726174 6564 | txt "generated" |
| 47 | 02 00000000000000 00 | i64 0 |
| 50 | 0F 0A 3D000000 4700 0000 | map leaf, size 10: @3D → @47 |
| 5A | 5C 6661637473 | txt "facts" |
| 60 | 02 00000000000000 00 | i64 0 |
| 69 | 0F 0A 5A000000 6000 0000 | map leaf, size 10: @5A → @60 |
| 73 | 07 16 01620000 1400 0000 33000000 5000 0000 69000000 | map branch, size 22, depth 0 (root), slots 0, 9, 13, 14: @14 → @33 → @50 → @69 |
| 89 | 73000000 00000000 | root → @73; previous: none |
New entities
A temporary name such as #_new makes an entity. The selection must give exactly
one row, because one new entity needs one parent row.
A {#link #_new} value in the same patch links to that entity. {#link #_tx} links to the committing transaction.
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 00 | 54 52 4F 4E | magic TRON |
| 04 | 2C 3F65 | txt "?e" |
| 07 | 0E 0D 00 0100 010000 00 04000000 | array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @4 |
| 14 | 2C 3F65 | txt "?e" |
| 17 | 4C 64657074 | txt "dept" |
| 1C | 3C 6F7073 | txt "ops" |
| 20 | 0E 15 00 0700 030000 00 14000000 170000 00 1C000000 | array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @14 → @17 → @1C |
| 35 | 0E 0D 00 0100 010000 00 20000000 | array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @20 |
| 42 | 5C 7768657265 | txt "where" |
| 48 | 0F 0A 42000000 3500 0000 | map leaf, size 10: @42 → @35 |
| 52 | 4C 66696E64 | txt "find" |
| 57 | 0F 0A 52000000 0700 0000 | map leaf, size 10: @52 → @7 |
| 61 | 5C 6C696D6974 | txt "limit" |
| 67 | 02 01000000000000 00 | i64 1 |
| 70 | 0F 0A 61000000 6700 0000 | map leaf, size 10: @61 → @67 |
| 7A | 07 12 2A000000 4800 0000 57000000 7000 0000 | map branch, size 18, depth 0 (root), slots 1, 3, 5: @48 → @57 → @70 |
| 8C | 6C 737461747573 | txt "status" |
| 93 | 4C 73656564 | txt "seed" |
| 98 | 0F 0A 8C000000 9300 0000 | map leaf, size 10: @8C → @93 |
| A2 | 5C 235F6E6577 | txt "#_new" |
| A8 | 0F 0A A2000000 9800 0000 | map leaf, size 10: @A2 → @98 |
| B2 | 5C 7175657279 | txt "query" |
| B8 | 0F 0A B2000000 7A00 0000 | map leaf, size 10: @B2 → @7A |
| C2 | 5C 7061746368 | txt "patch" |
| C8 | 0F 0A C2000000 A800 0000 | map leaf, size 10: @C2 → @A8 |
| D2 | 07 0E 40020000 B800 0000 C8000000 | map branch, size 14, depth 2, slots 6, 9: @B8 → @C8 |
| E0 | 07 0A 01000000 D200 0000 | map branch, size 10, depth 1, slots 0: @D2 |
| EA | 07 0A 80000000 E000 0000 | map branch, size 10, depth 0 (root), slots 7: @E0 |
| F4 | EA000000 00000000 | root → @EA; previous: none |
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 00 | 54 52 4F 4E | magic TRON |
| 04 | 6C 737461747573 | txt "status" |
| 0B | 9C 436F6D6D697474 6564 | txt "Committed" |
| 15 | 0F 0A 04000000 0B00 0000 | map leaf, size 10: @4 → @B |
| 1F | BC 7472616E736163 74696F6E | txt "transaction" |
| 2B | 02 09000000000000 00 | i64 9 |
| 34 | 0F 0A 1F000000 2B00 0000 | map leaf, size 10: @1F → @2B |
| 3E | 9C 67656E65726174 6564 | txt "generated" |
| 48 | 02 01000000000000 00 | i64 1 |
| 51 | 0F 0A 3E000000 4800 0000 | map leaf, size 10: @3E → @48 |
| 5B | 5C 6661637473 | txt "facts" |
| 61 | 02 01000000000000 00 | i64 1 |
| 6A | 0F 0A 5B000000 6100 0000 | map leaf, size 10: @5B → @61 |
| 74 | 07 16 01620000 1500 0000 34000000 5100 0000 6A000000 | map branch, size 22, depth 0 (root), slots 0, 9, 13, 14: @15 → @34 → @51 → @6A |
| 8A | 74000000 00000000 | root → @74; previous: none |
The engine rejects the same patch against a selection of two rows. Two entities are in
the department eng:
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 00 | 54 52 4F 4E | magic TRON |
| 04 | 2C 3F65 | txt "?e" |
| 07 | 0E 0D 00 0100 010000 00 04000000 | array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @4 |
| 14 | 2C 3F65 | txt "?e" |
| 17 | 4C 64657074 | txt "dept" |
| 1C | 3C 656E67 | txt "eng" |
| 20 | 0E 15 00 0700 030000 00 14000000 170000 00 1C000000 | array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @14 → @17 → @1C |
| 35 | 0E 0D 00 0100 010000 00 20000000 | array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @20 |
| 42 | 5C 7768657265 | txt "where" |
| 48 | 0F 0A 42000000 3500 0000 | map leaf, size 10: @42 → @35 |
| 52 | 4C 66696E64 | txt "find" |
| 57 | 0F 0A 52000000 0700 0000 | map leaf, size 10: @52 → @7 |
| 61 | 07 0E 0A000000 4800 0000 57000000 | map branch, size 14, depth 0 (root), slots 1, 3: @48 → @57 |
| 6F | 6C 737461747573 | txt "status" |
| 76 | 4C 73656564 | txt "seed" |
| 7B | 0F 0A 6F000000 7600 0000 | map leaf, size 10: @6F → @76 |
| 85 | 5C 235F6E6577 | txt "#_new" |
| 8B | 0F 0A 85000000 7B00 0000 | map leaf, size 10: @85 → @7B |
| 95 | 5C 7175657279 | txt "query" |
| 9B | 0F 0A 95000000 6100 0000 | map leaf, size 10: @95 → @61 |
| A5 | 5C 7061746368 | txt "patch" |
| AB | 0F 0A A5000000 8B00 0000 | map leaf, size 10: @A5 → @8B |
| B5 | 07 0E 40020000 9B00 0000 AB000000 | map branch, size 14, depth 2, slots 6, 9: @9B → @AB |
| C3 | 07 0A 01000000 B500 0000 | map branch, size 10, depth 1, slots 0: @B5 |
| CD | 07 0A 80000000 C300 0000 | map branch, size 10, depth 0 (root), slots 7: @C3 |
| D7 | CD000000 00000000 | root → @CD; previous: none |
Error
Generate_Requires_Single
Patch values and variables
The body for each target is a merge patch. It accepts every Stardust value: numbers, text, booleans, lists, maps, links and the other typed values. A null removes the field.
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 00 | 54 52 4F 4E | magic TRON |
| 04 | 3C 616765 | txt "age" |
| 08 | 02 05000000000000 00 | i64 5 |
| 11 | 0F 0A 04000000 0800 0000 | map leaf, size 10: @4 → @8 |
| 1B | 2C 3F65 | txt "?e" |
| 1E | 0F 0A 1B000000 1100 0000 | map leaf, size 10: @1B → @11 |
| 28 | 5C 7061746368 | txt "patch" |
| 2E | 0F 0A 28000000 1E00 0000 | map leaf, size 10: @28 → @1E |
| 38 | 2E000000 00000000 | root → @2E; previous: none |
This sets age to 5 on every entity bound to ?e.
The query may bind a patch variable in where or expose it through find. Both
forms refer to the same row binding. A variable used as a patch target must bind
an entity. A variable used as a field value substitutes its complete bound
value.
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 000 | 54 52 4F 4E | magic TRON |
| 004 | 7C 3F737461747573 | txt "?status" |
| 00C | 0E 0D 00 0100 010000 00 04000000 | array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @4 |
| 019 | 2C 3F65 | txt "?e" |
| 01C | 6C 737461747573 | txt "status" |
| 023 | 7C 3F737461747573 | txt "?status" |
| 02B | 0E 15 00 0700 030000 00 19000000 1C0000 00 23000000 | array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @19 → @1C → @23 |
| 040 | 1C 3D | txt "=" |
| 042 | 7C 3F737461747573 | txt "?status" |
| 04A | 7C 70656E64696E67 | txt "pending" |
| 052 | 0E 15 00 0700 030000 00 40000000 420000 00 4A000000 | array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @40 → @42 → @4A |
| 067 | 6C 3F6F776E6572 | txt "?owner" |
| 06E | 4C 6E616D65 | txt "name" |
| 073 | 3C 416461 | txt "Ada" |
| 077 | 0E 15 00 0700 030000 00 67000000 6E0000 00 73000000 | array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @67 → @6E → @73 |
| 08C | 0E 15 00 0700 030000 00 2B000000 520000 00 77000000 | array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @2B → @52 → @77 |
| 0A1 | 5C 7768657265 | txt "where" |
| 0A7 | 0F 0A A1000000 8C00 0000 | map leaf, size 10: @A1 → @8C |
| 0B1 | 4C 66696E64 | txt "find" |
| 0B6 | 0F 0A B1000000 0C00 0000 | map leaf, size 10: @B1 → @C |
| 0C0 | 07 0E 0A000000 A700 0000 B6000000 | map branch, size 14, depth 0 (root), slots 1, 3: @A7 → @B6 |
| 0CE | 6C 737461747573 | txt "status" |
| 0D5 | 6C 616374697665 | txt "active" |
| 0DC | 0F 0A CE000000 D500 0000 | map leaf, size 10: @CE → @D5 |
| 0E6 | 5C 6F776E6572 | txt "owner" |
| 0EC | 6C 3F6F776E6572 | txt "?owner" |
| 0F3 | 0F 0A E6000000 EC00 0000 | map leaf, size 10: @E6 → @EC |
| 0FD | 07 0E 03000000 DC00 0000 F3000000 | map branch, size 14, depth 0 (root), slots 0, 1: @DC → @F3 |
| 10B | 2C 3F65 | txt "?e" |
| 10E | 0F 0A 0B010000 FD00 0000 | map leaf, size 10: @10B → @FD |
| 118 | 5C 7175657279 | txt "query" |
| 11E | 0F 0A 18010000 C000 0000 | map leaf, size 10: @118 → @C0 |
| 128 | 5C 7061746368 | txt "patch" |
| 12E | 0F 0A 28010000 0E01 0000 | map leaf, size 10: @128 → @10E |
| 138 | 07 0E 40020000 1E01 0000 2E010000 | map branch, size 14, depth 2, slots 6, 9: @11E → @12E |
| 146 | 07 0A 01000000 3801 0000 | map branch, size 10, depth 1, slots 0: @138 |
| 150 | 07 0A 80000000 4601 0000 | map branch, size 10, depth 0 (root), slots 7: @146 |
| 15A | 50010000 00000000 | root → @150; previous: none |
Stardust rejects a mutation with a malformed patch or an unbound variable.
It also rejects a target that does not bind an entity or writes a protected
stardust/* field. An invalid typed value or a result that violates the
selected schema also causes rejection.
When a grouped mutation selects several schemas for an entity, the complete
patched document must satisfy all of them. Schema paths do not need to be group
keys. Groups removed by having, paging or other selection stages contribute
no schema constraints.
A mutation cannot write a definition. Stardust rejects a definition target with Definition_Target. Definitions
include schemas, queries and mutations. A patch that writes stardust/type
also gives Definition_Target. The preview gives the same
error, and no fact changes. Use the definition API to change a definition.
Computed values
Each field value is an expression evaluated for each selected row. A ?name
reads the row binding, plain text stays text, and maps are evaluated member by
member. #_tx metadata is evaluated once per run and may read caller inputs,
declared or implicit parameters, but no other row bindings.
A list whose first element names a function or macro is a call. Other lists
evaluate each element. Use list when the first element names a function or
macro but should stay data:
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 000 | 54 52 4F 4E | magic TRON |
| 004 | 2C 3F65 | txt "?e" |
| 007 | 4C 3F616765 | txt "?age" |
| 00C | 0E 11 00 0300 020000 00 04000000 070000 00 | array leaf, size 17, shift 0, bitmap 0003, count 2 (root): @4 → @7 |
| 01D | 2C 3F65 | txt "?e" |
| 020 | 4C 6E616D65 | txt "name" |
| 025 | 2C 4379 | txt "Cy" |
| 028 | 0E 15 00 0700 030000 00 1D000000 200000 00 25000000 | array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @1D → @20 → @25 |
| 03D | 2C 3F65 | txt "?e" |
| 040 | 3C 616765 | txt "age" |
| 044 | 4C 3F616765 | txt "?age" |
| 049 | 0E 15 00 0700 030000 00 3D000000 400000 00 44000000 | array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @3D → @40 → @44 |
| 05E | 0E 11 00 0300 020000 00 28000000 490000 00 | array leaf, size 17, shift 0, bitmap 0003, count 2 (root): @28 → @49 |
| 06F | 5C 7768657265 | txt "where" |
| 075 | 0F 0A 6F000000 5E00 0000 | map leaf, size 10: @6F → @5E |
| 07F | 4C 66696E64 | txt "find" |
| 084 | 0F 0A 7F000000 0C00 0000 | map leaf, size 10: @7F → @C |
| 08E | 07 0E 0A000000 7500 0000 84000000 | map branch, size 14, depth 0 (root), slots 1, 3: @75 → @84 |
| 09C | 1C 3C | txt "<" |
| 09E | 4C 3F616765 | txt "?age" |
| 0A3 | 02 1E000000000000 00 | i64 30 |
| 0AC | 0E 15 00 0700 030000 00 9C000000 9E0000 00 A3000000 | array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @9C → @9E → @A3 |
| 0C1 | 2C 6966 | txt "if" |
| 0C4 | 6C 6A756E696F72 | txt "junior" |
| 0CB | 6C 73656E696F72 | txt "senior" |
| 0D2 | 0E 19 00 0F00 040000 00 C1000000 AC0000 00 C4000000 CB0000 00 | array leaf, size 25, shift 0, bitmap 000F, count 4 (root): @C1 → @AC → @C4 → @CB |
| 0EB | 6C 64657369676E | txt "design" |
| 0F2 | 6C 72656D6F7465 | txt "remote" |
| 0F9 | 0E 11 00 0300 020000 00 EB000000 F20000 00 | array leaf, size 17, shift 0, bitmap 0003, count 2 (root): @EB → @F2 |
| 10A | 02 01000000000000 00 | i64 1 |
| 113 | 02 02000000000000 00 | i64 2 |
| 11C | 02 03000000000000 00 | i64 3 |
Show all 60 nodes
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 125 | 0E 15 00 0700 030000 00 0A010000 130100 00 1C010000 | array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @10A → @113 → @11C |
| 13A | 1C 2B | txt "+" |
| 13C | 4C 3F616765 | txt "?age" |
| 141 | 02 01000000000000 00 | i64 1 |
| 14A | 0E 15 00 0700 030000 00 3A010000 3C0100 00 41010000 | array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @13A → @13C → @141 |
| 15F | 2C 6279 | txt "by" |
| 162 | 3C 416461 | txt "Ada" |
| 166 | 0F 0A 5F010000 6201 0000 | map leaf, size 10: @15F → @162 |
| 170 | 3C 647565 | txt "due" |
| 174 | 0F 0A 70010000 4A01 0000 | map leaf, size 10: @170 → @14A |
| 17E | 07 0E 09000000 6601 0000 74010000 | map branch, size 14, depth 0 (root), slots 0, 3: @166 → @174 |
| 18C | 4C 62616E64 | txt "band" |
| 191 | 0F 0A 8C010000 D200 0000 | map leaf, size 10: @18C → @D2 |
| 19B | 4C 74616773 | txt "tags" |
| 1A0 | 0F 0A 9B010000 F900 0000 | map leaf, size 10: @19B → @F9 |
| 1AA | 6C 726576696577 | txt "review" |
| 1B1 | 0F 0A AA010000 7E01 0000 | map leaf, size 10: @1AA → @17E |
| 1BB | 6C 73636F726573 | txt "scores" |
| 1C2 | 0F 0A BB010000 2501 0000 | map leaf, size 10: @1BB → @125 |
| 1CC | 07 16 01E00000 9101 0000 A0010000 B101 0000 C2010000 | map branch, size 22, depth 0 (root), slots 0, 13, 14, 15: @191 → @1A0 → @1B1 → @1C2 |
| 1E2 | 2C 3F65 | txt "?e" |
| 1E5 | 0F 0A E2010000 CC01 0000 | map leaf, size 10: @1E2 → @1CC |
| 1EF | 5C 7175657279 | txt "query" |
| 1F5 | 0F 0A EF010000 8E00 0000 | map leaf, size 10: @1EF → @8E |
| 1FF | 5C 7061746368 | txt "patch" |
| 205 | 0F 0A FF010000 E501 0000 | map leaf, size 10: @1FF → @1E5 |
| 20F | 07 0E 40020000 F501 0000 05020000 | map branch, size 14, depth 2, slots 6, 9: @1F5 → @205 |
| 21D | 07 0A 01000000 0F02 0000 | map branch, size 10, depth 1, slots 0: @20F |
| 227 | 07 0A 80000000 1D02 0000 | map branch, size 10, depth 0 (root), slots 7: @21D |
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 231 | 27020000 00000000 | root → @227; previous: none |
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 00 | 54 52 4F 4E | magic TRON |
| 04 | 6C 737461747573 | txt "status" |
| 0B | 9C 436F6D6D697474 6564 | txt "Committed" |
| 15 | 0F 0A 04000000 0B00 0000 | map leaf, size 10: @4 → @B |
| 1F | BC 7472616E736163 74696F6E | txt "transaction" |
| 2B | 02 0A000000000000 00 | i64 10 |
| 34 | 0F 0A 1F000000 2B00 0000 | map leaf, size 10: @1F → @2B |
| 3E | 9C 67656E65726174 6564 | txt "generated" |
| 48 | 02 00000000000000 00 | i64 0 |
| 51 | 0F 0A 3E000000 4800 0000 | map leaf, size 10: @3E → @48 |
| 5B | 5C 6661637473 | txt "facts" |
| 61 | 02 04000000000000 00 | i64 4 |
| 6A | 0F 0A 5B000000 6100 0000 | map leaf, size 10: @5B → @61 |
| 74 | 07 16 01620000 1500 0000 34000000 5100 0000 6A000000 | map branch, size 22, depth 0 (root), slots 0, 9, 13, 14: @15 → @34 → @51 → @6A |
| 8A | 74000000 00000000 | root → @74; previous: none |
Values from the query
A target's whole body can come from the query: {?e ?body} takes an object
of fields, or null, from the row binding ?body. A key can also come from
the query: in {?e {?field value}} the text bound to ?field names the field.
These bound values are data, not evaluated again.
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 000 | 54 52 4F 4E | magic TRON |
| 004 | 2C 3F65 | txt "?e" |
| 007 | 6C 3F6669656C64 | txt "?field" |
| 00E | 0E 11 00 0300 020000 00 04000000 070000 00 | array leaf, size 17, shift 0, bitmap 0003, count 2 (root): @4 → @7 |
| 01F | 2C 3F65 | txt "?e" |
| 022 | 4C 6E616D65 | txt "name" |
| 027 | 2C 4379 | txt "Cy" |
| 02A | 0E 15 00 0700 030000 00 1F000000 220000 00 27000000 | array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @1F → @22 → @27 |
| 03F | 2C 6966 | txt "if" |
| 042 | 09 | bit true |
| 043 | 4C 62616E64 | txt "band" |
| 048 | 00 | nil |
| 049 | 0E 19 00 0F00 040000 00 3F000000 420000 00 43000000 480000 00 | array leaf, size 25, shift 0, bitmap 000F, count 4 (root): @3F → @42 → @43 → @48 |
| 062 | 6C 3F6669656C64 | txt "?field" |
| 069 | 0E 11 00 0300 020000 00 49000000 620000 00 | array leaf, size 17, shift 0, bitmap 0003, count 2 (root): @49 → @62 |
| 07A | 0E 11 00 0300 020000 00 2A000000 690000 00 | array leaf, size 17, shift 0, bitmap 0003, count 2 (root): @2A → @69 |
| 08B | 5C 7768657265 | txt "where" |
| 091 | 0F 0A 8B000000 7A00 0000 | map leaf, size 10: @8B → @7A |
| 09B | 4C 66696E64 | txt "find" |
| 0A0 | 0F 0A 9B000000 0E00 0000 | map leaf, size 10: @9B → @E |
| 0AA | 07 0E 0A000000 9100 0000 A0000000 | map branch, size 14, depth 0 (root), slots 1, 3: @91 → @A0 |
| 0B8 | 6C 3F6669656C64 | txt "?field" |
| 0BF | 00 | nil |
| 0C0 | 0F 0A B8000000 BF00 0000 | map leaf, size 10: @B8 → @BF |
| 0CA | 2C 3F65 | txt "?e" |
| 0CD | 0F 0A CA000000 C000 0000 | map leaf, size 10: @CA → @C0 |
| 0D7 | 5C 7175657279 | txt "query" |
| 0DD | 0F 0A D7000000 AA00 0000 | map leaf, size 10: @D7 → @AA |
| 0E7 | 5C 7061746368 | txt "patch" |
| 0ED | 0F 0A E7000000 CD00 0000 | map leaf, size 10: @E7 → @CD |
| 0F7 | 07 0E 40020000 DD00 0000 ED000000 | map branch, size 14, depth 2, slots 6, 9: @DD → @ED |
| 105 | 07 0A 01000000 F700 0000 | map branch, size 10, depth 1, slots 0: @F7 |
| 10F | 07 0A 80000000 0501 0000 | map branch, size 10, depth 0 (root), slots 7: @105 |
| 119 | 0F010000 00000000 | root → @10F; previous: none |
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 00 | 54 52 4F 4E | magic TRON |
| 04 | 6C 737461747573 | txt "status" |
| 0B | 9C 436F6D6D697474 6564 | txt "Committed" |
| 15 | 0F 0A 04000000 0B00 0000 | map leaf, size 10: @4 → @B |
| 1F | BC 7472616E736163 74696F6E | txt "transaction" |
| 2B | 02 0B000000000000 00 | i64 11 |
| 34 | 0F 0A 1F000000 2B00 0000 | map leaf, size 10: @1F → @2B |
| 3E | 9C 67656E65726174 6564 | txt "generated" |
| 48 | 02 00000000000000 00 | i64 0 |
| 51 | 0F 0A 3E000000 4800 0000 | map leaf, size 10: @3E → @48 |
| 5B | 5C 6661637473 | txt "facts" |
| 61 | 02 01000000000000 00 | i64 1 |
| 6A | 0F 0A 5B000000 6100 0000 | map leaf, size 10: @5B → @61 |
| 74 | 07 16 01620000 1500 0000 34000000 5100 0000 6A000000 | map branch, size 22, depth 0 (root), slots 0, 9, 13, 14: @15 → @34 → @51 → @6A |
| 8A | 74000000 00000000 | root → @74; previous: none |
Delete an entity
A null body deletes each selected data entity, as a null entity does in a
patch. Stardust refuses to delete a definition or an object, and
rejects a patch that deletes an entity and also writes a value to it.
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 00 | 54 52 4F 4E | magic TRON |
| 04 | 2C 3F65 | txt "?e" |
| 07 | 0E 0D 00 0100 010000 00 04000000 | array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @4 |
| 14 | 2C 3F65 | txt "?e" |
| 17 | 4C 6E616D65 | txt "name" |
| 1C | 3C 457665 | txt "Eve" |
| 20 | 0E 15 00 0700 030000 00 14000000 170000 00 1C000000 | array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @14 → @17 → @1C |
| 35 | 0E 0D 00 0100 010000 00 20000000 | array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @20 |
| 42 | 5C 7768657265 | txt "where" |
| 48 | 0F 0A 42000000 3500 0000 | map leaf, size 10: @42 → @35 |
| 52 | 4C 66696E64 | txt "find" |
| 57 | 0F 0A 52000000 0700 0000 | map leaf, size 10: @52 → @7 |
| 61 | 07 0E 0A000000 4800 0000 57000000 | map branch, size 14, depth 0 (root), slots 1, 3: @48 → @57 |
| 6F | 2C 3F65 | txt "?e" |
| 72 | 00 | nil |
| 73 | 0F 0A 6F000000 7200 0000 | map leaf, size 10: @6F → @72 |
| 7D | 5C 7175657279 | txt "query" |
| 83 | 0F 0A 7D000000 6100 0000 | map leaf, size 10: @7D → @61 |
| 8D | 5C 7061746368 | txt "patch" |
| 93 | 0F 0A 8D000000 7300 0000 | map leaf, size 10: @8D → @73 |
| 9D | 07 0E 40020000 8300 0000 93000000 | map branch, size 14, depth 2, slots 6, 9: @83 → @93 |
| AB | 07 0A 01000000 9D00 0000 | map branch, size 10, depth 1, slots 0: @9D |
| B5 | 07 0A 80000000 AB00 0000 | map branch, size 10, depth 0 (root), slots 7: @AB |
| BF | B5000000 00000000 | root → @B5; previous: none |
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 00 | 54 52 4F 4E | magic TRON |
| 04 | 6C 737461747573 | txt "status" |
| 0B | 9C 436F6D6D697474 6564 | txt "Committed" |
| 15 | 0F 0A 04000000 0B00 0000 | map leaf, size 10: @4 → @B |
| 1F | BC 7472616E736163 74696F6E | txt "transaction" |
| 2B | 02 0C000000000000 00 | i64 12 |
| 34 | 0F 0A 1F000000 2B00 0000 | map leaf, size 10: @1F → @2B |
| 3E | 9C 67656E65726174 6564 | txt "generated" |
| 48 | 02 00000000000000 00 | i64 0 |
| 51 | 0F 0A 3E000000 4800 0000 | map leaf, size 10: @3E → @48 |
| 5B | 5C 6661637473 | txt "facts" |
| 61 | 02 04000000000000 00 | i64 4 |
| 6A | 0F 0A 5B000000 6100 0000 | map leaf, size 10: @5B → @61 |
| 74 | 07 16 01620000 1500 0000 34000000 5100 0000 6A000000 | map branch, size 22, depth 0 (root), slots 0, 9, 13, 14: @15 → @34 → @51 → @6A |
| 8A | 74000000 00000000 | root → @74; previous: none |
A computed patch
A list as the whole patch is an expression evaluated for each row. Its
result is a patch in the forms above, or null for no change to that row. The
result is data: its text values are not evaluated again, and it cannot write
#_tx.
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 000 | 54 52 4F 4E | magic TRON |
| 004 | 2C 3F65 | txt "?e" |
| 007 | 5C 3F64657074 | txt "?dept" |
| 00D | 0E 11 00 0300 020000 00 04000000 070000 00 | array leaf, size 17, shift 0, bitmap 0003, count 2 (root): @4 → @7 |
| 01E | 2C 3F65 | txt "?e" |
| 021 | 4C 64657074 | txt "dept" |
| 026 | 5C 3F64657074 | txt "?dept" |
| 02C | 0E 15 00 0700 030000 00 1E000000 210000 00 26000000 | array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @1E → @21 → @26 |
| 041 | 0E 0D 00 0100 010000 00 2C000000 | array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @2C |
| 04E | 5C 7768657265 | txt "where" |
| 054 | 0F 0A 4E000000 4100 0000 | map leaf, size 10: @4E → @41 |
| 05E | 4C 66696E64 | txt "find" |
| 063 | 0F 0A 5E000000 0D00 0000 | map leaf, size 10: @5E → @D |
| 06D | 07 0E 0A000000 5400 0000 63000000 | map branch, size 14, depth 0 (root), slots 1, 3: @54 → @63 |
| 07B | 1C 3D | txt "=" |
| 07D | 5C 3F64657074 | txt "?dept" |
| 083 | 5C 73616C6573 | txt "sales" |
| 089 | 0E 15 00 0700 030000 00 7B000000 7D0000 00 83000000 | array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @7B → @7D → @83 |
| 09E | 6C 726567696F6E | txt "region" |
| 0A5 | 4C 77657374 | txt "west" |
| 0AA | 0F 0A 9E000000 A500 0000 | map leaf, size 10: @9E → @A5 |
| 0B4 | 2C 3F65 | txt "?e" |
| 0B7 | 0F 0A B4000000 AA00 0000 | map leaf, size 10: @B4 → @AA |
| 0C1 | 2C 6966 | txt "if" |
| 0C4 | 00 | nil |
| 0C5 | 0E 19 00 0F00 040000 00 C1000000 890000 00 B7000000 C40000 00 | array leaf, size 25, shift 0, bitmap 000F, count 4 (root): @C1 → @89 → @B7 → @C4 |
| 0DE | 5C 7175657279 | txt "query" |
| 0E4 | 0F 0A DE000000 6D00 0000 | map leaf, size 10: @DE → @6D |
| 0EE | 5C 7061746368 | txt "patch" |
| 0F4 | 0F 0A EE000000 C500 0000 | map leaf, size 10: @EE → @C5 |
| 0FE | 07 0E 40020000 E400 0000 F4000000 | map branch, size 14, depth 2, slots 6, 9: @E4 → @F4 |
| 10C | 07 0A 01000000 FE00 0000 | map branch, size 10, depth 1, slots 0: @FE |
| 116 | 07 0A 80000000 0C01 0000 | map branch, size 10, depth 0 (root), slots 7: @10C |
| 120 | 16010000 00000000 | root → @116; previous: none |
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 00 | 54 52 4F 4E | magic TRON |
| 04 | 6C 737461747573 | txt "status" |
| 0B | 9C 436F6D6D697474 6564 | txt "Committed" |
| 15 | 0F 0A 04000000 0B00 0000 | map leaf, size 10: @4 → @B |
| 1F | BC 7472616E736163 74696F6E | txt "transaction" |
| 2B | 02 0D000000000000 00 | i64 13 |
| 34 | 0F 0A 1F000000 2B00 0000 | map leaf, size 10: @1F → @2B |
| 3E | 9C 67656E65726174 6564 | txt "generated" |
| 48 | 02 00000000000000 00 | i64 0 |
| 51 | 0F 0A 3E000000 4800 0000 | map leaf, size 10: @3E → @48 |
| 5B | 5C 6661637473 | txt "facts" |
| 61 | 02 02000000000000 00 | i64 2 |
| 6A | 0F 0A 5B000000 6100 0000 | map leaf, size 10: @5B → @61 |
| 74 | 07 16 01620000 1500 0000 34000000 5100 0000 6A000000 | map branch, size 22, depth 0 (root), slots 0, 9, 13, 14: @15 → @34 → @51 → @6A |
| 8A | 74000000 00000000 | root → @74; previous: none |