Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created January 24, 2020 16:15
Show Gist options
  • Select an option

  • Save rust-play/1fb26c8b690cc772e537d5762189af78 to your computer and use it in GitHub Desktop.

Select an option

Save rust-play/1fb26c8b690cc772e537d5762189af78 to your computer and use it in GitHub Desktop.

Revisions

  1. rust-play created this gist Jan 24, 2020.
    16 changes: 16 additions & 0 deletions playground.rs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    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(())
    }