Skip to content

Commit f117408

Browse files
authored
refactor(storage): extract and enhance more common logic for kuzu (#552)
1 parent 821c25d commit f117408

File tree

8 files changed

+640
-363
lines changed

8 files changed

+640
-363
lines changed

src/base/spec.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,16 @@ pub struct IndexOptions {
406406
pub vector_indexes: Vec<VectorIndexDef>,
407407
}
408408

409+
impl IndexOptions {
410+
pub fn primary_key_fields(&self) -> Result<&[FieldName]> {
411+
Ok(self
412+
.primary_key_fields
413+
.as_ref()
414+
.ok_or(api_error!("Primary key fields are not set"))?
415+
.as_ref())
416+
}
417+
}
418+
409419
impl fmt::Display for IndexOptions {
410420
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
411421
let primary_keys = self

src/ops/storages/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
mod shared;
2+
13
pub mod neo4j;
24
pub mod postgres;
35
pub mod qdrant;
4-
pub mod shared;

0 commit comments

Comments
 (0)