pub struct DbOptions {
pub path: PathBuf,
pub key: Option<Zeroizing<String>>,
pub raw_key: Option<Zeroizing<[u8; 32]>>,
pub profile: CacheProfile,
pub durability: DurabilityProfile,
pub foreign_keys: bool,
pub integrity_check_on_open: bool,
pub journal: JournalSelect,
pub owner_only: bool,
pub init: Option<ConnInit>,
}Fields§
§path: PathBuf§key: Option<Zeroizing<String>>SQLCipher passphrase-style key (base64-ish charset). See also DbOptions::raw_key.
raw_key: Option<Zeroizing<[u8; 32]>>SQLCipher raw 256-bit key, applied as x'<hex>' (no KDF). Takes precedence over key.
profile: CacheProfile§durability: DurabilityProfile§foreign_keys: bool§integrity_check_on_open: bool§journal: JournalSelect§owner_only: boolNarrow the database and its sidecars to owner-only (0600) on unix. Default on.
init: Option<ConnInit>Implementations§
Source§impl DbOptions
impl DbOptions
Sourcepub fn open_writer_migrated(
&self,
migrations: &[Migration],
options: &MigrateOptions,
) -> Result<(Connection, MigrationReport)>
pub fn open_writer_migrated( &self, migrations: &[Migration], options: &MigrateOptions, ) -> Result<(Connection, MigrationReport)>
Open the writer and bring the schema up to date (see migrate); the pre-migration
backup is keyed like the database itself.
Source§impl DbOptions
impl DbOptions
Sourcepub fn open_writer_with_key_candidates(
&self,
candidates: &[Zeroizing<String>],
) -> Result<(Connection, usize)>
pub fn open_writer_with_key_candidates( &self, candidates: &[Zeroizing<String>], ) -> Result<(Connection, usize)>
Try each passphrase in order; the first that decrypts opens the writer.
Sourcepub fn open_writer_recovering(
&self,
policy: RecoveryPolicy,
) -> Result<OpenOutcome>
pub fn open_writer_recovering( &self, policy: RecoveryPolicy, ) -> Result<OpenOutcome>
Open the writer; if the file is unreadable and the policy allows it, quarantine it and open a fresh database at the same path.
Source§impl DbOptions
impl DbOptions
pub fn new(path: impl Into<PathBuf>) -> Self
pub fn with_passphrase(self, key: impl Into<String>) -> Self
pub fn with_raw_key(self, key: [u8; 32]) -> Self
pub fn is_keyed(&self) -> bool
pub fn open_writer(&self) -> Result<Connection>
pub fn open_reader(&self) -> Result<Connection>
pub fn open_read_pool(&self, cap: usize) -> Result<ReadPool>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for DbOptions
impl !UnwindSafe for DbOptions
impl Freeze for DbOptions
impl Send for DbOptions
impl Sync for DbOptions
impl Unpin for DbOptions
impl UnsafeUnpin for DbOptions
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