Created
March 25, 2019 23:12
-
-
Save icefoxen/3a06b1fde0fefc2a747f169545ad1854 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type SqlType = <(diesel::sql_types::Text, diesel::sql_types::BigInt) as Expression>::SqlType; | |
type BoxedQuery<'a> = cargofox::schema::analyze_metadata_authors::BoxedQuery<'a, Pg, SqlType>; | |
fn lookup<E>(conn: &PgConn, e: E) -> HashMap<String, i64> | |
where | |
E: AsExpression<(Text, BigInt)> | |
+ diesel::expression::SelectableExpression<cargofox::schema::analyze_metadata_authors::table> | |
+ diesel::query_builder::QueryFragment<Pg> | |
+ diesel::query_builder::QueryId, | |
E::Expression: BoxableExpression<ama::analyze_metadata_authors, Pg>, | |
{ | |
let author_id_lookup: HashMap<String, i64> = { | |
ama::analyze_metadata_authors | |
.select(e) | |
.get_results(conn) | |
.expect("*SILLY COWS*") | |
.into_iter() | |
.collect() | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment