Merge pull request #767 from nuttycom/fix/fsblockdb_for_path_doc
Add a note about metadata database initialization to `FsBlockDb::for_path`
This commit is contained in:
commit
7599fbd3c3
|
@ -37,6 +37,9 @@ pub fn init_cache_database(db_cache: &BlockDb) -> Result<(), rusqlite::Error> {
|
|||
|
||||
/// Sets up the internal structure of the metadata cache database.
|
||||
///
|
||||
/// This will automatically apply any available migrations that have not yet been applied to the
|
||||
/// database as part of its operation.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
|
|
|
@ -883,6 +883,11 @@ impl FsBlockDb {
|
|||
/// `<fsblockdb_root>/blockmeta.sqlite` and will ensure that a directory exists at
|
||||
/// `<fsblockdb_root>/blocks` where this block store will expect to find serialized block
|
||||
/// files as described for [`FsBlockDb`].
|
||||
///
|
||||
/// An application using this constructor should ensure that they call
|
||||
/// [`zcash_client_sqlite::chain::init::init_blockmetadb`] at application startup to ensure
|
||||
/// that the resulting metadata database is properly initialized and has had all required
|
||||
/// migrations applied before use.
|
||||
pub fn for_path<P: AsRef<Path>>(fsblockdb_root: P) -> Result<Self, FsBlockDbError> {
|
||||
let meta = fs::metadata(&fsblockdb_root).map_err(FsBlockDbError::Fs)?;
|
||||
if meta.is_dir() {
|
||||
|
|
Loading…
Reference in New Issue