Skip to content

Commit

Permalink
Revert "feat(code): use "use diesel" instead of "use crate::diesel""
Browse files Browse the repository at this point in the history
This reverts commit 5062ebe.

because of #116
  • Loading branch information
hasezoey committed Nov 7, 2023
1 parent 23dbab2 commit cc78f35
Show file tree
Hide file tree
Showing 35 changed files with 34 additions and 35 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
- 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`)
- add derive `QueryableByName` to read-structs

## 0.0.17 (yanked)
Expand Down
2 changes: 1 addition & 1 deletion src/code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,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 diesel::*;".into());
imports_vec.push("use crate::diesel::*;".into());

let table_options = config.table(&table.name.to_string());
imports_vec.extend(table.foreign_keys.iter().map(|fk| {
Expand Down
2 changes: 1 addition & 1 deletion test/autogenerated_all/models/todos/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/autogenerated_attributes/models/todos/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/autogenerated_primary_keys/models/todos/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/cleanup_generated_content/models/todos/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/create_update_str_cow/models/todos/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/create_update_str_str/models/todos/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::data::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::data::models::table_a::TableA;
use crate::data::schema::*;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion test/custom_model_path/models/tableA/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/custom_model_path/models/tableB/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::data::models::table_a::TableA;
use crate::schema::*;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion test/manual_primary_keys/models/todos/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/multiple_primary_keys/models/users/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/no_default_features/models/todos/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/once_common_structs/models/table1/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/once_common_structs/models/table2/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/once_connection_type/models/table1/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/once_connection_type/models/table2/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/readonly/models/normal/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/readonly/models/prefixTable/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/readonly/models/prefixTableSuffix/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/readonly/models/tableSuffix/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/simple_table/models/todos/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/simple_table_async/models/todos/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use diesel_async::RunQueryDsl;
use crate::schema::*;
use serde::{Deserialize, Serialize};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::data::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/simple_table_no_crud/models/todos/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};

Expand Down
2 changes: 1 addition & 1 deletion test/simple_table_no_serde/models/todos/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::schema::*;
use diesel::QueryResult;

Expand Down
2 changes: 1 addition & 1 deletion test/single_model_file/models/table1.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/single_model_file/models/table2.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/use_statements/models/fang_tasks/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use diesel::*;
use crate::diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down

0 comments on commit cc78f35

Please sign in to comment.