Skip to content

Add IfElse conditional branching support (#74)#74

Merged
GokselKUCUKSAHIN merged 3 commits intomainfrom
exp/better-conditional
Feb 13, 2026
Merged

Add IfElse conditional branching support (#74)#74
GokselKUCUKSAHIN merged 3 commits intomainfrom
exp/better-conditional

Conversation

@GokselKUCUKSAHIN
Copy link
Member

Implement conditional branching for query construction with full DSL support:

  • IfElse: Evaluates conditions and returns the first matching item or nil
  • ElseIf: Creates conditional branches for chaining multiple conditions
  • Else: Creates default branch when no condition matches
  • Branch: Internal type representing conditional branches

Generic implementation supports both map[string]any and []any types for flexible query building.

All implementations

Implement conditional branching for query construction with full DSL support:

- IfElse: Evaluates conditions and returns the first matching item or nil
- ElseIf: Creates conditional branches for chaining multiple conditions
- Else: Creates default branch when no condition matches
- Branch: Internal type representing conditional branches

Generic implementation supports both map[string]any and []any types for flexible query building.

All implementations
Move item field before condition in Branch struct to optimize memory layout and reduce padding.
@GokselKUCUKSAHIN GokselKUCUKSAHIN merged commit 1ce9d79 into main Feb 13, 2026
14 checks passed
@GokselKUCUKSAHIN GokselKUCUKSAHIN deleted the exp/better-conditional branch February 13, 2026 17:26
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.

1 participant