diff --git a/CHANGELOG.md b/CHANGELOG.md index 44362cdf..dcab88d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ - add many doc-comments to fields and functions - list changes to files (unchanged, modified, deleted) - generate doc-comments for generated structs, fields and functions +- change the diesel import to be `use diesel` (instead of the previous `use crate::diesel`) ## 0.0.17 (yanked) diff --git a/src/code.rs b/src/code.rs index 8debfdd2..21013d20 100644 --- a/src/code.rs +++ b/src/code.rs @@ -600,7 +600,7 @@ fn build_imports(table: &ParsedTableMacro, config: &GenerationConfig) -> String // Note: i guess this could also just be a string that is appended to, or a vec of "Cow", but i personally think this is the most use-able // because you dont have to think of any context style (like forgetting to put "\n" before / after something) let mut imports_vec = Vec::with_capacity(10); - imports_vec.push("use crate::diesel::*;".into()); + imports_vec.push("use diesel::*;".into()); let table_options = config.table(&table.name.to_string()); imports_vec.extend(table.foreign_keys.iter().map(|fk| { diff --git a/test/autogenerated_all/models/todos/generated.rs b/test/autogenerated_all/models/todos/generated.rs index adbccd9b..f71d9cca 100644 --- a/test/autogenerated_all/models/todos/generated.rs +++ b/test/autogenerated_all/models/todos/generated.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use crate::schema::*; use serde::{Deserialize, Serialize}; use diesel::QueryResult; diff --git a/test/autogenerated_attributes/models/todos/generated.rs b/test/autogenerated_attributes/models/todos/generated.rs index 0e2e164d..b597555a 100644 --- a/test/autogenerated_attributes/models/todos/generated.rs +++ b/test/autogenerated_attributes/models/todos/generated.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use crate::schema::*; use serde::{Deserialize, Serialize}; use diesel::QueryResult; diff --git a/test/autogenerated_primary_keys/models/todos/generated.rs b/test/autogenerated_primary_keys/models/todos/generated.rs index ae3eb3ae..9ccd2252 100644 --- a/test/autogenerated_primary_keys/models/todos/generated.rs +++ b/test/autogenerated_primary_keys/models/todos/generated.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use crate::schema::*; use serde::{Deserialize, Serialize}; use diesel::QueryResult; diff --git a/test/cleanup_generated_content/models/todos/generated.rs b/test/cleanup_generated_content/models/todos/generated.rs index 11a804a4..38c835ec 100644 --- a/test/cleanup_generated_content/models/todos/generated.rs +++ b/test/cleanup_generated_content/models/todos/generated.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use crate::schema::*; use serde::{Deserialize, Serialize}; use diesel::QueryResult; diff --git a/test/create_update_str_cow/models/todos/generated.rs b/test/create_update_str_cow/models/todos/generated.rs index 289a359f..c8409da0 100644 --- a/test/create_update_str_cow/models/todos/generated.rs +++ b/test/create_update_str_cow/models/todos/generated.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use crate::schema::*; use serde::{Deserialize, Serialize}; use diesel::QueryResult; diff --git a/test/create_update_str_str/models/todos/generated.rs b/test/create_update_str_str/models/todos/generated.rs index c8e95974..5664a3c1 100644 --- a/test/create_update_str_str/models/todos/generated.rs +++ b/test/create_update_str_str/models/todos/generated.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use crate::schema::*; use serde::{Deserialize, Serialize}; use diesel::QueryResult; diff --git a/test/custom_model_and_schema_path/models/tableA/generated.rs b/test/custom_model_and_schema_path/models/tableA/generated.rs index e2d95938..344f49f6 100644 --- a/test/custom_model_and_schema_path/models/tableA/generated.rs +++ b/test/custom_model_and_schema_path/models/tableA/generated.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use crate::data::schema::*; use serde::{Deserialize, Serialize}; use diesel::QueryResult; diff --git a/test/custom_model_and_schema_path/models/tableB/generated.rs b/test/custom_model_and_schema_path/models/tableB/generated.rs index 010cb357..e8e4e710 100644 --- a/test/custom_model_and_schema_path/models/tableB/generated.rs +++ b/test/custom_model_and_schema_path/models/tableB/generated.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use crate::data::models::table_a::TableA; use crate::data::schema::*; use serde::{Deserialize, Serialize}; diff --git a/test/custom_model_path/models/tableA/generated.rs b/test/custom_model_path/models/tableA/generated.rs index 0669502a..4eaf14ae 100644 --- a/test/custom_model_path/models/tableA/generated.rs +++ b/test/custom_model_path/models/tableA/generated.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use crate::schema::*; use serde::{Deserialize, Serialize}; use diesel::QueryResult; diff --git a/test/custom_model_path/models/tableB/generated.rs b/test/custom_model_path/models/tableB/generated.rs index f18ae275..fe48270a 100644 --- a/test/custom_model_path/models/tableB/generated.rs +++ b/test/custom_model_path/models/tableB/generated.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use crate::data::models::table_a::TableA; use crate::schema::*; use serde::{Deserialize, Serialize}; diff --git a/test/manual_primary_keys/models/todos/generated.rs b/test/manual_primary_keys/models/todos/generated.rs index 42ca0fa3..c74a4db2 100644 --- a/test/manual_primary_keys/models/todos/generated.rs +++ b/test/manual_primary_keys/models/todos/generated.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use crate::schema::*; use serde::{Deserialize, Serialize}; use diesel::QueryResult; diff --git a/test/multiple_primary_keys/models/users/generated.rs b/test/multiple_primary_keys/models/users/generated.rs index d7c5a8a5..135ba10f 100644 --- a/test/multiple_primary_keys/models/users/generated.rs +++ b/test/multiple_primary_keys/models/users/generated.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use crate::schema::*; use serde::{Deserialize, Serialize}; use diesel::QueryResult; diff --git a/test/once_common_structs/models/table1/generated.rs b/test/once_common_structs/models/table1/generated.rs index ccbaa099..e36bccbd 100644 --- a/test/once_common_structs/models/table1/generated.rs +++ b/test/once_common_structs/models/table1/generated.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use crate::schema::*; use serde::{Deserialize, Serialize}; use diesel::QueryResult; diff --git a/test/once_common_structs/models/table2/generated.rs b/test/once_common_structs/models/table2/generated.rs index 6a772fee..f3f9c4b7 100644 --- a/test/once_common_structs/models/table2/generated.rs +++ b/test/once_common_structs/models/table2/generated.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use crate::schema::*; use serde::{Deserialize, Serialize}; use diesel::QueryResult; diff --git a/test/once_common_structs_once_connection_type/models/table1/generated.rs b/test/once_common_structs_once_connection_type/models/table1/generated.rs index 72877763..b592c7df 100644 --- a/test/once_common_structs_once_connection_type/models/table1/generated.rs +++ b/test/once_common_structs_once_connection_type/models/table1/generated.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use crate::schema::*; use serde::{Deserialize, Serialize}; use diesel::QueryResult; diff --git a/test/once_common_structs_once_connection_type/models/table2/generated.rs b/test/once_common_structs_once_connection_type/models/table2/generated.rs index 83a919b8..49a65773 100644 --- a/test/once_common_structs_once_connection_type/models/table2/generated.rs +++ b/test/once_common_structs_once_connection_type/models/table2/generated.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use crate::schema::*; use serde::{Deserialize, Serialize}; use diesel::QueryResult; diff --git a/test/once_common_structs_once_connection_type_single_file/models/table1.rs b/test/once_common_structs_once_connection_type_single_file/models/table1.rs index 72877763..b592c7df 100644 --- a/test/once_common_structs_once_connection_type_single_file/models/table1.rs +++ b/test/once_common_structs_once_connection_type_single_file/models/table1.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use crate::schema::*; use serde::{Deserialize, Serialize}; use diesel::QueryResult; diff --git a/test/once_common_structs_once_connection_type_single_file/models/table2.rs b/test/once_common_structs_once_connection_type_single_file/models/table2.rs index 83a919b8..49a65773 100644 --- a/test/once_common_structs_once_connection_type_single_file/models/table2.rs +++ b/test/once_common_structs_once_connection_type_single_file/models/table2.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use crate::schema::*; use serde::{Deserialize, Serialize}; use diesel::QueryResult; diff --git a/test/once_connection_type/models/table1/generated.rs b/test/once_connection_type/models/table1/generated.rs index 6d2f5af9..98cb87b5 100644 --- a/test/once_connection_type/models/table1/generated.rs +++ b/test/once_connection_type/models/table1/generated.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use crate::schema::*; use serde::{Deserialize, Serialize}; use diesel::QueryResult; diff --git a/test/once_connection_type/models/table2/generated.rs b/test/once_connection_type/models/table2/generated.rs index 3181676e..d556c11d 100644 --- a/test/once_connection_type/models/table2/generated.rs +++ b/test/once_connection_type/models/table2/generated.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use crate::schema::*; use serde::{Deserialize, Serialize}; use diesel::QueryResult; diff --git a/test/readonly/models/normal/generated.rs b/test/readonly/models/normal/generated.rs index 44a2bae6..5f1938fa 100644 --- a/test/readonly/models/normal/generated.rs +++ b/test/readonly/models/normal/generated.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use crate::schema::*; use serde::{Deserialize, Serialize}; use diesel::QueryResult; diff --git a/test/readonly/models/prefixTable/generated.rs b/test/readonly/models/prefixTable/generated.rs index 56b87e86..8de86b01 100644 --- a/test/readonly/models/prefixTable/generated.rs +++ b/test/readonly/models/prefixTable/generated.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use crate::schema::*; use serde::{Deserialize, Serialize}; use diesel::QueryResult; diff --git a/test/readonly/models/prefixTableSuffix/generated.rs b/test/readonly/models/prefixTableSuffix/generated.rs index 4afe4571..3ce8c3b0 100644 --- a/test/readonly/models/prefixTableSuffix/generated.rs +++ b/test/readonly/models/prefixTableSuffix/generated.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use crate::schema::*; use serde::{Deserialize, Serialize}; use diesel::QueryResult; diff --git a/test/readonly/models/tableSuffix/generated.rs b/test/readonly/models/tableSuffix/generated.rs index f6a378e7..00a0a534 100644 --- a/test/readonly/models/tableSuffix/generated.rs +++ b/test/readonly/models/tableSuffix/generated.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use crate::schema::*; use serde::{Deserialize, Serialize}; use diesel::QueryResult; diff --git a/test/simple_table/models/todos/generated.rs b/test/simple_table/models/todos/generated.rs index 43b0369d..6228d5c0 100644 --- a/test/simple_table/models/todos/generated.rs +++ b/test/simple_table/models/todos/generated.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use crate::schema::*; use serde::{Deserialize, Serialize}; use diesel::QueryResult; diff --git a/test/simple_table_async/models/todos/generated.rs b/test/simple_table_async/models/todos/generated.rs index 27258c3b..8b03138e 100644 --- a/test/simple_table_async/models/todos/generated.rs +++ b/test/simple_table_async/models/todos/generated.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use diesel_async::RunQueryDsl; use crate::schema::*; use serde::{Deserialize, Serialize}; diff --git a/test/simple_table_custom_schema_path/models/todos/generated.rs b/test/simple_table_custom_schema_path/models/todos/generated.rs index 1be97c0d..fe7987a5 100644 --- a/test/simple_table_custom_schema_path/models/todos/generated.rs +++ b/test/simple_table_custom_schema_path/models/todos/generated.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use crate::data::schema::*; use serde::{Deserialize, Serialize}; use diesel::QueryResult; diff --git a/test/simple_table_no_crud/models/todos/generated.rs b/test/simple_table_no_crud/models/todos/generated.rs index feca272e..4460b875 100644 --- a/test/simple_table_no_crud/models/todos/generated.rs +++ b/test/simple_table_no_crud/models/todos/generated.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use crate::schema::*; use serde::{Deserialize, Serialize}; diff --git a/test/simple_table_no_serde/models/todos/generated.rs b/test/simple_table_no_serde/models/todos/generated.rs index 00e3851c..87bdc4b0 100644 --- a/test/simple_table_no_serde/models/todos/generated.rs +++ b/test/simple_table_no_serde/models/todos/generated.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use crate::schema::*; use diesel::QueryResult; diff --git a/test/single_model_file/models/table1.rs b/test/single_model_file/models/table1.rs index f50f1aff..335f899b 100644 --- a/test/single_model_file/models/table1.rs +++ b/test/single_model_file/models/table1.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use crate::schema::*; use serde::{Deserialize, Serialize}; use diesel::QueryResult; diff --git a/test/single_model_file/models/table2.rs b/test/single_model_file/models/table2.rs index 7d2a1b82..79a08c12 100644 --- a/test/single_model_file/models/table2.rs +++ b/test/single_model_file/models/table2.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use crate::schema::*; use serde::{Deserialize, Serialize}; use diesel::QueryResult; diff --git a/test/use_statements/models/fang_tasks/generated.rs b/test/use_statements/models/fang_tasks/generated.rs index f5db8ed5..491bbc59 100644 --- a/test/use_statements/models/fang_tasks/generated.rs +++ b/test/use_statements/models/fang_tasks/generated.rs @@ -1,6 +1,6 @@ /* @generated and managed by dsync */ -use crate::diesel::*; +use diesel::*; use crate::schema::*; use serde::{Deserialize, Serialize}; use diesel::QueryResult;