Use of ::diesel in procedural macro define_sql_function forces to diesel as direct dependency instead of simply in scope, which is bothersome when diesel is re-exported.
What are you trying to accomplish?
Use macro define_sql_function without having diesel as direct dependency
What is the expected output?
Code compiles
What is the actual output?
error[E0433]: failed to resolve: could not find `diesel` in the list of imported crates
--> /home/elrendio/Stockly/Main/operations/Service/src/supply/Suppliers/src/auto_block/high_at_submission_price_changes.rs:95:4
|
95 | / diesel::define_sql_function! {
96 | | fn greatest(a: Nullable<Timestamptz>, b: Nullable<Timestamptz>, c: Timestamptz) -> Timestamptz;
97 | | }
| |_____________^ could not find `diesel` in the list of imported crates
|
= note: this error originates in the macro `diesel::define_sql_function` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing this module
Are you seeing any additional errors?
/
Steps to reproduce
Create a crate that re-exports diesel, let's call it diesel_helpers
Create a second crate with dependency diesel_helpers, let's call it diesel_consumer
In crate diesel_consumer, use diesel_helpers::diesel::define_sql_function
Setup
Versions
Feature Flags
Problem Description
Use of
::diesel
in procedural macrodefine_sql_function
forces to diesel as direct dependency instead of simply in scope, which is bothersome when diesel is re-exported.What are you trying to accomplish?
Use macro
define_sql_function
without having diesel as direct dependencyWhat is the expected output?
Code compiles
What is the actual output?
Are you seeing any additional errors?
/
Steps to reproduce
diesel_helpers
, let's call it diesel_consumerChecklist