https://github.com/timelessnesses/replit_db
Unofficial database adapter for Replit database.
https://github.com/timelessnesses/replit_db
Last synced: about 2 months ago
JSON representation
Unofficial database adapter for Replit database.
- Host: GitHub
- URL: https://github.com/timelessnesses/replit_db
- Owner: timelessnesses
- License: wtfpl
- Created: 2023-08-28T17:02:05.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-02-18T14:06:30.000Z (over 2 years ago)
- Last Synced: 2025-02-02T00:25:28.528Z (over 1 year ago)
- Language: Rust
- Homepage: https://crates.io/crates/replit_db
- Size: 106 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# replit_db
An unofficial database adapater for Replit Database for Rust!
## Installation
```sh
cargo add replit_db
```
## Supports
- Synchronous
- Asynchronous
- Type Safety (:skull emoji:)
## Example
```rust
use replit_db::{self, Synchronous};
fn main() {
let config = replit_db::Config::new().unwrap();
let db = replit_db::Database::new(config);
let res = db.set("testings", "30");
match res {
Ok(()) => println!("Successful!"),
Err(e) => println!("{}",e.to_string())
}
println!(db.get("testings").unwrap());
db.delete("testings").unwrap();
for var in db.list(replit_db::NONE).unwrap() {
println!(var);
} // you could list all variable by prefix with `Some("prefix")`
}.
```
All [documentations](https://replit-db.doc.timelessnesses.me/) will be in the comment and intellisense. (I hosted my own documentation since docs.rs is slow)
Also for asynchronous version please use `replit_db::Asynchronous` trait.