use common::{KEYSPACE, TABLE, ROW_COUNT, READ_SIZE}; use latte::*; mod common; const READ = "read"; pub async fn schema(db) { common::init_schema(db).await?; } pub async fn erase(db) { common::erase(db).await?; } pub async fn prepare(db) { common::prepare(db).await?; db.prepare(READ, `SELECT * FROM ${KEYSPACE}.${TABLE} WHERE time1 >= ? AND time1 < ? LIMIT ${READ_SIZE}`).await?; } pub async fn load(db, i) { common::insert_row(db, i).await?; } pub async fn run(db, i) { let point = hash_range(i, ROW_COUNT - READ_SIZE); db.execute_prepared(READ, (point, point + READ_SIZE)).await?; }