Skip to content

orm: support lowercase operators like, in, not in etc #25035

Merged
spytheman merged 4 commits into
vlang:masterfrom
Delta456:orm_lowercase_op
Aug 4, 2025
Merged

orm: support lowercase operators like, in, not in etc #25035
spytheman merged 4 commits into
vlang:masterfrom
Delta456:orm_lowercase_op

Conversation

@Delta456

@Delta456 Delta456 commented Aug 3, 2025

Copy link
Copy Markdown
Member

solves #25032

@huly-for-github

Copy link
Copy Markdown

Connected to Huly®: V_0.6-23552

@JalonSolov

Copy link
Copy Markdown
Collaborator

I would be somewhat simpler to create an UPPERCASE copy of the input, and stepping though that, instead of adding all the lowercase versions of things.

@Delta456

Delta456 commented Aug 3, 2025

Copy link
Copy Markdown
Member Author

I would be somewhat simpler to create an UPPERCASE copy of the input, and stepping though that, instead of adding all the lowercase versions of things.

I did think about ss.input[ss.pos..].to_upper() but that might be overkill for small comparison.

@JalonSolov

Copy link
Copy Markdown
Collaborator

No, I meant

tmp_ss := ss.input.to_upper()

then

if tmp_ss[ss.pos..].starts_with('IS NOT NULL')

later in the code.

In other words, keep ss.input as-is, do the .to_upper() call once, and only do comparisons against tmp_ss.

@JalonSolov

Copy link
Copy Markdown
Collaborator

Of course, if you copy anything out of ss.input, always copy out of the original, not tmp_ss.

@Delta456

Delta456 commented Aug 3, 2025

Copy link
Copy Markdown
Member Author

Of course, if you copy anything out of ss.input, always copy out of the original, not tmp_ss.

Good idea. I just pushed the changes. Do review

@Delta456 Delta456 requested a review from JalonSolov August 3, 2025 21:15

@spytheman spytheman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work.

@spytheman spytheman merged commit 1569a82 into vlang:master Aug 4, 2025
71 checks passed
@Delta456 Delta456 deleted the orm_lowercase_op branch August 4, 2025 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants