#![allow(dead_code)] use sqlite::Connection; use std::path::Path; macro_rules! ok(($result:expr) => ($result.unwrap())); pub fn setup_english>(path: T) -> Connection { let connection = ok!(sqlite::open(path)); ok!(connection.execute( " CREATE TABLE english (value TEXT); INSERT INTO english VALUES ('cerotype'); INSERT INTO english VALUES ('metatype'); INSERT INTO english VALUES ('ozotype'); INSERT INTO english VALUES ('phenotype'); INSERT INTO english VALUES ('plastotype'); INSERT INTO english VALUES ('undertype'); INSERT INTO english VALUES ('nonsence'); ", )); connection } pub fn setup_users>(path: T) -> Connection { let connection = ok!(sqlite::open(path)); ok!(connection.execute( " CREATE TABLE users (id INTEGER, name TEXT, age REAL, photo BLOB, email TEXT); INSERT INTO users VALUES (1, 'Alice', 42.69, X'4269', NULL); ", )); connection }