reifydb_core/interface/catalog/
change.rs1use reifydb_value::Result;
5
6use crate::{
7 interface::catalog::{
8 authentication::Authentication,
9 binding::Binding,
10 column_snapshot::ColumnSnapshot,
11 config::Config,
12 dictionary::Dictionary,
13 flow::{Flow, FlowEdge, Operator, OperatorId},
14 handler::Handler,
15 identity::{GrantedRole, Identity, IdentityAttribute, IdentityAttributeValue, Role},
16 key::PrimaryKey,
17 migration::{Migration, MigrationEvent},
18 namespace::Namespace,
19 object::ObjectId,
20 policy::Policy,
21 procedure::Procedure,
22 queue::Queue,
23 relationship::Relationship,
24 ringbuffer::RingBuffer,
25 series::Series,
26 sink::Sink,
27 source::Source,
28 storage::StorageId,
29 sumtype::SumType,
30 table::Table,
31 test::Test,
32 view::View,
33 },
34 row::{OperatorSettings, RowSettings},
35};
36
37pub trait CatalogTrackConfigChangeOperations {
38 fn track_config_set(&mut self, pre: Config, post: Config) -> Result<()>;
39}
40
41pub trait CatalogTrackTableChangeOperations {
42 fn track_table_created(&mut self, table: Table) -> Result<()>;
43
44 fn track_table_updated(&mut self, pre: Table, post: Table) -> Result<()>;
45
46 fn track_table_deleted(&mut self, table: Table) -> Result<()>;
47}
48
49pub trait CatalogTrackRelationshipChangeOperations {
50 fn track_relationship_created(&mut self, relationship: Relationship) -> Result<()>;
51
52 fn track_relationship_deleted(&mut self, relationship: Relationship) -> Result<()>;
53}
54
55pub trait CatalogTrackNamespaceChangeOperations {
56 fn track_namespace_created(&mut self, namespace: Namespace) -> Result<()>;
57
58 fn track_namespace_deleted(&mut self, namespace: Namespace) -> Result<()>;
59}
60
61pub trait CatalogTrackFlowChangeOperations {
62 fn track_flow_created(&mut self, flow: Flow) -> Result<()>;
63
64 fn track_flow_deleted(&mut self, flow: Flow) -> Result<()>;
65}
66
67pub trait CatalogTrackPrimaryKeyChangeOperations {
68 fn track_primary_key_created(&mut self, object: ObjectId, primary_key: PrimaryKey) -> Result<()>;
69
70 fn track_primary_key_deleted(&mut self, object: ObjectId, primary_key: PrimaryKey) -> Result<()>;
71}
72
73pub trait CatalogTrackOperatorChangeOperations {
74 fn track_operator_created(&mut self, operator: Operator) -> Result<()>;
75
76 fn track_operator_deleted(&mut self, operator: Operator) -> Result<()>;
77}
78
79pub trait CatalogTrackFlowEdgeChangeOperations {
80 fn track_flow_edge_created(&mut self, edge: FlowEdge) -> Result<()>;
81
82 fn track_flow_edge_deleted(&mut self, edge: FlowEdge) -> Result<()>;
83}
84
85pub trait CatalogTrackViewChangeOperations {
86 fn track_view_created(&mut self, view: View) -> Result<()>;
87
88 fn track_view_deleted(&mut self, view: View) -> Result<()>;
89}
90
91pub trait CatalogTrackDictionaryChangeOperations {
92 fn track_dictionary_created(&mut self, dictionary: Dictionary) -> Result<()>;
93
94 fn track_dictionary_deleted(&mut self, dictionary: Dictionary) -> Result<()>;
95}
96
97pub trait CatalogTrackColumnSnapshotChangeOperations {
98 fn track_column_snapshot_created(&mut self, snapshot: ColumnSnapshot) -> Result<()>;
99
100 fn track_column_snapshot_updated(&mut self, pre: ColumnSnapshot, post: ColumnSnapshot) -> Result<()>;
101
102 fn track_column_snapshot_deleted(&mut self, snapshot: ColumnSnapshot) -> Result<()>;
103}
104
105pub trait CatalogTrackSeriesChangeOperations {
106 fn track_series_created(&mut self, series: Series) -> Result<()>;
107
108 fn track_series_updated(&mut self, pre: Series, post: Series) -> Result<()>;
109
110 fn track_series_deleted(&mut self, series: Series) -> Result<()>;
111}
112
113pub trait CatalogTrackRingBufferChangeOperations {
114 fn track_ringbuffer_created(&mut self, ringbuffer: RingBuffer) -> Result<()>;
115
116 fn track_ringbuffer_deleted(&mut self, ringbuffer: RingBuffer) -> Result<()>;
117}
118
119pub trait CatalogTrackQueueChangeOperations {
120 fn track_queue_created(&mut self, queue: Queue) -> Result<()>;
121
122 fn track_queue_deleted(&mut self, queue: Queue) -> Result<()>;
123}
124
125pub trait CatalogTrackSumTypeChangeOperations {
126 fn track_sumtype_created(&mut self, sumtype: SumType) -> Result<()>;
127
128 fn track_sumtype_deleted(&mut self, sumtype: SumType) -> Result<()>;
129}
130
131pub trait CatalogTrackProcedureChangeOperations {
132 fn track_procedure_created(&mut self, procedure: Procedure) -> Result<()>;
133
134 fn track_procedure_deleted(&mut self, procedure: Procedure) -> Result<()>;
135}
136
137pub trait CatalogTrackTestChangeOperations {
138 fn track_test_created(&mut self, test: Test) -> Result<()>;
139
140 fn track_test_deleted(&mut self, test: Test) -> Result<()>;
141}
142
143pub trait CatalogTrackHandlerChangeOperations {
144 fn track_handler_created(&mut self, handler: Handler) -> Result<()>;
145
146 fn track_handler_deleted(&mut self, handler: Handler) -> Result<()>;
147}
148
149pub trait CatalogTrackIdentityChangeOperations {
150 fn track_identity_created(&mut self, identity: Identity) -> Result<()>;
151
152 fn track_identity_updated(&mut self, pre: Identity, post: Identity) -> Result<()>;
153
154 fn track_identity_deleted(&mut self, identity: Identity) -> Result<()>;
155}
156
157pub trait CatalogTrackRoleChangeOperations {
158 fn track_role_created(&mut self, role: Role) -> Result<()>;
159
160 fn track_role_deleted(&mut self, role: Role) -> Result<()>;
161}
162
163pub trait CatalogTrackGrantedRoleChangeOperations {
164 fn track_granted_role_created(&mut self, granted_role: GrantedRole) -> Result<()>;
165
166 fn track_granted_role_deleted(&mut self, granted_role: GrantedRole) -> Result<()>;
167}
168
169pub trait CatalogTrackIdentityAttributeChangeOperations {
170 fn track_identity_attribute_created(&mut self, attribute: IdentityAttribute) -> Result<()>;
171
172 fn track_identity_attribute_deleted(&mut self, attribute: IdentityAttribute) -> Result<()>;
173}
174
175pub trait CatalogTrackIdentityAttributeValueChangeOperations {
176 fn track_identity_attribute_value_created(&mut self, value: IdentityAttributeValue) -> Result<()>;
177
178 fn track_identity_attribute_value_deleted(&mut self, value: IdentityAttributeValue) -> Result<()>;
179}
180
181pub trait CatalogTrackPolicyChangeOperations {
182 fn track_policy_created(&mut self, policy: Policy) -> Result<()>;
183
184 fn track_policy_updated(&mut self, pre: Policy, post: Policy) -> Result<()>;
185
186 fn track_policy_deleted(&mut self, policy: Policy) -> Result<()>;
187}
188
189pub trait CatalogTrackMigrationChangeOperations {
190 fn track_migration_created(&mut self, migration: Migration) -> Result<()>;
191}
192
193pub trait CatalogTrackMigrationEventChangeOperations {
194 fn track_migration_event_created(&mut self, event: MigrationEvent) -> Result<()>;
195}
196
197pub trait CatalogTrackAuthenticationChangeOperations {
198 fn track_authentication_created(&mut self, auth: Authentication) -> Result<()>;
199
200 fn track_authentication_deleted(&mut self, auth: Authentication) -> Result<()>;
201}
202
203pub trait CatalogTrackSourceChangeOperations {
204 fn track_source_created(&mut self, source: Source) -> Result<()>;
205
206 fn track_source_deleted(&mut self, source: Source) -> Result<()>;
207}
208
209pub trait CatalogTrackBindingChangeOperations {
210 fn track_binding_created(&mut self, binding: Binding) -> Result<()>;
211
212 fn track_binding_deleted(&mut self, binding: Binding) -> Result<()>;
213}
214
215pub trait CatalogTrackSinkChangeOperations {
216 fn track_sink_created(&mut self, sink: Sink) -> Result<()>;
217
218 fn track_sink_deleted(&mut self, sink: Sink) -> Result<()>;
219}
220
221pub trait CatalogTrackRowSettingsChangeOperations {
222 fn track_row_settings_created(&mut self, storage: StorageId, settings: RowSettings) -> Result<()>;
223}
224
225pub trait CatalogTrackOperatorSettingsChangeOperations {
226 fn track_operator_settings_created(&mut self, operator: OperatorId, settings: OperatorSettings) -> Result<()>;
227}
228
229pub trait CatalogTrackChangeOperations:
230 CatalogTrackBindingChangeOperations
231 + CatalogTrackColumnSnapshotChangeOperations
232 + CatalogTrackDictionaryChangeOperations
233 + CatalogTrackFlowChangeOperations
234 + CatalogTrackPrimaryKeyChangeOperations
235 + CatalogTrackOperatorChangeOperations
236 + CatalogTrackFlowEdgeChangeOperations
237 + CatalogTrackHandlerChangeOperations
238 + CatalogTrackMigrationChangeOperations
239 + CatalogTrackMigrationEventChangeOperations
240 + CatalogTrackNamespaceChangeOperations
241 + CatalogTrackProcedureChangeOperations
242 + CatalogTrackQueueChangeOperations
243 + CatalogTrackRelationshipChangeOperations
244 + CatalogTrackRingBufferChangeOperations
245 + CatalogTrackRoleChangeOperations
246 + CatalogTrackPolicyChangeOperations
247 + CatalogTrackSeriesChangeOperations
248 + CatalogTrackSinkChangeOperations
249 + CatalogTrackSourceChangeOperations
250 + CatalogTrackSumTypeChangeOperations
251 + CatalogTrackTableChangeOperations
252 + CatalogTrackTestChangeOperations
253 + CatalogTrackAuthenticationChangeOperations
254 + CatalogTrackIdentityChangeOperations
255 + CatalogTrackGrantedRoleChangeOperations
256 + CatalogTrackIdentityAttributeChangeOperations
257 + CatalogTrackIdentityAttributeValueChangeOperations
258 + CatalogTrackViewChangeOperations
259 + CatalogTrackConfigChangeOperations
260 + CatalogTrackRowSettingsChangeOperations
261 + CatalogTrackOperatorSettingsChangeOperations
262{
263}