mekadb-client

Crates.iomekadb-client
lib.rsmekadb-client
version0.1.4
sourcesrc
created_at2024-01-30 21:39:40.878001
updated_at2024-01-31 06:31:51.735501
descriptionHypi's official MekaDB Rust client.
homepagehttps://hypi.ai/mekadb
repositoryhttps://github.com/hypi-universe/
max_upload_size
id1120738
size46,479
Courtney Robinson (zcourts)

documentation

https://hypi.ai/docs/mekadb/how-to-connect

README

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);
  }
Commit count: 0

cargo fmt