Beginning Rust Programming by Ric Messier

Beginning Rust Programming by Ric Messier

Author:Ric Messier [Messier, Ric]
Language: eng
Format: epub, pdf
ISBN: 9781119712879
Publisher: Wiley
Published: 2021-03-09T00:00:00+00:00


Finally, we have the code where we send the SQL statement to our database. The two statements that make that happen follow here, as well as the Ok(()) we need because we have said we are returning a Result. The Ok() doesn't need to contain anything since it won't get consumed in our program; that's why we return an empty value, indicated by the () :

let commandstring = format!("INSERT INTO findings (title, finding, details, justification) VALUES ("{}", "{}", "{}", "{}")", title.trim(), finding.trim(), details.trim(), justification.trim()); let _statement = conn.execute(&commandstring).unwrap(); Ok(()) }



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.