diff --git a/src/db.rs b/src/db.rs index 16af108..e4cdc4d 100644 --- a/src/db.rs +++ b/src/db.rs @@ -1,6 +1,6 @@ use diesel::prelude::*; use diesel::expression::sql_literal::sql; -use diesel::types::*; +use diesel::sql_types::*; use r2d2::{CustomizeConnection, Pool}; use r2d2_diesel::{self, ConnectionManager}; diff --git a/src/lib.rs b/src/lib.rs index 4bd08a1..f26a32a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,7 +5,7 @@ #[macro_use] extern crate bart_derive; #[macro_use] extern crate codegen; -#[macro_use] extern crate diesel_infer_schema; +#[macro_use] #[allow(deprecated)] extern crate diesel_infer_schema; #[macro_use] extern crate diesel_migrations; #[macro_use] extern crate diesel; #[macro_use] extern crate hyper; diff --git a/src/models.rs b/src/models.rs index 4d35b17..e43ecbd 100644 --- a/src/models.rs +++ b/src/models.rs @@ -49,7 +49,7 @@ impl ArticleRevisionStub { pub fn link(&self) -> &str { slug_link(&self.slug) } } -use diesel::types::Text; +use diesel::sql_types::Text; #[derive(Debug, QueryableByName, Serialize)] pub struct SearchResult { #[sql_type = "Text"] diff --git a/src/state.rs b/src/state.rs index 9353bc0..ed19654 100644 --- a/src/state.rs +++ b/src/state.rs @@ -332,9 +332,9 @@ impl<'a> SyncState<'a> { let article_id = { use diesel::expression::sql_literal::sql; // Diesel and SQLite are a bit in disagreement for how this should look: - sql::<(diesel::types::Integer)>("INSERT INTO articles VALUES (null)") + sql::<(diesel::sql_types::Integer)>("INSERT INTO articles VALUES (null)") .execute(self.db_connection)?; - sql::<(diesel::types::Integer)>("SELECT LAST_INSERT_ROWID()") + sql::<(diesel::sql_types::Integer)>("SELECT LAST_INSERT_ROWID()") .load::(self.db_connection)? .pop().expect("Statement must evaluate to an integer") }; @@ -365,7 +365,7 @@ impl<'a> SyncState<'a> { pub fn search_query(&self, query_string: String, limit: i32, offset: i32, snippet_size: i32) -> Result, Error> { use diesel::sql_query; - use diesel::types::{Integer, Text}; + use diesel::sql_types::{Integer, Text}; fn fts_quote(src: &str) -> String { format!("\"{}\"", src.replace('\"', "\"\""))