You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement SQLite compression, decompression, and testing functions for Brotli and gzip encodings. Functions are
10
+
available as a loadable extension, or as a Rust library.
9
11
10
-
Implement SQLite compression, decompression, and testing functions for Brotli and gzip encodings. Functions are available as a loadable extension, or as a Rust library.
11
-
12
-
See also [SQLite-hashes](https://github.com/nyurik/sqlite-hashes) extension for MD5, SHA1, SHA224, SHA256, SHA384, SHA512, FNV1a, xxHash hashing functions.
12
+
See also [SQLite-hashes](https://github.com/nyurik/sqlite-hashes) extension for MD5, SHA1, SHA224, SHA256, SHA384,
13
+
SHA512, FNV1a, xxHash hashing functions.
13
14
14
15
## Usage
15
16
16
-
This SQLite extension adds functions for brotli and gzip compressions like `gzip(data, [quality])`, decoding `gzip_decode(data)`, and testing `gzip_test(data)` functions. Both encoding and decoding return blobs, and the testing function returns a true/false. The encoding functions can encode text and blob values, but will raise an error on other types like integers and floating point numbers. All functions will return `NULL` if the input data is `NULL`.
17
+
This SQLite extension adds functions for brotli and gzip compressions like `gzip(data, [quality])`,
18
+
decoding `gzip_decode(data)`, and testing `gzip_test(data)` functions. Both encoding and decoding return blobs, and the
19
+
testing function returns a true/false. The encoding functions can encode text and blob values, but will raise an error
20
+
on other types like integers and floating point numbers. All functions will return `NULL` if the input data is `NULL`.
17
21
18
22
### Extension
23
+
19
24
To use as an extension, load the `libsqlite_compressions.so` shared library into SQLite.
To use as a Rust library, add `sqlite-compressions` to your `Cargo.toml` dependencies. Then, register the needed functions with `register_compression_functions(&db)`. This will register all available functions, or you can use `register_gzip_functions(&db)` or `register_brotli_functions(&db)` to register just the needed ones (you may also disable the default features to reduce compile time and binary size).
38
+
39
+
To use as a Rust library, add `sqlite-compressions` to your `Cargo.toml` dependencies. Then, register the needed
40
+
functions with `register_compression_functions(&db)`. This will register all available functions, or you can
41
+
use `register_gzip_functions(&db)` or `register_brotli_functions(&db)` to register just the needed ones (you may also
42
+
disable the default features to reduce compile time and binary size).
By default, this crate will compile with all features. You can enable just the ones you need to reduce compile time and binary size.
71
+
72
+
By default, this crate will compile with all features. You can enable just the ones you need to reduce compile time and
73
+
binary size.
63
74
64
75
```toml
65
76
[dependencies]
@@ -70,13 +81,17 @@ sqlite-compressions = { version = "0.2", default-features = false, features = ["
70
81
***brotli** - enable Brotli compression support
71
82
***gzip** - enable GZIP compression support
72
83
73
-
The **loadable_extension** feature should only be used when building a `.so` / `.dylib` / `.dll` extension file that can be loaded directly into sqlite3 executable.
84
+
The **loadable_extension** feature should only be used when building a `.so` / `.dylib` / `.dll` extension file that can
85
+
be loaded directly into sqlite3 executable.
74
86
75
87
## Development
76
-
* This project is easier to develop with [just](https://github.com/casey/just#readme), a modern alternative to `make`. Install it with `cargo install just`.
88
+
89
+
* This project is easier to develop with [just](https://github.com/casey/just#readme), a modern alternative to `make`.
90
+
Install it with `cargo install just`.
77
91
* To get a list of available commands, run `just`.
78
92
* To run tests, use `just test`.
79
-
* On `git push`, it will run a few validations, including `cargo fmt`, `cargo clippy`, and `cargo test`. Use `git push --no-verify` to skip these checks.
93
+
* On `git push`, it will run a few validations, including `cargo fmt`, `cargo clippy`, and `cargo test`.
0 commit comments