Code shared from the Rust Playground
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use rusqlite::{Connection, Result}; | |
fn main() -> Result<()> { | |
let conn = Connection::open("data.sqlite")?; | |
let name = ""; | |
let stripe_id = None; | |
conn.execute( | |
"INSERT INTO merchants (name, stripe_id) VALUES (?, ?)", | |
&[&name, &stripe_id], | |
) | |
.expect("Error inserting merchant into database"); | |
Ok(()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment