If I include parenthesis in a SQLlite query, I get a syntax error.
Steps to Reproduce
Run ( SELECT * FROM any_table ) or SELECT MAX(id) FROM any_table
Here is some example code:
let index_stmt = Statement::from_string(
txn.get_database_backend(),
format!(
"SELECT MAX (leaf_index) FROM indexed_trees",
),
);
// Get the max index from the database
let max_index = txn
.query_one(index_stmt)
.await
.map_err(|e| {
IngesterError::DatabaseError(format!("Failed to execute max index query: {}", e))
})?
.ok_or(IngesterError::DatabaseError(
"No max index found".to_string(),
))?;
Description
If I include parenthesis in a SQLlite query, I get a syntax error.
Steps to Reproduce
( SELECT * FROM any_table )
orSELECT MAX(id) FROM any_table
Here is some example code: