move db upgrade logic into db crate

This allows shrinking db's API surface.
This commit is contained in:
Scott Lamb
2018-02-28 21:21:47 -08:00
parent fbe1231af0
commit bcf42fe02c
7 changed files with 129 additions and 128 deletions

View File

@@ -226,8 +226,7 @@ impl SampleFileDir {
Ok(meta)
}
// TODO: this should be exposed only to the db layer.
pub fn write_meta(&self, meta: &schema::DirMeta) -> Result<(), Error> {
pub(crate) fn write_meta(&self, meta: &schema::DirMeta) -> Result<(), Error> {
let (tmp_path, final_path) = unsafe {
(ffi::CStr::from_ptr("meta.tmp\0".as_ptr() as *const c_char),
ffi::CStr::from_ptr("meta\0".as_ptr() as *const c_char))