Automatically check_for_backend when not in release#5
Open
acksly wants to merge 11 commits into
Open
Conversation
Ten0
reviewed
Jun 12, 2025
Ten0
reviewed
Jun 12, 2025
| let check_function = if let Some(backends) = if cfg!(debug_assertions) { | ||
| Some(Cow::Owned(syn::parse::Parser::parse2( | ||
| syn::punctuated::Punctuated::parse_terminated, | ||
| quote!(diesel::pg::Pg).into(), |
Owner
There was a problem hiding this comment.
Can you please benchmark the impact of this on compilation time?
Testing process:
- Disable RA
- Clean build
- Add a new field to a Selectable impl (rust-analyzer disabled)
- Time cargo check
- Change diesel revision to this fork
- Remove new field
- Clean build
- Add new field again
- Time cargo check
Ten0
reviewed
Aug 26, 2025
Comment on lines
+53
to
+56
| Some(Cow::Owned(syn::parse::Parser::parse2( | ||
| syn::punctuated::Punctuated::parse_terminated, | ||
| quote!(diesel::pg::Pg).into(), | ||
| )?)) |
Owner
There was a problem hiding this comment.
it looks like this can use the parse_quote! macro.
Ten0
reviewed
Aug 26, 2025
| #[cfg(not(feature = "automatic-check-for-backend"))] | ||
| let backend = model.check_for_backend.as_ref(); | ||
|
|
||
| let check_function = if let Some(ref backends) = backend { |
Owner
There was a problem hiding this comment.
naming: at this line it seems a single backend turns into multiple backends
It's either "a check_for_backend statement" or "several backends".
backend => check_for_backend
Ten0
reviewed
Aug 26, 2025
| .collect::<Result<Vec<_>>>()?; | ||
|
|
||
| let check_function = if let Some(ref backends) = model.check_for_backend { | ||
| #[cfg(feature = "automatic-check-for-backend")] |
Owner
There was a problem hiding this comment.
pr title doesn't seem to match with the change anymore
Ten0
reviewed
Aug 27, 2025
|
|
||
|
|
||
| [dependencies] | ||
| diesel = { path = "../diesel/", features = ["postgres"] } |
Owner
There was a problem hiding this comment.
I don't see this using the feature so probably it's supposed to get removed?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.