Skip to content

Commit 663ddc0

Browse files
committed
refactor(kuzu): expose single register() method to seal internal types
1 parent 3f828e2 commit 663ddc0

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

src/ops/registration.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fn register_executor_factories(registry: &mut ExecutorFactoryRegistry) -> Result
1818

1919
storages::postgres::Factory::default().register(registry)?;
2020
Arc::new(storages::qdrant::Factory::default()).register(registry)?;
21-
storages::kuzu::Factory::new(reqwest_client).register(registry)?;
21+
storages::kuzu::register(registry, reqwest_client)?;
2222

2323
storages::neo4j::Factory::new().register(registry)?;
2424

src/ops/storages/kuzu.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use super::shared::property_graph::*;
77
use super::shared::table_columns::{
88
TableColumnsSchema, TableMainSetupAction, TableUpsertionAction, check_table_compatibility,
99
};
10+
use crate::ops::registry::ExecutorFactoryRegistry;
1011
use crate::prelude::*;
1112

1213
use crate::setup::{ResourceSetupStatus, SetupChangeType};
@@ -171,7 +172,7 @@ struct ReferencedNodeTable {
171172
}
172173

173174
#[derive(Debug, Serialize, Deserialize, Clone)]
174-
pub struct SetupState {
175+
struct SetupState {
175176
schema: TableColumnsSchema<String>,
176177

177178
#[serde(default, skip_serializing_if = "Option::is_none")]
@@ -185,7 +186,7 @@ impl<'a> Into<Cow<'a, TableColumnsSchema<String>>> for &'a SetupState {
185186
}
186187

187188
#[derive(Debug)]
188-
pub struct GraphElementDataSetupStatus {
189+
struct GraphElementDataSetupStatus {
189190
actions: TableMainSetupAction<String>,
190191
referenced_node_tables: Option<(String, String)>,
191192
drop_affected_referenced_node_tables: IndexSet<String>,
@@ -305,16 +306,10 @@ impl GraphElementDataSetupStatus {
305306

306307
type KuzuGraphElement = GraphElementType<ConnectionSpec>;
307308

308-
pub struct Factory {
309+
struct Factory {
309310
reqwest_client: reqwest::Client,
310311
}
311312

312-
impl Factory {
313-
pub fn new(reqwest_client: reqwest::Client) -> Self {
314-
Self { reqwest_client }
315-
}
316-
}
317-
318313
#[async_trait]
319314
impl StorageFactoryBase for Factory {
320315
type Spec = Spec;
@@ -543,3 +538,10 @@ impl StorageFactoryBase for Factory {
543538
Ok(())
544539
}
545540
}
541+
542+
pub fn register(
543+
registry: &mut ExecutorFactoryRegistry,
544+
reqwest_client: reqwest::Client,
545+
) -> Result<()> {
546+
Factory { reqwest_client }.register(registry)
547+
}

0 commit comments

Comments
 (0)