Skip to content

Commit 58f1f31

Browse files
committed
feat(code): change table functions "insert_into" to also use "diesel::" prefix (like other functions)
1 parent 556b2b3 commit 58f1f31

File tree

30 files changed

+31
-31
lines changed

30 files changed

+31
-31
lines changed

src/code.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ fn build_table_fns(
467467
pub{async_keyword} fn create(db: &mut ConnectionType, item: &{create_struct_identifier}) -> QueryResult<Self> {{
468468
use {schema_path}{table_name}::dsl::*;
469469
470-
insert_into({table_name}).values(item).get_result::<Self>(db){await_keyword}
470+
diesel::insert_into({table_name}).values(item).get_result::<Self>(db){await_keyword}
471471
}}
472472
"##
473473
));
@@ -478,7 +478,7 @@ fn build_table_fns(
478478
pub{async_keyword} fn create(db: &mut ConnectionType) -> QueryResult<Self> {{
479479
use {schema_path}{table_name}::dsl::*;
480480
481-
insert_into({table_name}).default_values().get_result::<Self>(db){await_keyword}
481+
diesel::insert_into({table_name}).default_values().get_result::<Self>(db){await_keyword}
482482
}}
483483
"##
484484
));

test/autogenerated_all/models/todos/generated.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl Todos {
4444
pub fn create(db: &mut ConnectionType) -> QueryResult<Self> {
4545
use crate::schema::todos::dsl::*;
4646

47-
insert_into(todos).default_values().get_result::<Self>(db)
47+
diesel::insert_into(todos).default_values().get_result::<Self>(db)
4848
}
4949

5050
/// Get a row from `todos`, identified by the primary key

test/autogenerated_attributes/models/todos/generated.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl Todos {
5252
pub fn create(db: &mut ConnectionType, item: &CreateTodos) -> QueryResult<Self> {
5353
use crate::schema::todos::dsl::*;
5454

55-
insert_into(todos).values(item).get_result::<Self>(db)
55+
diesel::insert_into(todos).values(item).get_result::<Self>(db)
5656
}
5757

5858
/// Get a row from `todos`, identified by the primary key

test/autogenerated_primary_keys/models/todos/generated.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl Todos {
5252
pub fn create(db: &mut ConnectionType, item: &CreateTodos) -> QueryResult<Self> {
5353
use crate::schema::todos::dsl::*;
5454

55-
insert_into(todos).values(item).get_result::<Self>(db)
55+
diesel::insert_into(todos).values(item).get_result::<Self>(db)
5656
}
5757

5858
/// Get a row from `todos`, identified by the primary key

test/cleanup_generated_content/models/todos/generated.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl Todos {
6868
pub fn create(db: &mut ConnectionType, item: &CreateTodos) -> QueryResult<Self> {
6969
use crate::schema::todos::dsl::*;
7070

71-
insert_into(todos).values(item).get_result::<Self>(db)
71+
diesel::insert_into(todos).values(item).get_result::<Self>(db)
7272
}
7373

7474
/// Get a row from `todos`, identified by the primary key

test/create_update_str_cow/models/todos/generated.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl Todos {
6666
pub fn create(db: &mut ConnectionType, item: &CreateTodos) -> QueryResult<Self> {
6767
use crate::schema::todos::dsl::*;
6868

69-
insert_into(todos).values(item).get_result::<Self>(db)
69+
diesel::insert_into(todos).values(item).get_result::<Self>(db)
7070
}
7171

7272
/// Get a row from `todos`, identified by the primary key

test/create_update_str_str/models/todos/generated.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl Todos {
6666
pub fn create(db: &mut ConnectionType, item: &CreateTodos) -> QueryResult<Self> {
6767
use crate::schema::todos::dsl::*;
6868

69-
insert_into(todos).values(item).get_result::<Self>(db)
69+
diesel::insert_into(todos).values(item).get_result::<Self>(db)
7070
}
7171

7272
/// Get a row from `todos`, identified by the primary key

test/custom_model_and_schema_path/models/table_a/generated.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl TableA {
4242
pub fn create(db: &mut ConnectionType, item: &CreateTableA) -> QueryResult<Self> {
4343
use crate::data::schema::tableA::dsl::*;
4444

45-
insert_into(tableA).values(item).get_result::<Self>(db)
45+
diesel::insert_into(tableA).values(item).get_result::<Self>(db)
4646
}
4747

4848
/// Get a row from `tableA`, identified by the primary key

test/custom_model_and_schema_path/models/table_b/generated.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl TableB {
5555
pub fn create(db: &mut ConnectionType, item: &CreateTableB) -> QueryResult<Self> {
5656
use crate::data::schema::tableB::dsl::*;
5757

58-
insert_into(tableB).values(item).get_result::<Self>(db)
58+
diesel::insert_into(tableB).values(item).get_result::<Self>(db)
5959
}
6060

6161
/// Get a row from `tableB`, identified by the primary key

test/custom_model_path/models/table_a/generated.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl TableA {
4242
pub fn create(db: &mut ConnectionType, item: &CreateTableA) -> QueryResult<Self> {
4343
use crate::schema::tableA::dsl::*;
4444

45-
insert_into(tableA).values(item).get_result::<Self>(db)
45+
diesel::insert_into(tableA).values(item).get_result::<Self>(db)
4646
}
4747

4848
/// Get a row from `tableA`, identified by the primary key

0 commit comments

Comments
 (0)