reifydb_core/interface/catalog/
change.rs1use reifydb_type::Result;
10
11use crate::{
12 interface::catalog::{
13 authentication::Authentication,
14 binding::Binding,
15 config::Config,
16 dictionary::Dictionary,
17 flow::Flow,
18 handler::Handler,
19 identity::{GrantedRole, Identity, Role},
20 migration::{Migration, MigrationEvent},
21 namespace::Namespace,
22 policy::Policy,
23 procedure::Procedure,
24 ringbuffer::RingBuffer,
25 series::Series,
26 shape::ShapeId,
27 sink::Sink,
28 source::Source,
29 sumtype::SumType,
30 table::Table,
31 test::Test,
32 view::View,
33 },
34 row::RowTtl,
35};
36
37pub trait CatalogTrackConfigChangeOperations {
39 fn track_config_set(&mut self, pre: Config, post: Config) -> Result<()>;
40}
41
42pub trait CatalogTrackTableChangeOperations {
44 fn track_table_created(&mut self, table: Table) -> Result<()>;
45
46 fn track_table_updated(&mut self, pre: Table, post: Table) -> Result<()>;
47
48 fn track_table_deleted(&mut self, table: Table) -> Result<()>;
49}
50
51pub trait CatalogTrackNamespaceChangeOperations {
53 fn track_namespace_created(&mut self, namespace: Namespace) -> Result<()>;
54
55 fn track_namespace_updated(&mut self, pre: Namespace, post: Namespace) -> Result<()>;
56
57 fn track_namespace_deleted(&mut self, namespace: Namespace) -> Result<()>;
58}
59
60pub trait CatalogTrackFlowChangeOperations {
62 fn track_flow_created(&mut self, flow: Flow) -> Result<()>;
63
64 fn track_flow_updated(&mut self, pre: Flow, post: Flow) -> Result<()>;
65
66 fn track_flow_deleted(&mut self, flow: Flow) -> Result<()>;
67}
68
69pub trait CatalogTrackViewChangeOperations {
71 fn track_view_created(&mut self, view: View) -> Result<()>;
72
73 fn track_view_updated(&mut self, pre: View, post: View) -> Result<()>;
74
75 fn track_view_deleted(&mut self, view: View) -> Result<()>;
76}
77
78pub trait CatalogTrackDictionaryChangeOperations {
80 fn track_dictionary_created(&mut self, dictionary: Dictionary) -> Result<()>;
81
82 fn track_dictionary_updated(&mut self, pre: Dictionary, post: Dictionary) -> Result<()>;
83
84 fn track_dictionary_deleted(&mut self, dictionary: Dictionary) -> Result<()>;
85}
86
87pub trait CatalogTrackSeriesChangeOperations {
89 fn track_series_created(&mut self, series: Series) -> Result<()>;
90
91 fn track_series_updated(&mut self, pre: Series, post: Series) -> Result<()>;
92
93 fn track_series_deleted(&mut self, series: Series) -> Result<()>;
94}
95
96pub trait CatalogTrackRingBufferChangeOperations {
98 fn track_ringbuffer_created(&mut self, ringbuffer: RingBuffer) -> Result<()>;
99
100 fn track_ringbuffer_updated(&mut self, pre: RingBuffer, post: RingBuffer) -> Result<()>;
101
102 fn track_ringbuffer_deleted(&mut self, ringbuffer: RingBuffer) -> Result<()>;
103}
104
105pub trait CatalogTrackSumTypeChangeOperations {
107 fn track_sumtype_created(&mut self, sumtype: SumType) -> Result<()>;
108
109 fn track_sumtype_updated(&mut self, pre: SumType, post: SumType) -> Result<()>;
110
111 fn track_sumtype_deleted(&mut self, sumtype: SumType) -> Result<()>;
112}
113
114pub trait CatalogTrackProcedureChangeOperations {
116 fn track_procedure_created(&mut self, procedure: Procedure) -> Result<()>;
117
118 fn track_procedure_updated(&mut self, pre: Procedure, post: Procedure) -> Result<()>;
119
120 fn track_procedure_deleted(&mut self, procedure: Procedure) -> Result<()>;
121}
122
123pub trait CatalogTrackTestChangeOperations {
125 fn track_test_created(&mut self, test: Test) -> Result<()>;
126
127 fn track_test_deleted(&mut self, test: Test) -> Result<()>;
128}
129
130pub trait CatalogTrackHandlerChangeOperations {
132 fn track_handler_created(&mut self, handler: Handler) -> Result<()>;
133
134 fn track_handler_deleted(&mut self, handler: Handler) -> Result<()>;
135}
136
137pub trait CatalogTrackIdentityChangeOperations {
139 fn track_identity_created(&mut self, identity: Identity) -> Result<()>;
140
141 fn track_identity_updated(&mut self, pre: Identity, post: Identity) -> Result<()>;
142
143 fn track_identity_deleted(&mut self, identity: Identity) -> Result<()>;
144}
145
146pub trait CatalogTrackRoleChangeOperations {
148 fn track_role_created(&mut self, role: Role) -> Result<()>;
149
150 fn track_role_updated(&mut self, pre: Role, post: Role) -> Result<()>;
151
152 fn track_role_deleted(&mut self, role: Role) -> Result<()>;
153}
154
155pub trait CatalogTrackGrantedRoleChangeOperations {
157 fn track_granted_role_created(&mut self, granted_role: GrantedRole) -> Result<()>;
158
159 fn track_granted_role_deleted(&mut self, granted_role: GrantedRole) -> Result<()>;
160}
161
162pub trait CatalogTrackPolicyChangeOperations {
164 fn track_policy_created(&mut self, policy: Policy) -> Result<()>;
165
166 fn track_policy_updated(&mut self, pre: Policy, post: Policy) -> Result<()>;
167
168 fn track_policy_deleted(&mut self, policy: Policy) -> Result<()>;
169}
170
171pub trait CatalogTrackMigrationChangeOperations {
173 fn track_migration_created(&mut self, migration: Migration) -> Result<()>;
174
175 fn track_migration_deleted(&mut self, migration: Migration) -> Result<()>;
176}
177
178pub trait CatalogTrackMigrationEventChangeOperations {
180 fn track_migration_event_created(&mut self, event: MigrationEvent) -> Result<()>;
181}
182
183pub trait CatalogTrackAuthenticationChangeOperations {
185 fn track_authentication_created(&mut self, auth: Authentication) -> Result<()>;
186
187 fn track_authentication_deleted(&mut self, auth: Authentication) -> Result<()>;
188}
189
190pub trait CatalogTrackSourceChangeOperations {
192 fn track_source_created(&mut self, source: Source) -> Result<()>;
193
194 fn track_source_deleted(&mut self, source: Source) -> Result<()>;
195}
196
197pub trait CatalogTrackBindingChangeOperations {
199 fn track_binding_created(&mut self, binding: Binding) -> Result<()>;
200
201 fn track_binding_deleted(&mut self, binding: Binding) -> Result<()>;
202}
203
204pub trait CatalogTrackSinkChangeOperations {
206 fn track_sink_created(&mut self, sink: Sink) -> Result<()>;
207
208 fn track_sink_deleted(&mut self, sink: Sink) -> Result<()>;
209}
210
211pub trait CatalogTrackRowTtlChangeOperations {
213 fn track_row_ttl_created(&mut self, shape: ShapeId, ttl: RowTtl) -> Result<()>;
214
215 fn track_row_ttl_updated(&mut self, shape: ShapeId, pre: RowTtl, post: RowTtl) -> Result<()>;
216
217 fn track_row_ttl_deleted(&mut self, shape: ShapeId, ttl: RowTtl) -> Result<()>;
218}
219
220pub trait CatalogTrackChangeOperations:
222 CatalogTrackBindingChangeOperations
223 + CatalogTrackDictionaryChangeOperations
224 + CatalogTrackFlowChangeOperations
225 + CatalogTrackHandlerChangeOperations
226 + CatalogTrackMigrationChangeOperations
227 + CatalogTrackMigrationEventChangeOperations
228 + CatalogTrackNamespaceChangeOperations
229 + CatalogTrackProcedureChangeOperations
230 + CatalogTrackRingBufferChangeOperations
231 + CatalogTrackRoleChangeOperations
232 + CatalogTrackPolicyChangeOperations
233 + CatalogTrackSeriesChangeOperations
234 + CatalogTrackSinkChangeOperations
235 + CatalogTrackSourceChangeOperations
236 + CatalogTrackSumTypeChangeOperations
237 + CatalogTrackTableChangeOperations
238 + CatalogTrackTestChangeOperations
239 + CatalogTrackAuthenticationChangeOperations
240 + CatalogTrackIdentityChangeOperations
241 + CatalogTrackGrantedRoleChangeOperations
242 + CatalogTrackViewChangeOperations
243 + CatalogTrackConfigChangeOperations
244 + CatalogTrackRowTtlChangeOperations
245{
246}