Commit 8152d8b
authored
chore: Add support for transactional data stores. (#186)
- Adds support for transactional application of data to the in-memory
data store.
- Implements a conversion from an FDv2ChangeSet to a DataStore specific
ChangeSet.
- Changes the FDv2 selector to be generally applicable instead of FDv2
specific.
- Does not implement the interface for persistent stores.
- Does not add support for data source updates, just the store.
- Changes a number of types to structs that should have been structs.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Adds transactional ChangeSet support to the in-memory store and
unifies FDv2 selector into a shared Selector used across data flow.
>
> - **Data store**:
> - **Transactional updates**: `InMemoryDataStore` now implements
`ITransactionalDataStore` with `Apply(ChangeSet)` supporting `Full`,
`Partial`, and `None` updates; maintains `Selector` and preserves/env-id
metadata on full init.
> - **ChangeSet API**: Introduces `DataStoreTypes.ChangeSet` and
`ChangeSetType` for batching changes by `DataKind`.
> - **Selector unification**:
> - Replaces FDv2-specific selector with shared `Subsystems.Selector`;
exposes `Selector` on `ITransactionalDataStore` and `InMemoryDataStore`.
> - **FDv2 pipeline**:
> - `FDv2ChangeSet` now carries shared `Selector` and uses struct
`FDv2Change`.
> - New translator `FDv2ChangeSetTranslator.ToChangeSet` converts FDv2
changes to store `ChangeSet`; retains FDv1 `PutData`/`PatchData`
translations.
> - `FDv2ProtocolHandler` and `FDv2StreamingDataSource` updated to use
shared `Selector`.
> - **Tests**:
> - Extensive tests for transactional apply behavior, selector handling,
translator conversion, protocol updates, and streaming integration.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
1808897. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 615df4c commit 8152d8b
File tree
13 files changed
+1127
-50
lines changed- pkgs/sdk/server
- src
- Internal
- DataStores
- FDv2DataSources
- Subsystems
- test/Internal
- DataStores
- FDv2DataSources
13 files changed
+1127
-50
lines changedLines changed: 102 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
2 | 4 | | |
3 | | - | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | | - | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
| 22 | + | |
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
24 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
25 | 52 | | |
26 | 53 | | |
27 | 54 | | |
| |||
36 | 63 | | |
37 | 64 | | |
38 | 65 | | |
| 66 | + | |
39 | 67 | | |
40 | 68 | | |
41 | 69 | | |
42 | 70 | | |
| 71 | + | |
43 | 72 | | |
44 | 73 | | |
45 | 74 | | |
| |||
49 | 78 | | |
50 | 79 | | |
51 | 80 | | |
| 81 | + | |
52 | 82 | | |
53 | 83 | | |
54 | 84 | | |
| |||
60 | 90 | | |
61 | 91 | | |
62 | 92 | | |
| 93 | + | |
63 | 94 | | |
64 | 95 | | |
65 | 96 | | |
66 | 97 | | |
67 | 98 | | |
68 | 99 | | |
| 100 | + | |
69 | 101 | | |
70 | 102 | | |
71 | 103 | | |
72 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
73 | 124 | | |
74 | 125 | | |
75 | 126 | | |
76 | 127 | | |
77 | 128 | | |
78 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
79 | 132 | | |
80 | 133 | | |
81 | 134 | | |
82 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
83 | 176 | | |
84 | | - | |
| 177 | + | |
85 | 178 | | |
86 | 179 | | |
87 | 180 | | |
88 | 181 | | |
89 | | - | |
| 182 | + | |
90 | 183 | | |
91 | 184 | | |
92 | 185 | | |
| |||
99 | 192 | | |
100 | 193 | | |
101 | 194 | | |
| 195 | + | |
102 | 196 | | |
103 | 197 | | |
104 | 198 | | |
| |||
Lines changed: 7 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | | - | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
117 | | - | |
| 118 | + | |
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
124 | | - | |
| 125 | + | |
125 | 126 | | |
126 | | - | |
| 127 | + | |
127 | 128 | | |
128 | 129 | | |
129 | 130 | | |
130 | | - | |
| 131 | + | |
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
137 | | - | |
| 138 | + | |
138 | 139 | | |
139 | 140 | | |
Lines changed: 96 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | | - | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
16 | 109 | | |
17 | 110 | | |
18 | 111 | | |
| |||
60 | 153 | | |
61 | 154 | | |
62 | 155 | | |
63 | | - | |
| 156 | + | |
64 | 157 | | |
65 | 158 | | |
66 | 159 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
277 | 278 | | |
278 | 279 | | |
279 | 280 | | |
280 | | - | |
| 281 | + | |
281 | 282 | | |
282 | 283 | | |
283 | 284 | | |
| |||
Lines changed: 0 additions & 23 deletions
This file was deleted.
0 commit comments