1 unstable release
0.1.0 | Mar 3, 2024 |
---|
#132 in #database-client
39KB
790 lines
MekaDB
Register at https://hypi.ai/mekadb.
Usage
fn demo(){
let client = MekaDBClient::connect("https://mekadb.hypi.app".to_owned()).await?;
let ctx = client.login("<db>".to_owned(), "<username>".to_owned(), "<password>".to_owned(), ).await?;
let _ = client.query("CREATE TABLE IF NOT EXISTS user(username VARCHAR, pass VARCHAR, PRIMARY KEY (username))".to_owned(),ctx.clone(),None::<Vec<ParamValue>>).await?;
let _ = client.query("INSERT INTO user(username,pass) VALUES('courtney','pass1'),('damion','pass2')".to_owned(), ctx.clone(), None::<Vec<ParamValue>>, ).await?;
let rows = client.query("SELECT * FROM user".to_owned(), ctx.clone(), None::<Vec<ParamValue>>,).await?;
println!("Rows {:?}", rows);
}
Dependencies
~6–13MB
~150K SLoC