Closed chaseWillden closed 1 day ago
The previous implementations only allow for selecting. This implementation allows for all other SQL query types:
#[test] fn execute_raw_sql() { let db_relative_path = "./db/insert.db"; let db_path = Path::new(&db_relative_path); let conn = sqlite::open(db_path).unwrap(); let sql = sql! { INSERT INTO users (username, email, address) VALUES ("raw_execute", "raw_execute@icloud.com", "raw_execute_address"); DELETE FROM users WHERE username = "raw_execute"; }; let results = sqlite::raw_execute(&conn, &sql); assert!(!results.is_err()); }
The previous implementations only allow for selecting. This implementation allows for all other SQL query types: