|
|
@ -34,7 +34,10 @@ fn setup_db() -> Result<DbConnection> { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fn query_sections(conn: &DbConnection) -> Result<Sections> { |
|
|
|
fn query_sections(conn: &DbConnection) -> Result<Sections> { |
|
|
|
let mut statement = conn.prepare_cached("SELECT id, name, interface_id FROM sections;")?; |
|
|
|
let mut statement = conn.prepare_cached( |
|
|
|
|
|
|
|
"SELECT s.id, s.name, s.interface_id \ |
|
|
|
|
|
|
|
FROM sections AS s;", |
|
|
|
|
|
|
|
)?; |
|
|
|
let rows = statement.query_map(NO_PARAMS, Section::from_sql)?; |
|
|
|
let rows = statement.query_map(NO_PARAMS, Section::from_sql)?; |
|
|
|
let mut sections = Sections::new(); |
|
|
|
let mut sections = Sections::new(); |
|
|
|
for row in rows { |
|
|
|
for row in rows { |
|
|
|