@vantreeseba/drizzle-graphql 11.0.2 → 12.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -850,7 +850,51 @@ by hand. Under `insensitive` the operand stays a literal and stays a bound param
850
850
  the left side is a plain `lower(column)`, a `lower(column)` expression index can serve the
851
851
  lookup — which `ilike '%…%'` never can
852
852
  - The flag appears only on filters whose column can take string operators, so it is absent
853
- from the numeric, uuid and boolean filters
853
+ from the numeric, uuid, boolean, timestamp and enum filters (see
854
+ [Which operators a column gets](#which-operators-a-column-gets))
855
+
856
+ ## Which operators a column gets
857
+
858
+ A filter input carries the operators that can express a question about that column type, and
859
+ no others. The set follows the column's data type, never its name:
860
+
861
+ | column type | `eq` `ne` `inArray` `notInArray` `isNull` `isNotNull` | `lt` `lte` `gt` `gte` | pattern operators + `insensitive` |
862
+ | --- | --- | --- | --- |
863
+ | text / varchar | yes | yes | yes |
864
+ | timestamp, date | yes | yes | — |
865
+ | int, float, bigint, decimal | yes | yes | — |
866
+ | uuid | yes | yes | — |
867
+ | boolean | yes | — | — |
868
+ | enum | yes | — | — |
869
+
870
+ The pattern operators are `like` / `notLike` / `ilike` / `notIlike`, the safe
871
+ `startsWith` / `endsWith` / `contains` and their `i`-prefixed forms, plus the `insensitive`
872
+ flag that modifies them.
873
+
874
+ The omissions are the cases where the operator cannot ask anything a caller means:
875
+
876
+ - **Pattern matching a timestamp, a boolean or an enum member** compares whatever the value
877
+ is rendered as rather than anything in the row, and the answer depends on session
878
+ formatting. On a numeric column it is invalid SQL outright.
879
+ - **Ordering two booleans** is equality spelled as a puzzle — `gt: false` is `eq: true`.
880
+ - **Ordering enum members** compares their declaration order, which is an artefact of how the
881
+ column was written rather than a fact about the domain. `inArray` says the same thing
882
+ exactly.
883
+
884
+ Timestamps keep the ordering operators — ranges are the point of having them — and `json` /
885
+ `jsonb` and array columns have their own sets entirely (structural containment and membership;
886
+ see [Filtering inside JSON documents](#filtering-inside-json-documents)).
887
+
888
+ A column given a custom scalar through `scalarOverrides` keeps the pattern operators only when
889
+ a `LIKE` against the underlying database column would be valid — string-typed and not
890
+ numeric — and keeps the ordering operators either way, since a custom scalar says nothing about
891
+ whether its column is orderable.
892
+
893
+ > **Upgrading:** `BooleanFilter` and the generated `*EnumFilter`s used to carry the full
894
+ > 24-operator string set, and `DateTimeFilter` the pattern half of it. Queries that sent one of
895
+ > the removed operators are now validation errors; `eq` / `ne` / `inArray` / `notInArray` /
896
+ > `isNull` / `isNotNull` and the boolean branches `AND` / `OR` / `NOT` are unchanged, as is
897
+ > ordering on timestamps.
854
898
 
855
899
  ## Matching lists of values
856
900