pub struct LocalDatabase<F: VfsFile> { /* private fields */ }Expand description
One exclusively locked database handle is the transaction/session boundary. Closing drops uncommitted state. Failed I/O fences the controller until reopen.
Implementations§
Source§impl<F: VfsFile> LocalDatabase<F>
impl<F: VfsFile> LocalDatabase<F>
Sourcepub fn vault_initialized(&self) -> Result<bool, LocalReadError>
pub fn vault_initialized(&self) -> Result<bool, LocalReadError>
Metadata only; no key derivation and no credential material returned.
Sourcepub fn vault_unlock(
&mut self,
password: &str,
create: bool,
) -> Result<LocalVaultKey, LocalReadError>
pub fn vault_unlock( &mut self, password: &str, create: bool, ) -> Result<LocalVaultKey, LocalReadError>
Creation is explicit and only admitted outside a transaction. Existing files are authenticated first; wrong passwords never replace saved state.
pub fn vault_keys( &self, key: &LocalVaultKey, ) -> Result<Vec<String>, LocalReadError>
Sourcepub fn vault_reveal(
&self,
key: &LocalVaultKey,
name: &str,
) -> Result<Option<String>, LocalReadError>
pub fn vault_reveal( &self, key: &LocalVaultKey, name: &str, ) -> Result<Option<String>, LocalReadError>
Plaintext is returned only through this explicit reveal operation.
Sourcepub fn vault_put(
&mut self,
key: &LocalVaultKey,
name: &str,
value: Option<&str>,
) -> Result<(), LocalReadError>
pub fn vault_put( &mut self, key: &LocalVaultKey, name: &str, value: Option<&str>, ) -> Result<(), LocalReadError>
Mutations stage an encrypted native action alongside ordinary SQL. Errors abort an active transaction, just like failed SQL statements.
Source§impl<F: VfsFile> LocalDatabase<F>
impl<F: VfsFile> LocalDatabase<F>
pub fn create( file: F, name: impl Into<PathBuf>, now_ms: u64, ) -> Result<Self, LocalReadError>
pub fn open(file: F, name: impl Into<PathBuf>) -> Result<Self, LocalReadError>
pub fn query( &mut self, sql: &str, now_ms: u64, ) -> Result<ScalarResult, LocalReadError>
Sourcepub fn check_healthy(&self) -> Result<(), LocalReadError>
pub fn check_healthy(&self) -> Result<(), LocalReadError>
Host-side read operations must honor the same interrupted-publication fence.
Sourcepub fn catalog(&self) -> Result<ScalarResult, LocalReadError>
pub fn catalog(&self) -> Result<ScalarResult, LocalReadError>
Read actual persisted contracts without inferring schemas from row payloads.
Sourcepub fn read_query(
&self,
sql: &str,
parameters: &[Value],
scopes: &[ReadScope],
) -> Result<ScalarResult, LocalReadError>
pub fn read_query( &self, sql: &str, parameters: &[Value], scopes: &[ReadScope], ) -> Result<ScalarResult, LocalReadError>
Only SELECT is admitted; a caller cannot widen the host’s source-row scope.
pub fn query_with_params( &mut self, sql: &str, parameters: &[Value], now_ms: u64, ) -> Result<ScalarResult, LocalReadError>
pub fn into_inner(self) -> F
Auto Trait Implementations§
impl<F> !Freeze for LocalDatabase<F>
impl<F> !RefUnwindSafe for LocalDatabase<F>
impl<F> !UnwindSafe for LocalDatabase<F>
impl<F> Send for LocalDatabase<F>where
EmbeddedResidentStore<F>: Send,
impl<F> Sync for LocalDatabase<F>where
EmbeddedResidentStore<F>: Sync,
impl<F> Unpin for LocalDatabase<F>where
EmbeddedResidentStore<F>: Unpin,
impl<F> UnsafeUnpin for LocalDatabase<F>where
EmbeddedResidentStore<F>: UnsafeUnpin,
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
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> ⓘ
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> ⓘ
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 more