diff --git a/src/main.rs b/src/main.rs index 858a851..3af5dfd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -34,7 +34,10 @@ fn setup_db() -> Result { } fn query_sections(conn: &DbConnection) -> Result { - 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 mut sections = Sections::new(); for row in rows { diff --git a/src/migrations.rs b/src/migrations.rs index 6c02dde..a461777 100644 --- a/src/migrations.rs +++ b/src/migrations.rs @@ -85,7 +85,9 @@ pub fn get_db_version(conn: &Connection) -> MigrationResult { } let version: u32 = conn.query_row( - "SELECT version FROM db_version WHERE id = 1", + "SELECT v.version \ + FROM db_version AS v \ + WHERE id = 1", NO_PARAMS, |row| row.get(0), )?;