Skip to content

feat(database): add min, max, avg and sum to query builders#2083

Merged
brendt merged 10 commits intotempestphp:3.xfrom
laylatichy:feat-add-aggregates
Mar 31, 2026
Merged

feat(database): add min, max, avg and sum to query builders#2083
brendt merged 10 commits intotempestphp:3.xfrom
laylatichy:feat-add-aggregates

Conversation

@laylatichy
Copy link
Copy Markdown
Contributor

@laylatichy laylatichy commented Mar 27, 2026

adds missing aggregates

not sure why mago changes

$result = SelectQueryBuilder::fromQueryBuilder(
    source: $this,
    fields: arr(input: [$field]),
)

into

$result =
      SelectQueryBuilder::fromQueryBuilder(
          source: $this,
          fields: arr(input: [$field]),
      )

swapped int/float detection logic to str_contains because mago doesnt allow string + 0 which if by far the fastest
carthage-software/mago#1525

str_contains is about 10% slower but mago is not crying

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 27, 2026

Benchmark Results

Comparison of feat-add-aggregates against 3.x (f1162475c1a432bec8d9c8442f46f7c895db7765).

Open to see the benchmark results

No benchmark changes above ±5%.

Generated by phpbench against commit 29cd9fa

@laylatichy laylatichy force-pushed the feat-add-aggregates branch from cfd3ac0 to a6f2bbf Compare March 27, 2026 22:27
@innocenzi innocenzi changed the title feat(database): add min max avg sum feat(database): add min, max, avg and sum to query builders Mar 27, 2026
@laylatichy laylatichy force-pushed the feat-add-aggregates branch 3 times, most recently from d71083b to 2321d75 Compare March 28, 2026 11:12
@laylatichy laylatichy marked this pull request as ready for review March 28, 2026 12:02
@laylatichy laylatichy force-pushed the feat-add-aggregates branch 2 times, most recently from dca8bac to e0ce0c4 Compare March 28, 2026 17:02
@laylatichy laylatichy force-pushed the feat-add-aggregates branch from e0ce0c4 to 29cd9fa Compare March 29, 2026 15:32
@brendt brendt merged commit c83783c into tempestphp:3.x Mar 31, 2026
76 checks passed
@brendt
Copy link
Copy Markdown
Member

brendt commented Mar 31, 2026

🔥

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.

2 participants