chore(deps): update dependency flop to ~> 0.29.0 #235
No reviewers
Labels
No labels
Area
Editor
Area
Micropub
Compat
Breaking
Kind
Bug
Kind
Documentation
Kind
Enhancement
Kind
Feature
Kind
Infra
Kind
Security
Kind
Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
inhji/hajur!235
Loading…
Reference in a new issue
No description provided.
Delete branch "renovate/flop-0.x"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
~> 0.26.4→~> 0.29.0Release Notes
woylie/flop (flop)
v0.29.0Compare Source
Added
Flop.allowed_fields/2, which returns the fields that may be filtered orsorted for the given options.
Flop.Schema.flop_schema!/1, which returns the configuration of a schemamodule.
Flop.Cursor.get_cursor_from_node/3andFlop.Cursor.get_cursor_from_edge/3, which take the query options and resolvea field against the schema given as
:for.cursor_value_func, which also receives the options thequery ran with.
Changed
Flop.Schemafrom a protocol into a behaviour. Schemas are configuredwith
use Flop.Schemaand the@flop_optionsattribute now.Flop.Schema.field_info/2,Flop.Schema.get_field/3andFlop.Schema.primary_key/1.cursor_value_functoFlop.Cursor.get_cursor_from_node/3.Removed
default_limit/1,default_order/1,default_pagination_type/1,filterable/1,max_filters/1,max_limit/1,pagination_types/1,sortable/1andtiebreaker/1fromFlop.Schema.Fixed
ecto_typea compile-time dependency of theschema.
:for, so that a field's:pathis applied when the query returns plain maps rather than structs.How to upgrade
Change your code to
use Flop.Schemaand set the options as@flop_optionsinstead of using
@deriveto derive the protocol.The attribute is read when the module finishes compiling, so it can go anywhere
in the module body. If you use an alias in the options, the alias has to be
declared before the module attribute.
The functions that returned a single schema option are gone. Read the effective
value through
Flop.get_option/3, which also applies the backend module and theapplication environment, or
Flop.allowed_fields/2forfilterableandsortable, which applies the narrowing a query function may have set:The remaining functions take the schema module instead of a struct:
An arity-2
cursor_value_funcis still supported. You can use a 3-arityfunction if you need the schema or other options passed to Flop, for example if
you need to apply the
pathoption of join or custom fields.v0.28.0Compare Source
Added
field_dynamicoption.pathoption on custom fields.tiebreakeroption, which appends order fields to make the orderstable.
Flop.ordering/2andFlop.cursor_fields/2, which return the order thatis applied to a query.
diagnosticsoption, which enables checks about how Flop is used. Itcan only be set in the application environment.
max_filterswhen derivingFlop.Schema.Changed
:ascor:descorder directionand no repo is configured. This only affects queries built with
Flop.query/3.ecto_type: nilon join and custom fields.can be overridden with the
tiebreakeroption. Settiebreaker: falsetodisable.
tiebreaker is disabled.
tiebreaker/1,primary_key/1andmax_filters/1to theFlop.Schemaprotocol.
ORDER BYclause whenthe
diagnosticsoption is enabled in the application environment.filterableas an option to query functions to narrow theschema's filterable fields.
sortableoption passed to a query function by narrowing theschema's list instead of replacing it.
ArgumentErrorwhen aFlopstruct with a non-matching paginationtype is passed to
Flop.to_previous_page/1,Flop.to_next_page/2,Flop.to_previous_offset/1orFlop.to_next_offset/2, and apply them to thefirst page when it has no pagination parameters.
Fixed
:=~,:ilike,:not_ilike,:ilike_and,:ilike_or,:starts_withand:ends_withfilters withLIKEon databases that have noILIKE, such as SQLite and MySQL, instead of raising anEcto.QueryError.:asc_nulls_first,:asc_nulls_last,:desc_nulls_firstand:desc_nulls_lastdirections for MySQL.:containsand:not_containsfilters, and:empty/:not_emptyon array fields, with
JSON_CONTAINSandJSON_LENGTHon MySQL, instead ofraising.
:=~operator from the operators allowed for boolean fields.:like,:starts_with, etc.) from theoperators allowed for
binaryandbinary_idfields.:containsand:not_containsoperators from the operatorsallowed for
binaryfields.ilikeand raised on MySQL andSQLite, and add the variant MySQL needs. Note in the conditional joins recipe
that SQLite has no lateral joins.
FunctionClauseErrorwhen ajoin field is configured with the tuple shorthand that was removed earlier.
sortable,filterable,for,count,count_queryandextra_optsset in the application environment. The application environmentnow accepts the same options as a backend module.
nilwhenFlop.Schema.get_field/2reads a valuethrough an association that is not loaded.
How to upgrade
The warning about a query that already has an
ORDER BYclause is now onlylogged when diagnostics are enabled. To keep seeing it, add this to
config/dev.exsandconfig/test.exs:sortableandfilterablepassed to a query function now narrow the schema'slists instead of replacing them. A call site can no longer add a field the
schema does not list. Add any missing field to the schema options:
Flop appends the primary key to the order now by default, which means that the
field list passed to
cursor_value_funcincludes it now, and its value needs tobe in the returned map. Ensure your custom
cursor_value_funccan handle theadditional field.
You can set
tiebreaker: falseto disable this feature and revert to theprevious behaviour.
v0.27.2Compare Source
Added
Fixed
:emptyand:not_emptyfilters on SQLite correctly.ESCAPEclause toLIKEpatterns, so that filter values containing%,_or\are matched literally on databases that define no defaultescape character, such as SQLite.
:emptyand:not_emptyfilters with the valuefalseon compoundfields.
:emptywithfalserequired every field to be set, instead of anyfield, so it did not return the same rows as
:not_emptywithtrue.v0.27.1Compare Source
Added
Fixed
replace_invalid_paramsoption through the documented look-uporder. It was only applied when passed to a query function, and can now be set
on a backend module and in the application environment as well.
cursor_value_funcoption through the documented look-up orderand accept it in
use Flop.max_cursor_sizeoption inuse Flop.falsefor themax_limitoption inuse Flopand in@derive Flop.Schema.default_orderset in the application environment.v0.27.0Compare Source
Changed
ecto_typeoption for join fields and custom fields.Flop.UnknownFieldErrorinstead of aFunctionClauseErrorwhenFlop.Schema.field_info/2,Flop.Schema.get_field/2orFlop.Filter.allowed_operators/2is called with a field that is notconfigured in the schema.
validation. They can still be used with offset and page based pagination.
ArgumentErrorinstead of ignoring the filter when an unsupportedoperator is applied to a compound field. This only affects unvalidated
filters.
Fixed
Flop.aliases/2if theorder_byparameter isnil, instead of raising aProtocol.UndefinedError.Flop.meta/3if neither a page size nor a limit isset, instead of raising an
ArithmeticError.0inFlop.set_page/2andFlop.set_offset/2if the given string is not a number, instead of raisingan
ArgumentError.backend module, instead of discarding them.
Security
default. Configurable with the
max_filtersoption.contains the user-supplied filter values. The errors are returned to the
caller in the
Flop.Metastruct, so nothing is lost.How to upgrade
Add the
ecto_typeoptions to allFlop.Schemaderivations that don't have italready:
Filter lists longer than 20 are now rejected with a validation error on
filters. If your query handles longer filter lists, pass themax_filtersoption:
The option can also be set via application environment or backend module.
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate.
⚠️ Artifact update problem
Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.
♻ Renovate will retry this branch, including artifacts, only when one of the following happens:
The artifact failure details are included below:
File name: mix.lock
chore(deps): update dependency flop to ~> 0.29.0to Update dependency flop to ~> 0.29.0Update dependency flop to ~> 0.29.0to chore(deps): update dependency flop to ~> 0.29.0View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.