Skip to main content

Crate fslite_sqlite

Crate fslite_sqlite 

Source
Expand description

Persistent, multi-workspace SQLite implementation of the fslite-core filesystem contract.

One SQLite database can hold many isolated workspaces; every stored query is scoped by workspace, so two workspaces may contain identically named paths without collision and cannot observe one another’s nodes, trash, attributes, or change feed.

use fslite_core::{RequestContext, VirtualPath, WriteSource};
use fslite_sqlite::SqliteFileSystem;

let fs = SqliteFileSystem::open_in_memory(Default::default()).await?;
let workspace = fs.create_workspace(Default::default()).await?;
let ctx = RequestContext::trusted(workspace.id);

let path = VirtualPath::parse("/hello.txt")?;
fs.write(&ctx, &path, WriteSource::from_bytes(b"hello".to_vec()), Default::default())
    .await?;
assert!(fs.exists(&ctx, &path, Default::default()).await?);

Structs§

ConnectOptions
Options controlling how a SQLite-backed filesystem opens its database connection.
SqliteFileSystem
A persistent, multi-workspace filesystem backed by a single SQLite database.
Workspace
A created workspace and its configured limits.
WorkspaceOptions
Configurable per-workspace resource limits.

Traits§

FileSystem
Canonical asynchronous filesystem behavior shared by all backends.