pub struct SchemaManager;Implementations§
Source§impl SchemaManager
impl SchemaManager
pub fn new() -> Self
Sourcepub fn bootstrap(
&self,
conn: &Connection,
) -> Result<BootstrapReport, SchemaError>
pub fn bootstrap( &self, conn: &Connection, ) -> Result<BootstrapReport, SchemaError>
Bootstrap the database schema, applying any pending migrations.
§Errors
Returns SchemaError if any migration or metadata-table SQL fails,
or SchemaError::VersionMismatch if the database has been migrated
to a version newer than this engine supports.
pub fn current_version(&self) -> SchemaVersion
pub fn migrations(&self) -> &'static [Migration]
Sourcepub fn initialize_connection(
&self,
conn: &Connection,
) -> Result<(), SchemaError>
pub fn initialize_connection( &self, conn: &Connection, ) -> Result<(), SchemaError>
Set the recommended SQLite connection pragmas for fathomdb.
§Errors
Returns SchemaError if any PRAGMA fails to execute.
Sourcepub fn initialize_reader_connection(
&self,
conn: &Connection,
) -> Result<(), SchemaError>
pub fn initialize_reader_connection( &self, conn: &Connection, ) -> Result<(), SchemaError>
Initialize a read-only connection with PRAGMAs that are safe for readers.
Skips journal_mode (requires write; the writer already set WAL),
synchronous (irrelevant for readers), and journal_size_limit
(requires write).
§Errors
Returns SchemaError if any PRAGMA fails to execute.
Sourcepub fn ensure_vector_profile(
&self,
_conn: &Connection,
_profile: &str,
_table_name: &str,
_dimension: usize,
) -> Result<(), SchemaError>
pub fn ensure_vector_profile( &self, _conn: &Connection, _profile: &str, _table_name: &str, _dimension: usize, ) -> Result<(), SchemaError>
§Errors
Always returns SchemaError::MissingCapability when the sqlite-vec
feature is not compiled in.
Sourcepub fn ensure_vec_kind_profile(
&self,
_conn: &Connection,
_kind: &str,
_dimension: usize,
) -> Result<(), SchemaError>
pub fn ensure_vec_kind_profile( &self, _conn: &Connection, _kind: &str, _dimension: usize, ) -> Result<(), SchemaError>
§Errors
Always returns SchemaError::MissingCapability when the sqlite-vec
feature is not compiled in.
Trait Implementations§
Source§impl Clone for SchemaManager
impl Clone for SchemaManager
Source§fn clone(&self) -> SchemaManager
fn clone(&self) -> SchemaManager
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more