Skip to content

Make clauses more robust + use them in presenter queries#15

Open
justim wants to merge 3 commits intomasterfrom
clauses
Open

Make clauses more robust + use them in presenter queries#15
justim wants to merge 3 commits intomasterfrom
clauses

Conversation

@justim
Copy link
Owner

@justim justim commented Jul 25, 2025

Make clauses more consistent in SQL and PHP form

Generating SQL with a clause or applying a clause to a collection should
result in the same outcome. There is a difference in behavior for empty
Multiple clause for condition clauses and ordering clauses.

  • The implementation of empty Multiple clauses was wrong for SQL, it
    should not match anything. This now matches the PHP implementation.
  • Multiple ordering clauses were not properly applied to a query, the
    logic for condition was used, which is not right

Include clauses in presenter queries

Previously the presenters would only use the clauses to filter and/or
order the found entities after the query was run. This might be wasteful
if the clause is used to only select a small subset of the query result.
Using the clause in the query makes the query less wasteful, this
behavior is skipped if the entity pool has a request for different
clauses for the same entities.

justim added 3 commits June 13, 2025 15:11
Convert it to a regular array in the needed places
Generating SQL with a clause or applying a clause to a collection should
result in the same outcome. There is a difference in behavior for empty
`Multiple` clause for condition clauses and ordering clauses.

- The implementation of empty `Multiple` clauses was wrong for SQL, it
  should not match anything. This now matches the PHP implementation.
- `Multiple` ordering clauses were not properly applied to a query, the
  logic for condition was used, which is not right
Previously the presenters would only use the clauses to filter and/or
order the found entities after the query was run. This might be wasteful
if the clause is used to only select a small subset of the query result.
Using the clause in the query makes the query less wasteful, this
behavior is skipped if the entity pool has a request for different
clauses for the same entities.
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