13 releases (stable)

1.2.0 Feb 18, 2024
1.1.4 Sep 17, 2023
1.0.0 Aug 30, 2023
0.1.3 Aug 30, 2023

#486 in Database interfaces

Download history 109/week @ 2024-02-17 97/week @ 2024-02-24 96/week @ 2024-03-02 60/week @ 2024-03-30

60 downloads per month

Custom license

19KB
283 lines

replit_db

An unofficial database adapater for Replit Database for Rust!

Installation

cargo add replit_db

Supports

  • Synchronous
  • Asynchronous
  • Type Safety (:skull emoji:)

Example

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 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.

Dependencies

~4–18MB
~253K SLoC