sqlite 0.5.0

The package provides an interface to SQLite.
docs.rs failed to build sqlite-0.5.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: sqlite-0.34.0

SQLite Build Status

The package provides an interface to SQLite.

Documentation

Example

The example given below can be ran using the following command:

cargo run --example workflow
extern crate sqlite;

use std::path::PathBuf;

fn main() {
    let path = setup();
    let database = sqlite::open(&path).unwrap();

    database.execute(r#"
        CREATE TABLE `users` (id INTEGER, name VARCHAR(255));
        INSERT INTO `users` (id, name) VALUES (1, 'Alice');
    "#, None).unwrap();

    database.execute("SELECT * FROM `users`;", Some(&mut |pairs| -> bool {
        for (ref column, ref value) in pairs {
            println!("{} = {}", column, value);
        }
        true
    })).unwrap();
}

fn setup() -> PathBuf {
    let path = PathBuf::from("database.sqlite3");
    if std::fs::metadata(&path).is_ok() {
        std::fs::remove_file(&path).unwrap();
    }
    path
}

Contributing

  1. Fork the project.
  2. Implement your idea.
  3. Open a pull request.