scylladb / latte

Latency Tester for Apache Cassandra
Apache License 2.0
2 stars 1 forks source link

Add support for batch queries #14

Open vponomaryov opened 1 week ago

vponomaryov commented 1 week ago

Example of it's usage:

  pub async fn insert(db, i) {
    ...
    let stmt_keys = [];
    let stmt_values = [];
    ...
    stmt_keys.push(some_prepared_statement_name);
    stmt_values.push([
      user_id, user_name, permissions,
    ]);
    ...
    db.batch_prepared(stmt_keys, stmt_values).await?
    ...
  }

To reuse the same gathered values in non-batch call do following:

  pub async fn insert(db, i) {
    ...
    db.execute_prepared(stmt_keys[0], stmt_values[0]).await?
    ...
  }

Closes: https://github.com/scylladb/latte/issues/12