Add a way to combine where with OR / AND. #158#163
Merged
lex148 merged 7 commits intoweldsorm:and_orfrom Dec 13, 2025
Merged
Conversation
polo-asm
commented
Dec 13, 2025
| use super::Relation; | ||
| use super::{read_as_ident, read_as_path, read_as_string}; | ||
| use crate::errors::Result; | ||
| use syn::{Expr, Ident, Token}; |
Contributor
Author
There was a problem hiding this comment.
this using was not removed in my previous PR.
polo-asm
commented
Dec 13, 2025
| use std::marker::PhantomData; | ||
| use welds_connections::Param; | ||
|
|
||
| #[derive(Clone)] |
Contributor
Author
There was a problem hiding this comment.
Needed to implement Clone & Copy in Schema structure
polo-asm
commented
Dec 13, 2025
| pub struct Basic<T> { | ||
| col: String, | ||
| field: String, | ||
| col: &'static str, |
Contributor
Author
There was a problem hiding this comment.
String prevent from implementing Copy. Because column and field are const it can be replaced by a static str
polo-asm
commented
Dec 13, 2025
|
|
||
| quote! { | ||
|
|
||
| #[derive(Copy,Clone)] |
Contributor
Author
There was a problem hiding this comment.
in closure |a| a.id.equal(0).or( a.name.equal("yyyy") ) the compiler must be able to copy a to use it twice. So I implemented Copy & Clone on the schema structure. I was also obliged to implement Copy on all query/clause structures.
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.
Implementation for #158
Or / And condition can be written using 2 syntax :
It's a proposal which can be enhanced. Maybe some documentation may be needed.