sqlitefs 0.0.4

In-App Filesystem using SQLite
Documentation

Latest version Documentation License

SQLiteFS

SQLiteFS is a Rust Crate to provide you with an In-App Filesystem based on SQLite.

The base for this are the SQLite Docs:

Example

use sqlitefs::{sqlitefs_file::SqliteFsFile as File, sqlitefs_fs::SqliteFs};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let fs_path = "FS.SQLITE";
    let f_name = "my cool file name";

    SqliteFs::init(fs_path).await?;

    let mut f = File::create(f_name).await.unwrap();
    f.set_compressed(true);

    f.write("This could be your data! ;)".as_bytes()).await?;

    let mut t = String::new();
    f.read_to_string(&mut t).await?;

    println!("{t}");

    Ok(())
}

Status Indicators

What the value of size tells you:

-1: The file was just created

-2: The file was truncated