You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`FALSE`|`FALSE`|**Base**| The canonical saved request in a collection. Visible in the sidebar. |
30
+
|`TRUE`|`FALSE`|**Delta**|An inheritance-based override of a base record. Inherits all fields, overrides selectively.|
31
+
|`FALSE`|`TRUE`|**Snapshot**| An immutable, fully-resolved copy captured at execution time. |
32
32
33
33
The combination `is_delta=TRUE, is_snapshot=TRUE` is **invalid** and enforced by:
34
34
@@ -41,11 +41,14 @@ The normal saved requests users see in the workspace tree.
41
41
42
42
#### Delta Records
43
43
44
-
Non-destructive overlays on top of a base record. Used when users edit a request in the UI before saving.
44
+
Deltas implement an **inheritance/override system**on top of base records. A delta is a child of a base record that inherits every field from its parent and selectively overrides only the fields it specifies. This is used when users edit a request in the UI before saving — the edits are stored as a delta, leaving the original base untouched.
45
45
46
-
-**Parent Relationship:** Deltas link back to a `ParentHttpID` (enforced by a `CHECK` constraint).
47
-
-**NULL-means-no-change:** Delta override fields (`delta_url`, `delta_method`, etc.) use `NULL` to indicate "inherit from parent". Only non-NULL fields override the base.
48
-
-**Resolution:**`packages/server/pkg/delta` merges base + delta into a resolved view at read time.
46
+
-**Parent Relationship:** Every delta links back to a `ParentHttpID` (enforced by a `CHECK` constraint: `is_delta = FALSE OR parent_http_id IS NOT NULL`). Deleting the parent cascades to all its deltas.
47
+
-**NULL-means-inherit:** Each overridable field has a corresponding `delta_*` column (e.g., `delta_url`, `delta_method`, `delta_name`, `delta_body_kind`, `delta_description`). A `NULL` delta field means "inherit from the parent base". Only non-NULL delta fields override the base value.
48
+
-**Child entity inheritance:** The same override pattern extends to child entities (headers, params, body forms, URL-encoded entries, body raw, asserts). Each child delta can either:
49
+
-**Override** an existing parent child (via `parent_http_header_id`, `parent_http_search_param_id`, etc.) — inheriting its fields and selectively overriding them.
50
+
-**Add** a new child (when the parent link is `NULL`) — appended to the resolved collection.
51
+
-**Resolution:**`packages/server/pkg/delta` merges base + delta into a fully resolved view at read time. The resolver walks every field and child entity, applying the override-or-inherit logic, and returns a complete HTTP request with `IsDelta = false`.
49
52
50
53
#### Snapshot Records
51
54
@@ -89,9 +92,10 @@ When a request is "Run":
89
92
90
93
-**Pure Go Structs:** Decoupled from DB and API.
91
94
-**Key Fields:**
92
-
-`IsDelta` (bool): Marks a request as a transient edit (delta overlay).
95
+
-`IsDelta` (bool): Marks a request as an inherited override of a base record (see Delta Records).
93
96
-`IsSnapshot` (bool): Marks a request as an immutable version snapshot.
94
-
-`ParentHttpID` (UUID): Links a delta to its source base record.
97
+
-`ParentHttpID` (UUID): Links a delta to its parent base record for inheritance.
0 commit comments