@@ -464,7 +464,7 @@ fn build_table_fns(
464464 buffer. push_str ( & format ! (
465465 r##"
466466 /// Insert a new row into `{table_name}` with a given [`{create_struct_identifier}`]
467- pub{async_keyword} fn create(db: &mut ConnectionType, item: &{create_struct_identifier}) -> QueryResult<Self> {{
467+ pub{async_keyword} fn create(db: &mut ConnectionType, item: &{create_struct_identifier}) -> diesel:: QueryResult<Self> {{
468468 use {schema_path}{table_name}::dsl::*;
469469
470470 diesel::insert_into({table_name}).values(item).get_result::<Self>(db){await_keyword}
@@ -475,7 +475,7 @@ fn build_table_fns(
475475 buffer. push_str ( & format ! (
476476 r##"
477477 /// Insert a new row into `{table_name}` with all default values
478- pub{async_keyword} fn create(db: &mut ConnectionType) -> QueryResult<Self> {{
478+ pub{async_keyword} fn create(db: &mut ConnectionType) -> diesel:: QueryResult<Self> {{
479479 use {schema_path}{table_name}::dsl::*;
480480
481481 diesel::insert_into({table_name}).default_values().get_result::<Self>(db){await_keyword}
@@ -495,7 +495,7 @@ fn build_table_fns(
495495 buffer. push_str ( & format ! (
496496 r##"
497497 /// Get a row from `{table_name}`, identified by the primary {key_maybe_multiple}
498- pub{async_keyword} fn read(db: &mut ConnectionType, {item_id_params}) -> QueryResult<Self> {{
498+ pub{async_keyword} fn read(db: &mut ConnectionType, {item_id_params}) -> diesel:: QueryResult<Self> {{
499499 use {schema_path}{table_name}::dsl::*;
500500
501501 {table_name}.{item_id_filters}.first::<Self>(db){await_keyword}
@@ -505,7 +505,7 @@ fn build_table_fns(
505505
506506 buffer. push_str ( & format ! ( r##"
507507 /// Paginates through the table where page is a 0-based index (i.e. page 0 is the first page)
508- pub{async_keyword} fn paginate(db: &mut ConnectionType, page: i64, page_size: i64) -> QueryResult<PaginationResult<Self>> {{
508+ pub{async_keyword} fn paginate(db: &mut ConnectionType, page: i64, page_size: i64) -> diesel:: QueryResult<PaginationResult<Self>> {{
509509 use {schema_path}{table_name}::dsl::*;
510510
511511 let page_size = if page_size < 1 {{ 1 }} else {{ page_size }};
@@ -534,7 +534,7 @@ fn build_table_fns(
534534
535535 buffer. push_str ( & format ! ( r##"
536536 /// Update a row in `{table_name}`, identified by the primary {key_maybe_multiple} with [`{update_struct_identifier}`]
537- pub{async_keyword} fn update(db: &mut ConnectionType, {item_id_params}, item: &{update_struct_identifier}) -> QueryResult<Self> {{
537+ pub{async_keyword} fn update(db: &mut ConnectionType, {item_id_params}, item: &{update_struct_identifier}) -> diesel:: QueryResult<Self> {{
538538 use {schema_path}{table_name}::dsl::*;
539539
540540 diesel::update({table_name}.{item_id_filters}).set(item).get_result(db){await_keyword}
@@ -546,7 +546,7 @@ fn build_table_fns(
546546 buffer. push_str ( & format ! (
547547 r##"
548548 /// Delete a row in `{table_name}`, identified by the primary {key_maybe_multiple}
549- pub{async_keyword} fn delete(db: &mut ConnectionType, {item_id_params}) -> QueryResult<usize> {{
549+ pub{async_keyword} fn delete(db: &mut ConnectionType, {item_id_params}) -> diesel:: QueryResult<usize> {{
550550 use {schema_path}{table_name}::dsl::*;
551551
552552 diesel::delete({table_name}.{item_id_filters}).execute(db){await_keyword}
@@ -628,10 +628,6 @@ fn build_imports(table: &ParsedTableMacro, config: &GenerationConfig) -> String
628628 // no "::" because that is already included in the schema_path
629629 imports_vec. push ( format ! ( "use {}*;" , config. schema_path) ) ;
630630
631- if table_options. get_fns ( ) {
632- imports_vec. push ( "use diesel::QueryResult;" . into ( ) ) ;
633- } ;
634-
635631 if config. once_common_structs || config. once_connection_type {
636632 imports_vec. push ( format ! ( "use {}common::*;" , config. model_path) ) ;
637633 } ;
0 commit comments