From 70cd758ef3254148decaf22cbb58b9b8e0ade20f Mon Sep 17 00:00:00 2001 From: woylie <13847569+woylie@users.noreply.github.com> Date: Fri, 13 Mar 2026 10:37:52 +0100 Subject: [PATCH 1/6] rename docker compose config --- docker-compose.yml => compose.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docker-compose.yml => compose.yaml (100%) diff --git a/docker-compose.yml b/compose.yaml similarity index 100% rename from docker-compose.yml rename to compose.yaml From 778209f3ca9440875cf11122b86947e1907241c1 Mon Sep 17 00:00:00 2001 From: woylie <13847569+woylie@users.noreply.github.com> Date: Fri, 13 Mar 2026 10:42:11 +0100 Subject: [PATCH 2/6] fix redundant function clause warning for build_op in elixir 1.20 --- lib/flop/adapter/ecto.ex | 44 +++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/lib/flop/adapter/ecto.ex b/lib/flop/adapter/ecto.ex index 38b646c..167dcd7 100644 --- a/lib/flop/adapter/ecto.ex +++ b/lib/flop/adapter/ecto.ex @@ -889,28 +889,30 @@ defmodule Flop.Adapter.Ecto do build_dynamic(unquote(fragment), false, unquote(combinator)) end - defp build_op( - _schema_struct, - %FieldInfo{ - extra: %{type: :custom, field_dynamic: {mod, fun, dynamic_opts}} - }, - %Filter{op: unquote(op), value: value}, - extra_opts - ) do - unquote(prelude) - dynamic_opts = Keyword.merge(extra_opts, dynamic_opts) - field_dynamic = apply(mod, fun, [dynamic_opts]) - build_dynamic(unquote(fragment_dynamic), false, unquote(combinator)) - end + if op not in [:empty, :not_empty] do + defp build_op( + _schema_struct, + %FieldInfo{ + extra: %{type: :custom, field_dynamic: {mod, fun, dynamic_opts}} + }, + %Filter{op: unquote(op), value: value}, + extra_opts + ) do + unquote(prelude) + dynamic_opts = Keyword.merge(extra_opts, dynamic_opts) + field_dynamic = apply(mod, fun, [dynamic_opts]) + build_dynamic(unquote(fragment_dynamic), false, unquote(combinator)) + end - defp build_op( - _schema_struct, - %FieldInfo{extra: %{type: :join, binding: binding, field: field}}, - %Filter{op: unquote(op), value: value}, - _extra_opts - ) do - unquote(prelude) - build_dynamic(unquote(fragment), true, unquote(combinator)) + defp build_op( + _schema_struct, + %FieldInfo{extra: %{type: :join, binding: binding, field: field}}, + %Filter{op: unquote(op), value: value}, + _extra_opts + ) do + unquote(prelude) + build_dynamic(unquote(fragment), true, unquote(combinator)) + end end end From 50013752bc783ff51d10c0e89417b978d5c5b682 Mon Sep 17 00:00:00 2001 From: woylie <13847569+woylie@users.noreply.github.com> Date: Fri, 13 Mar 2026 10:42:54 +0100 Subject: [PATCH 3/6] update dependencies --- mix.exs | 4 ++-- mix.lock | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mix.exs b/mix.exs index 963ab97..d59f558 100644 --- a/mix.exs +++ b/mix.exs @@ -74,11 +74,11 @@ defmodule Flop.MixProject do {:ex_machina, "2.8.0", only: :test}, {:makeup_diff, "0.1.1", only: :dev, runtime: false}, {:excoveralls, "0.18.5", only: :test}, - {:myxql, "0.8.0", only: :test}, + {:myxql, "0.8.1", only: :test}, {:nimble_options, "~> 1.0"}, {:postgrex, "0.22.0", only: :test}, {:ecto_sqlite3, "0.22.0", only: :test}, - {:stream_data, "1.2.0", only: [:dev, :test]} + {:stream_data, "1.3.0", only: [:dev, :test]} ] end diff --git a/mix.lock b/mix.lock index 141cd32..b46062e 100644 --- a/mix.lock +++ b/mix.lock @@ -21,10 +21,10 @@ "makeup_diff": {:hex, :makeup_diff, "0.1.1", "01498f8c95970081297837eaf4686b6f3813e535795b8421f15ace17a59aea37", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "fadb0bf014bd328badb7be986eadbce1a29955dd51c27a9e401c3045cf24184e"}, "makeup_elixir": {:hex, :makeup_elixir, "1.0.1", "e928a4f984e795e41e3abd27bfc09f51db16ab8ba1aebdba2b3a575437efafc2", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "7284900d412a3e5cfd97fdaed4f5ed389b8f2b4cb49efc0eb3bd10e2febf9507"}, "makeup_erlang": {:hex, :makeup_erlang, "1.0.3", "4252d5d4098da7415c390e847c814bad3764c94a814a0b4245176215615e1035", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "953297c02582a33411ac6208f2c6e55f0e870df7f80da724ed613f10e6706afd"}, - "myxql": {:hex, :myxql, "0.8.0", "60c60e87c7320d2f5759416aa1758c8e7534efbae07b192861977f8455e35acd", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:geo, "~> 3.4 or ~> 4.0", [hex: :geo, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "1ec0ceb26fb3cd0f8756519cf4f0e4f9348177a020705223bdf4742a2c44d774"}, + "myxql": {:hex, :myxql, "0.8.1", "5d7b96f288a98927a40309b274917d16a288a8c0b273205135913ff9799563b3", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:geo, "~> 3.4 or ~> 4.0", [hex: :geo, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "85a4795712bbab1a0f0803d5f0c7332bb383e5f07d3443a42e17a9aa996bbddb"}, "nimble_options": {:hex, :nimble_options, "1.1.1", "e3a492d54d85fc3fd7c5baf411d9d2852922f66e69476317787a7b2bb000a61b", [:mix], [], "hexpm", "821b2470ca9442c4b6984882fe9bb0389371b8ddec4d45a9504f00a66f650b44"}, "nimble_parsec": {:hex, :nimble_parsec, "1.4.2", "8efba0122db06df95bfaa78f791344a89352ba04baedd3849593bfce4d0dc1c6", [:mix], [], "hexpm", "4b21398942dda052b403bbe1da991ccd03a053668d147d53fb8c4e0efe09c973"}, "postgrex": {:hex, :postgrex, "0.22.0", "fb027b58b6eab1f6de5396a2abcdaaeb168f9ed4eccbb594e6ac393b02078cbd", [:mix], [{:db_connection, "~> 2.9", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "a68c4261e299597909e03e6f8ff5a13876f5caadaddd0d23af0d0a61afcc5d84"}, - "stream_data": {:hex, :stream_data, "1.2.0", "58dd3f9e88afe27dc38bef26fce0c84a9e7a96772b2925c7b32cd2435697a52b", [:mix], [], "hexpm", "eb5c546ee3466920314643edf68943a5b14b32d1da9fe01698dc92b73f89a9ed"}, - "telemetry": {:hex, :telemetry, "1.4.0", "69aa83d53f152f93f05fd40b77ded6fab247de093b7a3c4ca2879e634144446e", [:rebar3], [], "hexpm", "d1ff426f988ac1092f9d684d34d08e51042a70567c16be793fbc8f399fd2e77d"}, + "stream_data": {:hex, :stream_data, "1.3.0", "bde37905530aff386dea1ddd86ecbf00e6642dc074ceffc10b7d4e41dfd6aac9", [:mix], [], "hexpm", "3cc552e286e817dca43c98044c706eec9318083a1480c52ae2688b08e2936e3c"}, + "telemetry": {:hex, :telemetry, "1.4.1", "ab6de178e2b29b58e8256b92b382ea3f590a47152ca3651ea857a6cae05ac423", [:rebar3], [], "hexpm", "2172e05a27531d3d31dd9782841065c50dd5c3c7699d95266b2edd54c2dafa1c"}, } From da700aa4d82960c17c6d122fb70632b3a3758c61 Mon Sep 17 00:00:00 2001 From: woylie <13847569+woylie@users.noreply.github.com> Date: Fri, 13 Mar 2026 10:45:03 +0100 Subject: [PATCH 4/6] remove unused options --- test/support/test_util.ex | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/test/support/test_util.ex b/test/support/test_util.ex index 6e953c5..ce62fdd 100644 --- a/test/support/test_util.ex +++ b/test/support/test_util.ex @@ -317,14 +317,11 @@ defmodule Flop.TestUtil do default_limit: 999_999_999 ) - sort? = opts[:sort] || true - q = Pet |> join(:left, [p], o in assoc(p, :owner), as: :owner) |> preload(:owner) - - q = if sort?, do: order_by(q, [p], p.id), else: q + |> order_by([p], p.id) opts = opts |> Keyword.take([:extra_opts]) |> Keyword.put(:for, Pet) @@ -342,13 +339,7 @@ defmodule Flop.TestUtil do default_limit: 999_999_999 ] - sort? = opts[:sort] || true - - params = - if sort?, - do: Map.merge(params, %{order_by: [:id], order_directions: [:asc]}), - else: params - + params = Map.merge(params, %{order_by: [:id], order_directions: [:asc]}) flop = Flop.validate!(params, flop_opts) q = From f006f656607821a095e03ce8fdffb47af4204270 Mon Sep 17 00:00:00 2001 From: woylie <13847569+woylie@users.noreply.github.com> Date: Fri, 13 Mar 2026 10:50:22 +0100 Subject: [PATCH 5/6] configure test ignore filter --- mix.exs | 1 + 1 file changed, 1 insertion(+) diff --git a/mix.exs b/mix.exs index d59f558..ebd2d8c 100644 --- a/mix.exs +++ b/mix.exs @@ -15,6 +15,7 @@ defmodule Flop.MixProject do deps: deps(), test_coverage: [tool: ExCoveralls], test_paths: test_paths(System.get_env("ECTO_ADAPTER")), + test_ignore_filters: [&String.ends_with?(&1, "migration.exs")], dialyzer: [ ignore_warnings: ".dialyzer_ignore.exs", list_unused_filters: true, From ab242b5b6266eeb58fc73271cd91ddc843901baa Mon Sep 17 00:00:00 2001 From: woylie <13847569+woylie@users.noreply.github.com> Date: Fri, 13 Mar 2026 10:51:41 +0100 Subject: [PATCH 6/6] update changelog --- CHANGELOG.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 268edfc..101403a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,12 +2,16 @@ ## Unreleased -- Allow overriding the global `default_limit` by setting `default_limit: false` in the schema +### Changed + +- Allow overriding the global `default_limit` by setting `default_limit: false` + in the schema. -## Fixed +### Fixed - Remove malformed filters if `replace_invalid_params` is `true` (e.g. if the parameters include `%{"filters" => ""}` instead of a filters list. +- Fix redundant function clause warnings in Elixir 1.20. ## [0.26.3] - 2025-05-29