#sqlite #virtual-filesystem #archive #database #file-format #sqlar

bin+lib sqlarfs

A file archive format and virtual filesystem backed by a SQLite database

2 releases

0.1.1 Sep 6, 2024
0.1.0 May 22, 2024

#504 in Filesystem

Download history 6/week @ 2024-07-01 113/week @ 2024-09-02 1/week @ 2024-09-09 21/week @ 2024-09-16 24/week @ 2024-09-23 39/week @ 2024-09-30 4/week @ 2024-10-07

88 downloads per month
Used in sqlarfs-cli

MIT license

130KB
2K SLoC

Tests Workflow Status (main) Codecov Crates.io docs.rs

sqlarfs

A file archive format and virtual filesystem backed by a SQLite database.

This library is a Rust implementation of the sqlar format for SQLite archive files.

This library consists of:

  • A Rust API
  • A CLI
  • TODO: A FUSE filesystem

Rust API

To add this library to your project:

cargo add sqlarfs

See the API docs for documentation and examples.

CLI

Installation

To install the CLI tool, install Rust and run:

cargo install sqlarfs-cli

The binary will be installed to ~/.cargo/bin/sqlar.

Examples

Archive directory and extract it to a target directory:

sqlar create ./src
sqlar extract -a src.sqlar ~/Desktop

Archive two directories and extract them to the current directory:

sqlar create -a files.sqlar ~/Documents ~/Pictures
sqlar extract -a files.sqlar

Extract a specific file from an archive:

sqlar extract -a documents.sqlar -s Documents/report.pdf

Add a file to an existing archive.

sqlar archive -a documents.sqlar ~/Downloads/report.pdf Documents/report.pdf

List all regular files in an archive:

sqlar list -a documents.sqlar -t file

List only the immediate children of a specific directory in an archive:

sqlar list -a documents.sqlar --children Documents/Reports/

Remove a file from an archive:

sqlar remove -a documents.sqlar Documents/report.pdf

The tool has a shorthand syntax for each command:

sqlar c -a files.sqlar ~/Documents ~/Pictures
sqlar ex -a files.sqlar
sqlar ls -a files.sqlar
sqlar rm -a files.sqlar Documents

Dependencies

~22–30MB
~488K SLoC