reifydb_catalog/transaction/
source.rs

1// Copyright (c) reifydb.com 2025
2// This file is licensed under the AGPL-3.0-or-later, see license.md file
3
4use reifydb_core::interface::{NamespaceId, QueryTransaction, SourceDef, SourceId};
5use reifydb_type::IntoFragment;
6
7pub trait CatalogSourceQueryOperations {
8	fn find_source_by_name<'a>(
9		&mut self,
10		namespace: NamespaceId,
11		source: impl IntoFragment<'a>,
12	) -> crate::Result<Option<SourceDef>>;
13
14	fn find_source(&mut self, id: SourceId) -> crate::Result<Option<SourceDef>>;
15
16	fn get_source_by_name<'a>(
17		&mut self,
18		namespace: NamespaceId,
19		name: impl IntoFragment<'a>,
20	) -> crate::Result<SourceDef>;
21}
22
23impl<T: QueryTransaction> CatalogSourceQueryOperations for T {
24	fn find_source_by_name<'a>(
25		&mut self,
26		_namespace: NamespaceId,
27		_source: impl IntoFragment<'a>,
28	) -> reifydb_core::Result<Option<SourceDef>> {
29		todo!()
30	}
31
32	fn find_source(&mut self, _id: SourceId) -> reifydb_core::Result<Option<SourceDef>> {
33		todo!()
34	}
35
36	fn get_source_by_name<'a>(
37		&mut self,
38		_namespace: NamespaceId,
39		_name: impl IntoFragment<'a>,
40	) -> reifydb_core::Result<SourceDef> {
41		todo!()
42	}
43}