Crates.io | mekadb |
lib.rs | mekadb |
version | 0.1.0 |
source | src |
created_at | 2024-03-03 17:35:00.349005 |
updated_at | 2024-03-03 17:35:00.349005 |
description | Hypi's official MekaDB Rust client. |
homepage | https://hypi.ai/mekadb |
repository | https://github.com/hypi-universe/ |
max_upload_size | |
id | 1160786 |
size | 46,465 |
Register at https://hypi.ai/mekadb.
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);
}