View Source Exandra.Batch (exandra v0.10.2)

A struct that represents a batch of queries to be executed in a single request to Cassandra/Scylla.

This is essentially a wrapper around Xandra.Batch, but you should not use Xandra.Batch if working with Exandra.

Exandra.Batch contains a single field, :queries, which is a list of tuples in the form {query, params}.



To execute a batch of queries through Exandra, you can use the Exandra.execute_batch/3.

batch = %Exandra.Batch{
  queries: [
    {"INSERT INTO users (email) VALUES (?)", [""]},
    {"INSERT INTO users (email) VALUES (?)", [""]}

Exandra.execute_batch(MyApp.Repo, batch)