pub struct SqliteSsbDb { /* private fields */ }Implementations§
Source§impl SqliteSsbDb
impl SqliteSsbDb
pub fn new<S: AsRef<str>>(database_path: S, offset_log_path: S) -> SqliteSsbDb
pub fn update_indexes_from_offset_file(&self) -> Result<()>
Trait Implementations§
Source§impl SsbDb for SqliteSsbDb
impl SsbDb for SqliteSsbDb
Source§fn append_batch<T: AsRef<[u8]>>(
&self,
_: &Multikey,
messages: &[T],
) -> Result<()>
fn append_batch<T: AsRef<[u8]>>( &self, _: &Multikey, messages: &[T], ) -> Result<()>
Append a batch of valid ssb messages authored by the
feed_id.Source§fn get_entry_by_key<'a>(&'a self, message_key: &Multihash) -> Result<Vec<u8>>
fn get_entry_by_key<'a>(&'a self, message_key: &Multihash) -> Result<Vec<u8>>
Get an entry by its ssb message key.
Source§fn get_entry_by_seq(
&self,
feed_id: &Multikey,
sequence: i32,
) -> Result<Option<Vec<u8>>>
fn get_entry_by_seq( &self, feed_id: &Multikey, sequence: i32, ) -> Result<Option<Vec<u8>>>
Get an entry by its sequence key + author.
Source§fn get_feed_latest_sequence(&self, feed_id: &Multikey) -> Result<Option<i32>>
fn get_feed_latest_sequence(&self, feed_id: &Multikey) -> Result<Option<i32>>
Get the latest sequence number for the given feed.
Source§fn get_entries_newer_than_sequence<'a>(
&'a self,
feed_id: &Multikey,
sequence: i32,
limit: Option<i64>,
include_keys: bool,
include_values: bool,
) -> Result<Vec<Vec<u8>>>
fn get_entries_newer_than_sequence<'a>( &'a self, feed_id: &Multikey, sequence: i32, limit: Option<i64>, include_keys: bool, include_values: bool, ) -> Result<Vec<Vec<u8>>>
Source§fn rebuild_indexes(&self) -> Result<()>
fn rebuild_indexes(&self) -> Result<()>
You can rebuild the indexes in sqlite db (but not the offset file) if they become
corrupted.
Auto Trait Implementations§
impl !Freeze for SqliteSsbDb
impl !RefUnwindSafe for SqliteSsbDb
impl Send for SqliteSsbDb
impl !Sync for SqliteSsbDb
impl Unpin for SqliteSsbDb
impl UnwindSafe for SqliteSsbDb
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expressionwhere
Self: Sized + AsExpression<T>,
fn into_sql<T>(self) -> Self::Expressionwhere
Self: Sized + AsExpression<T>,
Convert
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
Convert
&self to an expression for Diesel’s query builder. Read more