tuple_storage

Crates.iotuple_storage
lib.rstuple_storage
version0.1.1
sourcesrc
created_at2018-07-06 19:07:54.518852
updated_at2018-07-07 12:28:53.117714
descriptionA type-safe and small table engine for any Tuple of Ints
homepage
repositoryhttps://gitlab.com/dns2utf8/tuple_storage
max_upload_size
id73144
size42,700
Stefan Schindler (dns2utf8)

documentation

https://docs.rs/tuple_storage

README

tuple_storage

pipeline status

Store one kind of tuple per file with ease. Every access is type-safe.

The database is memory mapped for fast access even as the set grows.

Example usage

$ cargo run create target/demo.ts '(u8, i16, u32, i64)'
$ cargo run show target/demo.ts
(u8, i16, u32, i64)

$ cargo run insert target/demo.ts '(1, 2, 3, 4)'
$ cargo run insert target/demo.ts '(6, 7, 8, 9)'
$ cargo run insert target/demo.ts '(3, 4, 5, 6)'

$ cargo run search target/demo.ts
[
    (1, 2, 3, 4)
    (3, 4, 5, 6)
    (6, 7, 8, 9)
]
found 3 Tuples

$ cargo run search target/demo.ts '<3'
[
    (1, 2, 3, 4)
]
found 1 Tuples
$ cargo run search target/demo.ts '=3'
[
    (3, 4, 5, 6)
]
found 1 Tuples
$ cargo run search target/demo.ts '>3'
[
    (6, 7, 8, 9)
]
found 1 Tuples

$ cargo run remove target/demo.ts '>3'
removed 1 Tuples
$ cargo run search target/demo.ts '>3'
[]
found 0 Tuples


# inserting Tuple violating the Schema:
$ cargo run insert target/demo.ts '(-23, 0, 0, 0)'
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }', libcore/result.rs:945:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.

# searching with an invalid search index
$ cargo run search target/demo.ts '=-2'
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }', libcore/result.rs:945:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Commit count: 21

cargo fmt