2015-06-08 18:19:15 -04:00
2015-06-08 17:43:31 -04:00
2015-05-29 09:25:39 -04:00
2015-05-28 17:24:45 -04:00
2015-06-08 15:27:28 -04:00
2015-05-28 17:21:43 -04:00

SQLite Version 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::fs;
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');
    "#).unwrap();

    database.process("SELECT * FROM `users`;", |pairs| {
        for (ref column, ref value) in pairs {
            println!("{} = {}", column, value);
        }
        true
    }).unwrap();
}

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

Contributing

  1. Fork the project.
  2. Implement your idea.
  3. Open a pull request.
Description
No description provided
Readme 3.5 MiB
Languages
Rust 99.3%
Shell 0.7%