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_deleted(&mut self, identity: Identity) -> Result<()>;
153}
154
155pub trait CatalogTrackRoleChangeOperations {
156 fn track_role_created(&mut self, role: Role) -> Result<()>;
157
158 fn track_role_deleted(&mut self, role: Role) -> Result<()>;
159}
160
161pub trait CatalogTrackGrantedRoleChangeOperations {
162 fn track_granted_role_created(&mut self, granted_role: GrantedRole) -> Result<()>;
163
164 fn track_granted_role_deleted(&mut self, granted_role: GrantedRole) -> Result<()>;
165}
166
167pub trait CatalogTrackIdentityAttributeChangeOperations {
168 fn track_identity_attribute_created(&mut self, attribute: IdentityAttribute) -> Result<()>;
169
170 fn track_identity_attribute_deleted(&mut self, attribute: IdentityAttribute) -> Result<()>;
171}
172
173pub trait CatalogTrackIdentityAttributeValueChangeOperations {
174 fn track_identity_attribute_value_created(&mut self, value: IdentityAttributeValue) -> Result<()>;
175
176 fn track_identity_attribute_value_deleted(&mut self, value: IdentityAttributeValue) -> Result<()>;
177}
178
179pub trait CatalogTrackPolicyChangeOperations {
180 fn track_policy_created(&mut self, policy: Policy) -> Result<()>;
181
182 fn track_policy_updated(&mut self, pre: Policy, post: Policy) -> Result<()>;
183
184 fn track_policy_deleted(&mut self, policy: Policy) -> Result<()>;
185}
186
187pub trait CatalogTrackMigrationChangeOperations {
188 fn track_migration_created(&mut self, migration: Migration) -> Result<()>;
189}
190
191pub trait CatalogTrackMigrationEventChangeOperations {
192 fn track_migration_event_created(&mut self, event: MigrationEvent) -> Result<()>;
193}
194
195pub trait CatalogTrackAuthenticationChangeOperations {
196 fn track_authentication_created(&mut self, auth: Authentication) -> Result<()>;
197
198 fn track_authentication_deleted(&mut self, auth: Authentication) -> Result<()>;
199}
200
201pub trait CatalogTrackSourceChangeOperations {
202 fn track_source_created(&mut self, source: Source) -> Result<()>;
203
204 fn track_source_deleted(&mut self, source: Source) -> Result<()>;
205}
206
207pub trait CatalogTrackBindingChangeOperations {
208 fn track_binding_created(&mut self, binding: Binding) -> Result<()>;
209
210 fn track_binding_deleted(&mut self, binding: Binding) -> Result<()>;
211}
212
213pub trait CatalogTrackSinkChangeOperations {
214 fn track_sink_created(&mut self, sink: Sink) -> Result<()>;
215
216 fn track_sink_deleted(&mut self, sink: Sink) -> Result<()>;
217}
218
219pub trait CatalogTrackRowSettingsChangeOperations {
220 fn track_row_settings_created(&mut self, storage: StorageId, settings: RowSettings) -> Result<()>;
221}
222
223pub trait CatalogTrackOperatorSettingsChangeOperations {
224 fn track_operator_settings_created(&mut self, operator: OperatorId, settings: OperatorSettings) -> Result<()>;
225}
226
227pub trait CatalogTrackChangeOperations:
228 CatalogTrackBindingChangeOperations
229 + CatalogTrackColumnSnapshotChangeOperations
230 + CatalogTrackDictionaryChangeOperations
231 + CatalogTrackFlowChangeOperations
232 + CatalogTrackPrimaryKeyChangeOperations
233 + CatalogTrackOperatorChangeOperations
234 + CatalogTrackFlowEdgeChangeOperations
235 + CatalogTrackHandlerChangeOperations
236 + CatalogTrackMigrationChangeOperations
237 + CatalogTrackMigrationEventChangeOperations
238 + CatalogTrackNamespaceChangeOperations
239 + CatalogTrackProcedureChangeOperations
240 + CatalogTrackQueueChangeOperations
241 + CatalogTrackRelationshipChangeOperations
242 + CatalogTrackRingBufferChangeOperations
243 + CatalogTrackRoleChangeOperations
244 + CatalogTrackPolicyChangeOperations
245 + CatalogTrackSeriesChangeOperations
246 + CatalogTrackSinkChangeOperations
247 + CatalogTrackSourceChangeOperations
248 + CatalogTrackSumTypeChangeOperations
249 + CatalogTrackTableChangeOperations
250 + CatalogTrackTestChangeOperations
251 + CatalogTrackAuthenticationChangeOperations
252 + CatalogTrackIdentityChangeOperations
253 + CatalogTrackGrantedRoleChangeOperations
254 + CatalogTrackIdentityAttributeChangeOperations
255 + CatalogTrackIdentityAttributeValueChangeOperations
256 + CatalogTrackViewChangeOperations
257 + CatalogTrackConfigChangeOperations
258 + CatalogTrackRowSettingsChangeOperations
259 + CatalogTrackOperatorSettingsChangeOperations
260{
261}