https://github.com/znx3p0/saildb
https://github.com/znx3p0/saildb
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/znx3p0/saildb
- Owner: znx3p0
- Created: 2021-12-28T22:03:00.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-01-25T04:02:13.000Z (over 3 years ago)
- Last Synced: 2025-02-11T07:02:16.939Z (3 months ago)
- Language: Rust
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SailDB
SailDB is an in-memory database based on Canary and SRPC.
SailDB is extremely performant since communications are based on top of Canary, and
the key-value store is backed by Dashmap.SailDB is generic over the keys and values, and can be constructed at runtime, and
is designed to be as simple to use as possible.Creating a SailDB database is extremely simple:
```rust
// bind the global route to this socket
Tcp::bind("127.0.0.1:8080").await?;
// bind a SailDB to the global route with the default id
Sail::::bind();
```Accessing the database should be as simple as this
```rust
let addr = "127.0.0.1:8080".parse::()?;
let mut db: Sail = Sail::new(addr).await?;let (key, val) = ("hello".to_string(), "world!".to_string());
db.insert(&key, &val).await?;
let val = db.get(&key).await?;
assert!(val, Some("world!".to_string()))
```[A simple example of SailDB](https://github.com/znx3p0/saildb_test)