https://github.com/lostatc/sqlarfs-rs
A file archive format and virtual filesystem backed by a SQLite database
https://github.com/lostatc/sqlarfs-rs
fuse fuse-filesystem sqlar sqlite
Last synced: 3 months ago
JSON representation
A file archive format and virtual filesystem backed by a SQLite database
- Host: GitHub
- URL: https://github.com/lostatc/sqlarfs-rs
- Owner: lostatc
- License: mit
- Created: 2024-03-22T03:08:29.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-26T09:14:18.000Z (almost 2 years ago)
- Last Synced: 2024-07-11T12:51:34.330Z (over 1 year ago)
- Topics: fuse, fuse-filesystem, sqlar, sqlite
- Language: Rust
- Homepage:
- Size: 396 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/lostatc/sqlarfs-rs/actions/workflows/test.yaml)
[](https://app.codecov.io/gh/lostatc/sqlarfs-rs)
[](https://crates.io/crates/sqlarfs)
[](https://docs.rs/sqlarfs)
# sqlarfs
A file archive format and virtual filesystem backed by a SQLite database.
This library is a Rust implementation of the
[sqlar](https://sqlite.org/sqlar.html) 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:
```shell
cargo add sqlarfs
```
See the [API docs](https://docs.rs/sqlarfs) for documentation and examples.
## CLI
### Installation
To install the CLI tool, [install
Rust](https://www.rust-lang.org/tools/install) and run:
```shell
cargo install sqlarfs-cli
```
The binary will be installed to `~/.cargo/bin/sqlar`.
### Examples
Archive directory and extract it to a target directory:
```shell
sqlar create ./src
sqlar extract -a src.sqlar ~/Desktop
```
Archive two directories and extract them to the current directory:
```shell
sqlar create -a files.sqlar ~/Documents ~/Pictures
sqlar extract -a files.sqlar
```
Extract a specific file from an archive:
```shell
sqlar extract -a documents.sqlar -s Documents/report.pdf
```
Add a file to an existing archive.
```shell
sqlar archive -a documents.sqlar ~/Downloads/report.pdf Documents/report.pdf
```
List all regular files in an archive:
```shell
sqlar list -a documents.sqlar -t file
```
List only the immediate children of a specific directory in an archive:
```shell
sqlar list -a documents.sqlar --children Documents/Reports/
```
Remove a file from an archive:
```shell
sqlar remove -a documents.sqlar Documents/report.pdf
```
The tool has a shorthand syntax for each command:
```shell
sqlar c -a files.sqlar ~/Documents ~/Pictures
sqlar ex -a files.sqlar
sqlar ls -a files.sqlar
sqlar rm -a files.sqlar Documents
```