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