-
v1, Beta 10 Pre-Release
released this
2024-09-27 02:30:09 +00:00 | 4 commits to main since this releaseLots of good stuff here!
- There are two new field comparisons;
in
implements anIN
comparison against a field, andinArray
does the same thing for fields that are themselves JSON arrays. - The
Find
functions (exceptbyId
) now support an array ofField
s, as their last parameter, which will be used to order the results. There is also a newField::named()
function which can be used to create field definitions for this purpose. These names follow the same rules as other field names (use "a.b.c" for nested fields), but they support other features as well.- To sort descending, include DESC in the name (ex.
Field::named('code DESC')
). - To specify a null clause, include it as well (ex.
Field::named('example NULLS FIRST')
). - To sort the field as a number, prefix the field name with
n:
(ex.Field::named('n:ranking')
). PostgreSQL will cast the field to a number, while SQLite will do its usual best-guess. - To sort case-insensitively, prefix the field name with
i:
(ex.Field::named('i:comment')
). SQLite's default is case-sensitive sorting, with uppercase values first. PostgreSQL's behavior is based on libraries in the underlying operating system; some are case-insensitive by default, but others (particularly Mac OS) are case-sensitive.
- To sort descending, include DESC in the name (ex.
- The names of the comparisons in
Field
constructor functions are now spelled out (ex.Field::equal
instead ofField::EQ
). The two-character versions remain as aliases, so this will not break existing code. - The project now comes back clean for PHPStan level 6, and had some changes flagged on higher levels. One of these changes may fix an issue where IDEs were not picking up the generic type coming from
DocumentList->items()
.
Downloads
- There are two new field comparisons;