Skip to content

Commit ee0f8c6

Browse files
committed
fix
1 parent 6b318da commit ee0f8c6

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,9 @@ impl Database {
379379
}
380380

381381
#[napi]
382-
pub fn maxWriteReplicationIndex(&self) -> Result<()> {
383-
todo!();
382+
pub fn maxWriteReplicationIndex(&self) -> Result<f64> {
383+
let result = self.db.max_write_replication_index();
384+
Ok(result.unwrap_or(0) as f64)
384385
}
385386

386387
#[napi]

wrapper.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,11 @@ class Database {
168168
}
169169

170170
maxWriteReplicationIndex() {
171-
throw new Error("not implemented");
171+
try {
172+
return this.db.maxWriteReplicationIndex();
173+
} catch (err) {
174+
throw convertError(err);
175+
}
172176
}
173177

174178
/**

0 commit comments

Comments
 (0)