pub struct Database { /* private fields */ }Implementations§
Source§impl Database
impl Database
pub fn open<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn transaction(&mut self) -> Result<DatabaseTransaction<'_>>
pub fn initialize(&self, force: bool) -> Result<()>
pub fn get_version(&self) -> Result<Option<i32>>
pub fn get_stats(&self) -> Result<DatabaseStats>
pub fn insert_note( &self, path: &str, title: &str, mtime: u64, hash: &str, frontmatter_json: Option<&str>, ) -> Result<i64>
pub fn get_note_by_path(&self, path: &str) -> Result<Option<i64>>
pub fn get_note_metadata_by_path( &self, path: &str, ) -> Result<Option<NoteMetadata>>
pub fn insert_tag(&self, note_id: i64, tag: &str) -> Result<()>
pub fn insert_link( &self, src_note_id: i64, dst_text: &str, kind: &str, is_embed: bool, alias: Option<&str>, heading_ref: Option<&str>, block_ref: Option<&str>, ) -> Result<()>
pub fn insert_chunk( &self, note_id: i64, heading_path: Option<&str>, text: &str, ) -> Result<()>
pub fn insert_chunk_with_offset( &self, note_id: i64, heading_path: Option<&str>, text: &str, byte_offset: i32, byte_length: i32, ) -> Result<()>
pub fn clear_note_data(&self, note_id: i64) -> Result<()>
Sourcepub fn conn(&self) -> DatabaseQueryExecutor<'_>
pub fn conn(&self) -> DatabaseQueryExecutor<'_>
Execute a query function with access to the database connection
Auto Trait Implementations§
impl !Freeze for Database
impl !RefUnwindSafe for Database
impl Send for Database
impl !Sync for Database
impl Unpin for Database
impl UnsafeUnpin for Database
impl !UnwindSafe for Database
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