mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-04 01:58:16 +00:00
core/mvcc: Switch Cursor to use Rc instead of lifetimes
This commit is contained in:
parent
ff6d9465eb
commit
b7382ffab1
1 changed files with 5 additions and 4 deletions
|
@ -1,17 +1,18 @@
|
|||
use crate::mvcc::clock::LogicalClock;
|
||||
use crate::mvcc::database::{MvStore, Result, Row, RowID};
|
||||
use std::fmt::Debug;
|
||||
use std::rc::Rc;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct ScanCursor<'a, Clock: LogicalClock> {
|
||||
pub db: &'a MvStore<Clock>,
|
||||
pub struct ScanCursor<Clock: LogicalClock> {
|
||||
pub db: Rc<MvStore<Clock>>,
|
||||
pub row_ids: Vec<RowID>,
|
||||
pub index: usize,
|
||||
tx_id: u64,
|
||||
}
|
||||
|
||||
impl<'a, Clock: LogicalClock> ScanCursor<'a, Clock> {
|
||||
pub fn new(db: &'a MvStore<Clock>, tx_id: u64, table_id: u64) -> Result<ScanCursor<'a, Clock>> {
|
||||
impl<Clock: LogicalClock> ScanCursor<Clock> {
|
||||
pub fn new(db: Rc<MvStore<Clock>>, tx_id: u64, table_id: u64) -> Result<ScanCursor<Clock>> {
|
||||
let row_ids = db.scan_row_ids_for_table(table_id)?;
|
||||
Ok(Self {
|
||||
db,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue