@@ -482,7 +482,7 @@ fn build_table_fns(
482482 buffer. push_str ( & format ! (
483483 r##"
484484 /// Insert a new row into `{table_name}` with a given [`{create_struct_identifier}`]
485- pub{async_keyword} fn create(db: &mut ConnectionType, item: &{create_struct_identifier}) -> QueryResult<Self> {{
485+ pub{async_keyword} fn create(db: &mut ConnectionType, item: &{create_struct_identifier}) -> diesel:: QueryResult<Self> {{
486486 use {schema_path}{table_name}::dsl::*;
487487
488488 diesel::insert_into({table_name}).values(item).get_result::<Self>(db){await_keyword}
@@ -493,7 +493,7 @@ fn build_table_fns(
493493 buffer. push_str ( & format ! (
494494 r##"
495495 /// Insert a new row into `{table_name}` with all default values
496- pub{async_keyword} fn create(db: &mut ConnectionType) -> QueryResult<Self> {{
496+ pub{async_keyword} fn create(db: &mut ConnectionType) -> diesel:: QueryResult<Self> {{
497497 use {schema_path}{table_name}::dsl::*;
498498
499499 diesel::insert_into({table_name}).default_values().get_result::<Self>(db){await_keyword}
@@ -513,7 +513,7 @@ fn build_table_fns(
513513 buffer. push_str ( & format ! (
514514 r##"
515515 /// Get a row from `{table_name}`, identified by the primary {key_maybe_multiple}
516- pub{async_keyword} fn read(db: &mut ConnectionType, {item_id_params}) -> QueryResult<Self> {{
516+ pub{async_keyword} fn read(db: &mut ConnectionType, {item_id_params}) -> diesel:: QueryResult<Self> {{
517517 use {schema_path}{table_name}::dsl::*;
518518
519519 {table_name}.{item_id_filters}.first::<Self>(db){await_keyword}
@@ -523,7 +523,7 @@ fn build_table_fns(
523523
524524 buffer. push_str ( & format ! ( r##"
525525 /// Paginates through the table where page is a 0-based index (i.e. page 0 is the first page)
526- pub{async_keyword} fn paginate(db: &mut ConnectionType, page: i64, page_size: i64) -> QueryResult<PaginationResult<Self>> {{
526+ pub{async_keyword} fn paginate(db: &mut ConnectionType, page: i64, page_size: i64) -> diesel:: QueryResult<PaginationResult<Self>> {{
527527 use {schema_path}{table_name}::dsl::*;
528528
529529 let page_size = if page_size < 1 {{ 1 }} else {{ page_size }};
@@ -552,7 +552,7 @@ fn build_table_fns(
552552
553553 buffer. push_str ( & format ! ( r##"
554554 /// Update a row in `{table_name}`, identified by the primary {key_maybe_multiple} with [`{update_struct_identifier}`]
555- pub{async_keyword} fn update(db: &mut ConnectionType, {item_id_params}, item: &{update_struct_identifier}) -> QueryResult<Self> {{
555+ pub{async_keyword} fn update(db: &mut ConnectionType, {item_id_params}, item: &{update_struct_identifier}) -> diesel:: QueryResult<Self> {{
556556 use {schema_path}{table_name}::dsl::*;
557557
558558 diesel::update({table_name}.{item_id_filters}).set(item).get_result(db){await_keyword}
@@ -564,7 +564,7 @@ fn build_table_fns(
564564 buffer. push_str ( & format ! (
565565 r##"
566566 /// Delete a row in `{table_name}`, identified by the primary {key_maybe_multiple}
567- pub{async_keyword} fn delete(db: &mut ConnectionType, {item_id_params}) -> QueryResult<usize> {{
567+ pub{async_keyword} fn delete(db: &mut ConnectionType, {item_id_params}) -> diesel:: QueryResult<usize> {{
568568 use {schema_path}{table_name}::dsl::*;
569569
570570 diesel::delete({table_name}.{item_id_filters}).execute(db){await_keyword}
@@ -646,10 +646,6 @@ fn build_imports(table: &ParsedTableMacro, config: &GenerationConfig) -> String
646646 // no "::" because that is already included in the schema_path
647647 imports_vec. push ( format ! ( "use {}*;" , config. schema_path) ) ;
648648
649- if table_options. get_fns ( ) {
650- imports_vec. push ( "use diesel::QueryResult;" . into ( ) ) ;
651- } ;
652-
653649 if config. once_common_structs || config. once_connection_type {
654650 imports_vec. push ( format ! ( "use {}common::*;" , config. model_path) ) ;
655651 } ;
0 commit comments