Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/badboy/sqlar-rs
An SQLite Archive utility
https://github.com/badboy/sqlar-rs
Last synced: 9 days ago
JSON representation
An SQLite Archive utility
- Host: GitHub
- URL: https://github.com/badboy/sqlar-rs
- Owner: badboy
- License: mit
- Created: 2021-04-09T18:47:00.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-15T20:52:38.000Z (over 2 years ago)
- Last Synced: 2024-12-24T02:01:36.842Z (12 days ago)
- Language: Rust
- Homepage:
- Size: 26.4 KB
- Stars: 9
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sqlar
[![Crates.io version](https://img.shields.io/crates/v/sqlar.svg?style=flat-square)](https://crates.io/crates/sqlar)
[![docs.rs docs](https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square)](https://docs.rs/sqlar)
[![License: MIT](https://img.shields.io/github/license/badboy/sqlar-rs?style=flat-square)](LICENSE)## sqlar - a SQLite Archive utility
> An "SQLite Archive" is a file container similar to a ZIP archive or Tarball but based on an SQLite database.
See the [SQLite Archive Files][sqlar] documentation for all information.
This library allows to list archive contents, extract files from archives or create a new
archive.
It's main usage is throug the command line utility `sqlar`.## Installation
The command line utility `sqlar` can be installed through `cargo`:
```
cargo install sqlar
```## Usage
### List the content of an archive
```
sqlar l path/to/file.sqlar
```### Extract an archive
```
sqlar x path/to/file.sqlar path/to/dest/
```### Create an archive
```
sqlar c path/to/new-archive.sqlar path/to/source/
```## Example
The library can also be used progamatically.
### List files in an archive
```rust
use sqlar::with_each_entry;with_each_entry("path/to/archive.sqlar", false, |entry| {
println!("File: {}, file type: {:?}, mode: {}", entry.name, entry.filetype, entry.mode);
Ok(())
});
```### Create an archive
```rust
use sqlar::create;create("path/to/new-archive.sqlar", &["path/to/source"]);
```### Extract all files from an archive
```rust
use sqlar::extract;extract("path/to/archive.sqlar", "path/to/dest");
```[sqlar]: https://www.sqlite.org/sqlar.html
# License
MIT. See [LICENSE](LICENSE).