From a5fa5c5f9d0f5af177d60a895be44012df9a1e21 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 27 Jul 2024 02:52:58 +0000 Subject: [PATCH 01/20] Bump excoveralls from 0.18.1 to 0.18.2 Bumps [excoveralls](https://github.com/parroty/excoveralls) from 0.18.1 to 0.18.2. - [Release notes](https://github.com/parroty/excoveralls/releases) - [Changelog](https://github.com/parroty/excoveralls/blob/master/CHANGELOG.md) - [Commits](https://github.com/parroty/excoveralls/compare/v0.18.1...v0.18.2) --- updated-dependencies: - dependency-name: excoveralls dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- mix.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mix.lock b/mix.lock index 384df524..84a531eb 100644 --- a/mix.lock +++ b/mix.lock @@ -10,9 +10,9 @@ "erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"}, "ex_doc": {:hex, :ex_doc, "0.34.2", "13eedf3844ccdce25cfd837b99bea9ad92c4e511233199440488d217c92571e8", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "5ce5f16b41208a50106afed3de6a2ed34f4acfd65715b82a0b84b49d995f95c1"}, "ex_machina": {:hex, :ex_machina, "2.8.0", "a0e847b5712065055ec3255840e2c78ef9366634d62390839d4880483be38abe", [:mix], [{:ecto, "~> 2.2 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: true]}, {:ecto_sql, "~> 3.0", [hex: :ecto_sql, repo: "hexpm", optional: true]}], "hexpm", "79fe1a9c64c0c1c1fab6c4fa5d871682cb90de5885320c187d117004627a7729"}, - "excoveralls": {:hex, :excoveralls, "0.18.1", "a6f547570c6b24ec13f122a5634833a063aec49218f6fff27de9df693a15588c", [:mix], [{:castore, "~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "d65f79db146bb20399f23046015974de0079668b9abb2f5aac074d078da60b8d"}, + "excoveralls": {:hex, :excoveralls, "0.18.2", "86efd87a0676a3198ff50b8c77620ea2f445e7d414afa9ec6c4ba84c9f8bdcc2", [:mix], [{:castore, "~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "230262c418f0de64077626a498bd4fdf1126d5c2559bb0e6b43deac3005225a4"}, "file_system": {:hex, :file_system, "1.0.0", "b689cc7dcee665f774de94b5a832e578bd7963c8e637ef940cd44327db7de2cd", [:mix], [], "hexpm", "6752092d66aec5a10e662aefeed8ddb9531d79db0bc145bb8c40325ca1d8536d"}, - "jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"}, + "jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"}, "makeup": {:hex, :makeup, "1.1.2", "9ba8837913bdf757787e71c1581c21f9d2455f4dd04cfca785c70bbfff1a76a3", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cce1566b81fbcbd21eca8ffe808f33b221f9eee2cbc7a1706fc3da9ff18e6cac"}, "makeup_diff": {:hex, :makeup_diff, "0.1.0", "5be352b6aa6f07fa6a236e3efd7ba689a03f28fb5d35b7a0fa0a1e4a64f6d8bb", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "186bad5bb433a8afeb16b01423950e440072284a4103034ca899180343b9b4ac"}, "makeup_elixir": {:hex, :makeup_elixir, "0.16.2", "627e84b8e8bf22e60a2579dad15067c755531fea049ae26ef1020cad58fe9578", [: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", "41193978704763f6bbe6cc2758b84909e62984c7752b3784bd3c218bb341706b"}, From 1fbfab09580a7d9d0bc3efe2e114dff00895d675 Mon Sep 17 00:00:00 2001 From: c4710n Date: Tue, 30 Jul 2024 10:35:49 +0800 Subject: [PATCH 02/20] fix typo in docs --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8b8b5310..f9a8d999 100644 --- a/README.md +++ b/README.md @@ -272,7 +272,7 @@ argument can be used to override certain options depending on the context in which the function is called. ```elixir -def list_pets(%{} = args, opts \\ [], %User{} = current_user) do +def list_pets(%{} = params, opts \\ [], %User{} = current_user) do flop_opts = opts |> Keyword.take([ @@ -285,7 +285,7 @@ def list_pets(%{} = args, opts \\ [], %User{} = current_user) do Pet |> scope(current_user) |> apply_filters(opts) - |> Flop.validate_and_run(flop, flop_opts) + |> Flop.validate_and_run(params, flop_opts) end defp scope(q, %User{role: :admin}), do: q From 217b211978d9311c8e1164296c971be9da394d5c Mon Sep 17 00:00:00 2001 From: c4710n Date: Tue, 30 Jul 2024 10:57:10 +0800 Subject: [PATCH 03/20] improve docs of restricting pagination types The commit includes 2 main changes. + The old one mixes pagination types and paramaters. At first glance, it can be very confusing. So, I change the doc to not mention related parameters at all. And, the parameters will be mentioned in the doc of `t:Flop.pagination_type/0`. + Note that the `nil` is the default value. This tells developers that they don't need to do anything if they want to support all pagination types. --- lib/flop/schema.ex | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/flop/schema.ex b/lib/flop/schema.ex index 3ce6570d..938afd88 100644 --- a/lib/flop/schema.ex +++ b/lib/flop/schema.ex @@ -95,9 +95,9 @@ defprotocol Flop.Schema do ## Restricting pagination types - By default, `page`/`page_size`, `offset`/`limit` and cursor-based pagination - (`first`/`after` and `last`/`before`) are enabled. If you wish to restrict the - pagination type for a schema, you can set the `pagination_types` option. + By default, all supported pagination types (`t:Flop.pagination_type/0`) are + enabled. If you wish to restrict the pagination type for a schema, you can + set the `:pagination_types` option. @derive { Flop.Schema, @@ -106,8 +106,9 @@ defprotocol Flop.Schema do pagination_types: [:first, :last] } - See also `t:Flop.option/0` and `t:Flop.pagination_type/0`. Setting the value - to `nil` allows all pagination types. + Setting the value to `nil` (default) allows all pagination types. + + See also `t:Flop.option/0`. ## Alias fields From 77dbd702980fa7e44a8a942b1a0c612c512d6388 Mon Sep 17 00:00:00 2001 From: c4710n Date: Tue, 30 Jul 2024 11:08:35 +0800 Subject: [PATCH 04/20] mention underlying implementation in the docs of pagination type --- lib/flop.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/flop.ex b/lib/flop.ex index c215ff1f..5e1fc4ea 100644 --- a/lib/flop.ex +++ b/lib/flop.ex @@ -489,8 +489,8 @@ defmodule Flop do @typedoc """ Represents the pagination type. - - `:offset` - pagination using the `offset` and `limit` parameters - - `:page` - pagination using the `page` and `page_size` parameters + - `:offset` - offset-based pagination using the `offset` and `limit` parameters + - `:page` - offset-based pagination using the `page` and `page_size` parameters - `:first` - cursor-based pagination using the `first` and `after` parameters - `:last` - cursor-based pagination using the `last` and `before` parameters """ From 2dd3f639c6b8c4cff0cf892b88a546f113790618 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 10 Aug 2024 02:49:34 +0000 Subject: [PATCH 05/20] Bump postgrex from 0.18.0 to 0.19.0 Bumps [postgrex](https://github.com/elixir-ecto/postgrex) from 0.18.0 to 0.19.0. - [Release notes](https://github.com/elixir-ecto/postgrex/releases) - [Changelog](https://github.com/elixir-ecto/postgrex/blob/master/CHANGELOG.md) - [Commits](https://github.com/elixir-ecto/postgrex/compare/v0.18.0...v0.19.0) --- updated-dependencies: - dependency-name: postgrex dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- mix.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mix.lock b/mix.lock index 84a531eb..86065352 100644 --- a/mix.lock +++ b/mix.lock @@ -1,7 +1,7 @@ %{ "bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"}, "credo": {:hex, :credo, "1.7.7", "771445037228f763f9b2afd612b6aa2fd8e28432a95dbbc60d8e03ce71ba4446", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "8bc87496c9aaacdc3f90f01b7b0582467b69b4bd2441fe8aae3109d843cc2f2e"}, - "db_connection": {:hex, :db_connection, "2.6.0", "77d835c472b5b67fc4f29556dee74bf511bbafecdcaf98c27d27fa5918152086", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c2f992d15725e721ec7fbc1189d4ecdb8afef76648c746a8e1cad35e3b8a35f3"}, + "db_connection": {:hex, :db_connection, "2.7.0", "b99faa9291bb09892c7da373bb82cba59aefa9b36300f6145c5f201c7adf48ec", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "dcf08f31b2701f857dfc787fbad78223d61a32204f217f15e881dd93e4bdd3ff"}, "decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"}, "dialyxir": {:hex, :dialyxir, "1.4.3", "edd0124f358f0b9e95bfe53a9fcf806d615d8f838e2202a9f430d59566b6b53b", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "bf2cfb75cd5c5006bec30141b131663299c661a864ec7fbbc72dfa557487a986"}, "earmark_parser": {:hex, :earmark_parser, "1.4.41", "ab34711c9dc6212dda44fcd20ecb87ac3f3fce6f0ca2f28d4a00e4154f8cd599", [:mix], [], "hexpm", "a81a04c7e34b6617c2792e291b5a2e57ab316365c2644ddc553bb9ed863ebefa"}, @@ -19,7 +19,7 @@ "makeup_erlang": {:hex, :makeup_erlang, "1.0.0", "6f0eff9c9c489f26b69b61440bf1b238d95badae49adac77973cbacae87e3c2e", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "ea7a9307de9d1548d2a72d299058d1fd2339e3d398560a0e46c27dab4891e4d2"}, "nimble_options": {:hex, :nimble_options, "1.1.1", "e3a492d54d85fc3fd7c5baf411d9d2852922f66e69476317787a7b2bb000a61b", [:mix], [], "hexpm", "821b2470ca9442c4b6984882fe9bb0389371b8ddec4d45a9504f00a66f650b44"}, "nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"}, - "postgrex": {:hex, :postgrex, "0.18.0", "f34664101eaca11ff24481ed4c378492fed2ff416cd9b06c399e90f321867d7e", [:mix], [{:db_connection, "~> 2.1", [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", "a042989ba1bc1cca7383ebb9e461398e3f89f868c92ce6671feb7ef132a252d1"}, + "postgrex": {:hex, :postgrex, "0.19.0", "f7d50e50cb42e0a185f5b9a6095125a9ab7e4abccfbe2ab820ab9aa92b71dbab", [:mix], [{:db_connection, "~> 2.1", [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", "dba2d2a0a8637defbf2307e8629cb2526388ba7348f67d04ec77a5d6a72ecfae"}, "stream_data": {:hex, :stream_data, "1.1.1", "fd515ca95619cca83ba08b20f5e814aaf1e5ebff114659dc9731f966c9226246", [:mix], [], "hexpm", "45d0cd46bd06738463fd53f22b70042dbb58c384bb99ef4e7576e7bb7d3b8c8c"}, "telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"}, } From 0ecff9f7ca61cf7dafe5f3b08d523151be6eea39 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 17 Aug 2024 02:50:44 +0000 Subject: [PATCH 06/20] Bump postgrex from 0.19.0 to 0.19.1 Bumps [postgrex](https://github.com/elixir-ecto/postgrex) from 0.19.0 to 0.19.1. - [Release notes](https://github.com/elixir-ecto/postgrex/releases) - [Changelog](https://github.com/elixir-ecto/postgrex/blob/master/CHANGELOG.md) - [Commits](https://github.com/elixir-ecto/postgrex/compare/v0.19.0...v0.19.1) --- updated-dependencies: - dependency-name: postgrex dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- mix.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mix.lock b/mix.lock index 86065352..6d9f54e6 100644 --- a/mix.lock +++ b/mix.lock @@ -19,7 +19,7 @@ "makeup_erlang": {:hex, :makeup_erlang, "1.0.0", "6f0eff9c9c489f26b69b61440bf1b238d95badae49adac77973cbacae87e3c2e", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "ea7a9307de9d1548d2a72d299058d1fd2339e3d398560a0e46c27dab4891e4d2"}, "nimble_options": {:hex, :nimble_options, "1.1.1", "e3a492d54d85fc3fd7c5baf411d9d2852922f66e69476317787a7b2bb000a61b", [:mix], [], "hexpm", "821b2470ca9442c4b6984882fe9bb0389371b8ddec4d45a9504f00a66f650b44"}, "nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"}, - "postgrex": {:hex, :postgrex, "0.19.0", "f7d50e50cb42e0a185f5b9a6095125a9ab7e4abccfbe2ab820ab9aa92b71dbab", [:mix], [{:db_connection, "~> 2.1", [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", "dba2d2a0a8637defbf2307e8629cb2526388ba7348f67d04ec77a5d6a72ecfae"}, + "postgrex": {:hex, :postgrex, "0.19.1", "73b498508b69aded53907fe48a1fee811be34cc720e69ef4ccd568c8715495ea", [:mix], [{:db_connection, "~> 2.1", [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", "8bac7885a18f381e091ec6caf41bda7bb8c77912bb0e9285212829afe5d8a8f8"}, "stream_data": {:hex, :stream_data, "1.1.1", "fd515ca95619cca83ba08b20f5e814aaf1e5ebff114659dc9731f966c9226246", [:mix], [], "hexpm", "45d0cd46bd06738463fd53f22b70042dbb58c384bb99ef4e7576e7bb7d3b8c8c"}, "telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"}, } From 5818ab0cdb0054317287c08c1ac5fba7c9db9b82 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 17 Aug 2024 04:57:02 +0000 Subject: [PATCH 07/20] Bump ecto_sql from 3.11.3 to 3.12.0 Bumps [ecto_sql](https://github.com/elixir-ecto/ecto_sql) from 3.11.3 to 3.12.0. - [Changelog](https://github.com/elixir-ecto/ecto_sql/blob/master/CHANGELOG.md) - [Commits](https://github.com/elixir-ecto/ecto_sql/compare/v3.11.3...v3.12.0) --- updated-dependencies: - dependency-name: ecto_sql dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- mix.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mix.lock b/mix.lock index 6d9f54e6..de98ded0 100644 --- a/mix.lock +++ b/mix.lock @@ -5,8 +5,8 @@ "decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"}, "dialyxir": {:hex, :dialyxir, "1.4.3", "edd0124f358f0b9e95bfe53a9fcf806d615d8f838e2202a9f430d59566b6b53b", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "bf2cfb75cd5c5006bec30141b131663299c661a864ec7fbbc72dfa557487a986"}, "earmark_parser": {:hex, :earmark_parser, "1.4.41", "ab34711c9dc6212dda44fcd20ecb87ac3f3fce6f0ca2f28d4a00e4154f8cd599", [:mix], [], "hexpm", "a81a04c7e34b6617c2792e291b5a2e57ab316365c2644ddc553bb9ed863ebefa"}, - "ecto": {:hex, :ecto, "3.11.2", "e1d26be989db350a633667c5cda9c3d115ae779b66da567c68c80cfb26a8c9ee", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3c38bca2c6f8d8023f2145326cc8a80100c3ffe4dcbd9842ff867f7fc6156c65"}, - "ecto_sql": {:hex, :ecto_sql, "3.11.3", "4eb7348ff8101fbc4e6bbc5a4404a24fecbe73a3372d16569526b0cf34ebc195", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.11.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.6", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.16 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "e5f36e3d736b99c7fee3e631333b8394ade4bafe9d96d35669fca2d81c2be928"}, + "ecto": {:hex, :ecto, "3.12.1", "626765f7066589de6fa09e0876a253ff60c3d00870dd3a1cd696e2ba67bfceea", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "df0045ab9d87be947228e05a8d153f3e06e0d05ab10c3b3cc557d2f7243d1940"}, + "ecto_sql": {:hex, :ecto_sql, "3.12.0", "73cea17edfa54bde76ee8561b30d29ea08f630959685006d9c6e7d1e59113b7d", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.12", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.7", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.19 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "dc9e4d206f274f3947e96142a8fdc5f69a2a6a9abb4649ef5c882323b6d512f0"}, "erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"}, "ex_doc": {:hex, :ex_doc, "0.34.2", "13eedf3844ccdce25cfd837b99bea9ad92c4e511233199440488d217c92571e8", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "5ce5f16b41208a50106afed3de6a2ed34f4acfd65715b82a0b84b49d995f95c1"}, "ex_machina": {:hex, :ex_machina, "2.8.0", "a0e847b5712065055ec3255840e2c78ef9366634d62390839d4880483be38abe", [:mix], [{:ecto, "~> 2.2 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: true]}, {:ecto_sql, "~> 3.0", [hex: :ecto_sql, repo: "hexpm", optional: true]}], "hexpm", "79fe1a9c64c0c1c1fab6c4fa5d871682cb90de5885320c187d117004627a7729"}, From 6945b626f5136012e23bb0e3917c23bdd8b5a72f Mon Sep 17 00:00:00 2001 From: martosaur Date: Sat, 17 Aug 2024 11:21:44 -0700 Subject: [PATCH 08/20] Use Ecto.ParameterizedType.init/2 to support Ecto 3.12 --- lib/flop/schema.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/flop/schema.ex b/lib/flop/schema.ex index 938afd88..df5b4856 100644 --- a/lib/flop/schema.ex +++ b/lib/flop/schema.ex @@ -970,7 +970,7 @@ defimpl Flop.Schema, for: Any do end %{ecto_type: {:ecto_enum, values}} -> - type = {:parameterized, Ecto.Enum, Ecto.Enum.init(values: values)} + type = Ecto.ParameterizedType.init(Ecto.Enum, values: values) field_info = %{field_info | ecto_type: type} quote do From b0939f7694a6b12bee25738624ddd066f610bcb4 Mon Sep 17 00:00:00 2001 From: woylie <13847569+woylie@users.noreply.github.com> Date: Sun, 18 Aug 2024 10:11:12 +0900 Subject: [PATCH 09/20] update dependencies --- mix.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mix.lock b/mix.lock index de98ded0..5d896f04 100644 --- a/mix.lock +++ b/mix.lock @@ -7,16 +7,16 @@ "earmark_parser": {:hex, :earmark_parser, "1.4.41", "ab34711c9dc6212dda44fcd20ecb87ac3f3fce6f0ca2f28d4a00e4154f8cd599", [:mix], [], "hexpm", "a81a04c7e34b6617c2792e291b5a2e57ab316365c2644ddc553bb9ed863ebefa"}, "ecto": {:hex, :ecto, "3.12.1", "626765f7066589de6fa09e0876a253ff60c3d00870dd3a1cd696e2ba67bfceea", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "df0045ab9d87be947228e05a8d153f3e06e0d05ab10c3b3cc557d2f7243d1940"}, "ecto_sql": {:hex, :ecto_sql, "3.12.0", "73cea17edfa54bde76ee8561b30d29ea08f630959685006d9c6e7d1e59113b7d", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.12", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.7", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.19 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "dc9e4d206f274f3947e96142a8fdc5f69a2a6a9abb4649ef5c882323b6d512f0"}, - "erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"}, + "erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"}, "ex_doc": {:hex, :ex_doc, "0.34.2", "13eedf3844ccdce25cfd837b99bea9ad92c4e511233199440488d217c92571e8", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "5ce5f16b41208a50106afed3de6a2ed34f4acfd65715b82a0b84b49d995f95c1"}, "ex_machina": {:hex, :ex_machina, "2.8.0", "a0e847b5712065055ec3255840e2c78ef9366634d62390839d4880483be38abe", [:mix], [{:ecto, "~> 2.2 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: true]}, {:ecto_sql, "~> 3.0", [hex: :ecto_sql, repo: "hexpm", optional: true]}], "hexpm", "79fe1a9c64c0c1c1fab6c4fa5d871682cb90de5885320c187d117004627a7729"}, "excoveralls": {:hex, :excoveralls, "0.18.2", "86efd87a0676a3198ff50b8c77620ea2f445e7d414afa9ec6c4ba84c9f8bdcc2", [:mix], [{:castore, "~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "230262c418f0de64077626a498bd4fdf1126d5c2559bb0e6b43deac3005225a4"}, - "file_system": {:hex, :file_system, "1.0.0", "b689cc7dcee665f774de94b5a832e578bd7963c8e637ef940cd44327db7de2cd", [:mix], [], "hexpm", "6752092d66aec5a10e662aefeed8ddb9531d79db0bc145bb8c40325ca1d8536d"}, + "file_system": {:hex, :file_system, "1.0.1", "79e8ceaddb0416f8b8cd02a0127bdbababe7bf4a23d2a395b983c1f8b3f73edd", [:mix], [], "hexpm", "4414d1f38863ddf9120720cd976fce5bdde8e91d8283353f0e31850fa89feb9e"}, "jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"}, "makeup": {:hex, :makeup, "1.1.2", "9ba8837913bdf757787e71c1581c21f9d2455f4dd04cfca785c70bbfff1a76a3", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cce1566b81fbcbd21eca8ffe808f33b221f9eee2cbc7a1706fc3da9ff18e6cac"}, "makeup_diff": {:hex, :makeup_diff, "0.1.0", "5be352b6aa6f07fa6a236e3efd7ba689a03f28fb5d35b7a0fa0a1e4a64f6d8bb", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "186bad5bb433a8afeb16b01423950e440072284a4103034ca899180343b9b4ac"}, "makeup_elixir": {:hex, :makeup_elixir, "0.16.2", "627e84b8e8bf22e60a2579dad15067c755531fea049ae26ef1020cad58fe9578", [: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", "41193978704763f6bbe6cc2758b84909e62984c7752b3784bd3c218bb341706b"}, - "makeup_erlang": {:hex, :makeup_erlang, "1.0.0", "6f0eff9c9c489f26b69b61440bf1b238d95badae49adac77973cbacae87e3c2e", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "ea7a9307de9d1548d2a72d299058d1fd2339e3d398560a0e46c27dab4891e4d2"}, + "makeup_erlang": {:hex, :makeup_erlang, "1.0.1", "c7f58c120b2b5aa5fd80d540a89fdf866ed42f1f3994e4fe189abebeab610839", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "8a89a1eeccc2d798d6ea15496a6e4870b75e014d1af514b1b71fa33134f57814"}, "nimble_options": {:hex, :nimble_options, "1.1.1", "e3a492d54d85fc3fd7c5baf411d9d2852922f66e69476317787a7b2bb000a61b", [:mix], [], "hexpm", "821b2470ca9442c4b6984882fe9bb0389371b8ddec4d45a9504f00a66f650b44"}, "nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"}, "postgrex": {:hex, :postgrex, "0.19.1", "73b498508b69aded53907fe48a1fee811be34cc720e69ef4ccd568c8715495ea", [:mix], [{:db_connection, "~> 2.1", [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", "8bac7885a18f381e091ec6caf41bda7bb8c77912bb0e9285212829afe5d8a8f8"}, From 8e6f8f0b64ce01c74365eaa3a886ac7a30e9233a Mon Sep 17 00:00:00 2001 From: woylie <13847569+woylie@users.noreply.github.com> Date: Sun, 18 Aug 2024 10:17:35 +0900 Subject: [PATCH 10/20] update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad3e0253..ed788334 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,11 @@ - The previously deprecated function `Flop.Schema.field_type/2` was removed in favor of `Flop.Schema.field_info/2`. +### Fixed + +- Fixed a compatibility issue with Ecto 3.12 related to the initialization of + the `Ecto.Enum` type. + ### Upgrade Guide Replace the tuple syntax for join fields with a keyword list. From 051526e8d01e979a16f28c35e6a2b86b81012a07 Mon Sep 17 00:00:00 2001 From: woylie <13847569+woylie@users.noreply.github.com> Date: Sun, 18 Aug 2024 10:18:44 +0900 Subject: [PATCH 11/20] bump version --- CHANGELOG.md | 2 ++ README.md | 2 +- mix.exs | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed788334..fc36f6bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## [0.26.0] - 2024-08-18 + ### Removed - The previously deprecated tuple syntax for defining join fields has been diff --git a/README.md b/README.md index f9a8d999..13f30972 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ file: ```elixir def deps do [ - {:flop, "~> 0.25.0"} + {:flop, "~> 0.26.0"} ] end ``` diff --git a/mix.exs b/mix.exs index 4761931b..a23a3d7c 100644 --- a/mix.exs +++ b/mix.exs @@ -2,7 +2,7 @@ defmodule Flop.MixProject do use Mix.Project @source_url "https://github.com/woylie/flop" - @version "0.25.0" + @version "0.26.0" def project do [ From 6280423c26d6f2324d18ee2a334d5ce68476a0b8 Mon Sep 17 00:00:00 2001 From: martosaur Date: Sun, 18 Aug 2024 11:06:10 -0700 Subject: [PATCH 12/20] Change docs and tests to use new style parameterized types --- lib/flop/filter.ex | 4 ++-- lib/flop/schema.ex | 4 ++-- test/flop/filter_test.exs | 2 +- test/flop/validation_test.exs | 18 ++++++++++++++++++ test/support/owner.ex | 13 ++++++++++++- 5 files changed, 35 insertions(+), 6 deletions(-) diff --git a/lib/flop/filter.ex b/lib/flop/filter.ex index 925b165d..04970da3 100644 --- a/lib/flop/filter.ex +++ b/lib/flop/filter.ex @@ -195,7 +195,7 @@ defmodule Flop.Filter do end defp expand_type({:ecto_enum, values}) do - {:parameterized, Ecto.Enum, Ecto.Enum.init(values: values)} + Ecto.ParameterizedType.init(Ecto.Enum, values: values) end defp expand_type(type), do: type @@ -348,7 +348,7 @@ defmodule Flop.Filter do [:==, :!=, :empty, :not_empty, :<=, :<, :>=, :>, :in, :not_in] end - def allowed_operators({:parameterized, Ecto.Enum, _}) do + def allowed_operators({:parameterized, {Ecto.Enum, _}}) do [ :==, :!=, diff --git a/lib/flop/schema.ex b/lib/flop/schema.ex index df5b4856..6a468046 100644 --- a/lib/flop/schema.ex +++ b/lib/flop/schema.ex @@ -489,7 +489,7 @@ defprotocol Flop.Schema do For parameterized types, use the following syntax: - - `ecto_type: {:parameterized, Ecto.Enum, Ecto.Enum.init(values: [:one, :two])}` + - `ecto_type: Ecto.ParameterizedType.init(Ecto.Enum, values: [:one, :two])` If you're working with `Ecto.Enum` types, you can use a more convenient syntax: @@ -613,7 +613,7 @@ defprotocol Flop.Schema do - `:string` - `:integer` - `Ecto.UUID` - - `{:parameterized, Ecto.Enum, Ecto.Enum.init(values: [:one, :two])}` + - `{:parameterized, {Ecto.Enum, Ecto.Enum.init(values: [:one, :two])}}` Or reference a schema field: diff --git a/test/flop/filter_test.exs b/test/flop/filter_test.exs index 0ab88e22..c00b35f5 100644 --- a/test/flop/filter_test.exs +++ b/test/flop/filter_test.exs @@ -36,7 +36,7 @@ defmodule Flop.FilterTest do :naive_datetime_usec, :utc_datetime, :utc_datetime_usec, - {:parameterized, Ecto.Enum, type: :string} + {:parameterized, {Ecto.Enum, %{type: :string}}} ] for type <- types do diff --git a/test/flop/validation_test.exs b/test/flop/validation_test.exs index fec0b1c4..128b3188 100644 --- a/test/flop/validation_test.exs +++ b/test/flop/validation_test.exs @@ -1050,5 +1050,23 @@ defmodule Flop.ValidationTest do assert {:error, changeset} = validate(params, for: Owner) assert [%{value: ["is invalid"]}] = errors_on(changeset)[:filters] end + + test "casts filter values as ecto enums when using parameterized type" do + field = :pet_mood_as_parameterized_type + + params = %{filters: [%{field: field, op: :==, value: "happy"}]} + assert %{filters: [%{value: :happy}]} = validate!(params, for: Owner) + + params = %{filters: [%{field: field, op: :==, value: :happy}]} + assert %{filters: [%{value: :happy}]} = validate!(params, for: Owner) + + params = %{filters: [%{field: field, op: :==, value: "joyful"}]} + assert {:error, changeset} = validate(params, for: Owner) + assert [%{value: ["is invalid"]}] = errors_on(changeset)[:filters] + + params = %{filters: [%{field: field, op: :==, value: :joyful}]} + assert {:error, changeset} = validate(params, for: Owner) + assert [%{value: ["is invalid"]}] = errors_on(changeset)[:filters] + end end end diff --git a/test/support/owner.ex b/test/support/owner.ex index 7aff3431..36e32745 100644 --- a/test/support/owner.ex +++ b/test/support/owner.ex @@ -8,7 +8,12 @@ defmodule MyApp.Owner do @derive { Flop.Schema, - filterable: [:name, :pet_mood_as_reference, :pet_mood_as_enum], + filterable: [ + :name, + :pet_mood_as_reference, + :pet_mood_as_enum, + :pet_mood_as_parameterized_type + ], sortable: [:name, :age], join_fields: [ pet_age: [ @@ -24,6 +29,12 @@ defmodule MyApp.Owner do binding: :pets, field: :mood, ecto_type: {:ecto_enum, [:happy, :playful]} + ], + pet_mood_as_parameterized_type: [ + binding: :pets, + field: :mood, + ecto_type: + Ecto.ParameterizedType.init(Ecto.Enum, values: [:happy, :playful]) ] ], compound_fields: [age_and_pet_age: [:age, :pet_age]], From ef211b71636fc2a1f1a0d1d4909307b7be47477a Mon Sep 17 00:00:00 2001 From: woylie <13847569+woylie@users.noreply.github.com> Date: Mon, 19 Aug 2024 09:25:26 +0900 Subject: [PATCH 13/20] fix coveralls stop comments --- lib/flop/custom_types/any.ex | 2 +- lib/flop/custom_types/existing_atom.ex | 2 +- lib/flop/custom_types/like.ex | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/flop/custom_types/any.ex b/lib/flop/custom_types/any.ex index 4ef1df3f..1e137f89 100644 --- a/lib/flop/custom_types/any.ex +++ b/lib/flop/custom_types/any.ex @@ -17,5 +17,5 @@ defmodule Flop.CustomTypes.Any do def type, do: :string def load(_), do: :error def dump(_), do: :error - # coveralls-ignore-end + # coveralls-ignore-stop end diff --git a/lib/flop/custom_types/existing_atom.ex b/lib/flop/custom_types/existing_atom.ex index d911f1aa..0992d637 100644 --- a/lib/flop/custom_types/existing_atom.ex +++ b/lib/flop/custom_types/existing_atom.ex @@ -20,5 +20,5 @@ defmodule Flop.CustomTypes.ExistingAtom do def type, do: :string def load(_), do: :error def dump(_), do: :error - # coveralls-ignore-end + # coveralls-ignore-stop end diff --git a/lib/flop/custom_types/like.ex b/lib/flop/custom_types/like.ex index c0500157..cef9d7c6 100644 --- a/lib/flop/custom_types/like.ex +++ b/lib/flop/custom_types/like.ex @@ -24,5 +24,5 @@ defmodule Flop.CustomTypes.Like do def type, do: :string def load(_), do: :error def dump(_), do: :error - # coveralls-ignore-end + # coveralls-ignore-stop end From 1c1ef1e39b55f4d34bc13cc73a3622b9a68fbbb4 Mon Sep 17 00:00:00 2001 From: woylie <13847569+woylie@users.noreply.github.com> Date: Mon, 19 Aug 2024 09:35:52 +0900 Subject: [PATCH 14/20] fix type expansion in allowed_operators/1 --- lib/flop/filter.ex | 43 ++++++++++++++++++++++----------------- test/flop/filter_test.exs | 13 +++++++++--- 2 files changed, 34 insertions(+), 22 deletions(-) diff --git a/lib/flop/filter.ex b/lib/flop/filter.ex index 04970da3..85310b21 100644 --- a/lib/flop/filter.ex +++ b/lib/flop/filter.ex @@ -275,14 +275,19 @@ defmodule Flop.Filter do end def allowed_operators(%FieldInfo{ecto_type: ecto_type}) do - ecto_type |> expand_type() |> allowed_operators() + ecto_type |> expand_type() |> get_allowed_operators() end - def allowed_operators(type) when type in [:decimal, :float, :id, :integer] do + def allowed_operators(type) do + type |> expand_type() |> get_allowed_operators() + end + + defp get_allowed_operators(type) + when type in [:decimal, :float, :id, :integer] do [:==, :!=, :empty, :not_empty, :<=, :<, :>=, :>, :in, :not_in] end - def allowed_operators(type) when type in [:binary_id, :string] do + defp get_allowed_operators(type) when type in [:binary_id, :string] do [ :==, :!=, @@ -306,11 +311,11 @@ defmodule Flop.Filter do ] end - def allowed_operators(:boolean) do + defp get_allowed_operators(:boolean) do [:==, :!=, :=~, :empty, :not_empty] end - def allowed_operators({:array, _}) do + defp get_allowed_operators({:array, _}) do [ :==, :!=, @@ -327,28 +332,28 @@ defmodule Flop.Filter do ] end - def allowed_operators({:map, _}) do + defp get_allowed_operators({:map, _}) do [:==, :!=, :empty, :not_empty, :in, :not_in] end - def allowed_operators(:map) do + defp get_allowed_operators(:map) do [:==, :!=, :empty, :not_empty, :in, :not_in] end - def allowed_operators(type) - when type in [ - :date, - :time, - :time_usec, - :naive_datetime, - :naive_datetime_usec, - :utc_datetime, - :utc_datetime_usec - ] do + defp get_allowed_operators(type) + when type in [ + :date, + :time, + :time_usec, + :naive_datetime, + :naive_datetime_usec, + :utc_datetime, + :utc_datetime_usec + ] do [:==, :!=, :empty, :not_empty, :<=, :<, :>=, :>, :in, :not_in] end - def allowed_operators({:parameterized, {Ecto.Enum, _}}) do + defp get_allowed_operators({:parameterized, {Ecto.Enum, _}}) do [ :==, :!=, @@ -363,7 +368,7 @@ defmodule Flop.Filter do ] end - def allowed_operators(_) do + defp get_allowed_operators(_) do [ :==, :!=, diff --git a/test/flop/filter_test.exs b/test/flop/filter_test.exs index c00b35f5..def48142 100644 --- a/test/flop/filter_test.exs +++ b/test/flop/filter_test.exs @@ -16,7 +16,7 @@ defmodule Flop.FilterTest do end describe "allowed_operators/1" do - test "returns a list of operators for each native Ecto type" do + test "returns a list of operators for each Ecto type" do types = [ :id, :binary_id, @@ -36,12 +36,19 @@ defmodule Flop.FilterTest do :naive_datetime_usec, :utc_datetime, :utc_datetime_usec, - {:parameterized, {Ecto.Enum, %{type: :string}}} + {:parameterized, {Ecto.Enum, %{type: :string}}}, + {:ecto_enum, [:one, :two]}, + {:from_schema, MyApp.Pet, :mood} ] for type <- types do - assert [op | _] = Filter.allowed_operators(type) + assert [op | _] = ops_for_type = Filter.allowed_operators(type) assert is_atom(op) + + ops_for_field = + Filter.allowed_operators(%Flop.FieldInfo{ecto_type: type}) + + assert ops_for_type == ops_for_field end end From d2e2a587b8459b54b29f65489ee9238265185a8a Mon Sep 17 00:00:00 2001 From: woylie <13847569+woylie@users.noreply.github.com> Date: Mon, 19 Aug 2024 09:50:06 +0900 Subject: [PATCH 15/20] add test for ecto enum operators --- lib/flop/filter.ex | 16 ++++++++++++++++ test/flop/filter_test.exs | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/lib/flop/filter.ex b/lib/flop/filter.ex index 85310b21..e7e7bc92 100644 --- a/lib/flop/filter.ex +++ b/lib/flop/filter.ex @@ -368,6 +368,22 @@ defmodule Flop.Filter do ] end + # for backward compatibility with Ecto < 3.12.0 + defp get_allowed_operators({:parameterized, Ecto.Enum, _}) do + [ + :==, + :!=, + :empty, + :not_empty, + :<=, + :<, + :>=, + :>, + :in, + :not_in + ] + end + defp get_allowed_operators(_) do [ :==, diff --git a/test/flop/filter_test.exs b/test/flop/filter_test.exs index def48142..1117d241 100644 --- a/test/flop/filter_test.exs +++ b/test/flop/filter_test.exs @@ -52,6 +52,41 @@ defmodule Flop.FilterTest do end end + test "returns list of operators for enum" do + types = [ + # by internal representation Ecto < 3.12.0 + {:parameterized, Ecto.Enum, %{type: :string}}, + # by internal representation Ecto >= 3.12.0 + {:parameterized, {Ecto.Enum, %{type: :string}}}, + # same with init function + Ecto.ParameterizedType.init(Ecto.Enum, values: [:one, :two]), + # by convenience format + {:ecto_enum, [:one, :two]}, + # by reference + {:from_schema, MyApp.Pet, :mood} + ] + + expected_ops = [ + :==, + :!=, + :empty, + :not_empty, + :<=, + :<, + :>=, + :>, + :in, + :not_in + ] + + for type <- types do + assert Filter.allowed_operators(type) == expected_ops + + assert Filter.allowed_operators(%Flop.FieldInfo{ecto_type: type}) == + expected_ops + end + end + test "returns a list of operators for unknown types" do assert [op | _] = Filter.allowed_operators(:unicorn) assert is_atom(op) From aaec1359435527da9c3a9f840094b2d9a4626a1e Mon Sep 17 00:00:00 2001 From: woylie <13847569+woylie@users.noreply.github.com> Date: Mon, 19 Aug 2024 10:17:41 +0900 Subject: [PATCH 16/20] bump version --- CHANGELOG.md | 26 ++++++++++++++++++++++++++ README.md | 2 +- mix.exs | 2 +- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc36f6bd..fa2e90d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,32 @@ ## Unreleased +## [0.26.1] - 2024-08-19 + +### Fixed + +- Fixed allowed operators for `Ecto.Enum` fields in Ecto 3.12. +- Fixed type expansion when passing values with shortened syntax to + `Flop.Filter.expand_type/1`. +- Updated documentation example for setting `ecto_type` to parameterized types. + +### Upgrade Guide + +If you pass a parameterized type as `ecto_type` option, ensure that you use +`Ecto.ParameterizedType.init/2` instead of using the tuple representation as +suggested in the documentation before. The tuple representation is an internal +representation of Ecto and was changed in Ecto 3.12. + +```diff +[ +- ecto_type: {:parameterized, Ecto.Enum, Ecto.Enum.init(values: [:one, :two])} ++ ecto_type: Ecto.ParameterizedType.init(Ecto.Enum, values: [:one, :two]) +] +``` + +For `Ecto.Enum` specifically, you can also use the short syntax +`{:ecto_enum, [:one, :two]}`. + ## [0.26.0] - 2024-08-18 ### Removed diff --git a/README.md b/README.md index 13f30972..2b7a410b 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ file: ```elixir def deps do [ - {:flop, "~> 0.26.0"} + {:flop, "~> 0.26.1"} ] end ``` diff --git a/mix.exs b/mix.exs index a23a3d7c..542e5d9e 100644 --- a/mix.exs +++ b/mix.exs @@ -2,7 +2,7 @@ defmodule Flop.MixProject do use Mix.Project @source_url "https://github.com/woylie/flop" - @version "0.26.0" + @version "0.26.1" def project do [ From dacfe888b084b9a10b21cd489cab166ad29579a1 Mon Sep 17 00:00:00 2001 From: woylie <13847569+woylie@users.noreply.github.com> Date: Mon, 19 Aug 2024 10:25:28 +0900 Subject: [PATCH 17/20] update doc --- lib/flop/schema.ex | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/flop/schema.ex b/lib/flop/schema.ex index 6a468046..b860c07d 100644 --- a/lib/flop/schema.ex +++ b/lib/flop/schema.ex @@ -613,7 +613,7 @@ defprotocol Flop.Schema do - `:string` - `:integer` - `Ecto.UUID` - - `{:parameterized, {Ecto.Enum, Ecto.Enum.init(values: [:one, :two])}}` + - The result of `Ecto.ParameterizedType.init/2`. Or reference a schema field: @@ -621,8 +621,7 @@ defprotocol Flop.Schema do Or build an adhoc Ecto.Enum: - - `{:ecto_enum, [:one, :two]}` (This has the same effect as the `:parameterized` - example above.) + - `{:ecto_enum, [:one, :two]}` - `{:ecto_enum, [one: 1, two: 2]}` Note that if you make an `Ecto.Enum` type this way, the filter value will be From e661812f0e09b17554da18674299cae666043fa1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 31 Aug 2024 02:22:29 +0000 Subject: [PATCH 18/20] Bump ecto from 3.12.1 to 3.12.2 Bumps [ecto](https://github.com/elixir-ecto/ecto) from 3.12.1 to 3.12.2. - [Release notes](https://github.com/elixir-ecto/ecto/releases) - [Changelog](https://github.com/elixir-ecto/ecto/blob/master/CHANGELOG.md) - [Commits](https://github.com/elixir-ecto/ecto/compare/v3.12.1...v3.12.2) --- updated-dependencies: - dependency-name: ecto dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- mix.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mix.lock b/mix.lock index 5d896f04..5c5a68b2 100644 --- a/mix.lock +++ b/mix.lock @@ -5,7 +5,7 @@ "decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"}, "dialyxir": {:hex, :dialyxir, "1.4.3", "edd0124f358f0b9e95bfe53a9fcf806d615d8f838e2202a9f430d59566b6b53b", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "bf2cfb75cd5c5006bec30141b131663299c661a864ec7fbbc72dfa557487a986"}, "earmark_parser": {:hex, :earmark_parser, "1.4.41", "ab34711c9dc6212dda44fcd20ecb87ac3f3fce6f0ca2f28d4a00e4154f8cd599", [:mix], [], "hexpm", "a81a04c7e34b6617c2792e291b5a2e57ab316365c2644ddc553bb9ed863ebefa"}, - "ecto": {:hex, :ecto, "3.12.1", "626765f7066589de6fa09e0876a253ff60c3d00870dd3a1cd696e2ba67bfceea", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "df0045ab9d87be947228e05a8d153f3e06e0d05ab10c3b3cc557d2f7243d1940"}, + "ecto": {:hex, :ecto, "3.12.2", "bae2094f038e9664ce5f089e5f3b6132a535d8b018bd280a485c2f33df5c0ce1", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "492e67c70f3a71c6afe80d946d3ced52ecc57c53c9829791bfff1830ff5a1f0c"}, "ecto_sql": {:hex, :ecto_sql, "3.12.0", "73cea17edfa54bde76ee8561b30d29ea08f630959685006d9c6e7d1e59113b7d", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.12", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.7", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.19 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "dc9e4d206f274f3947e96142a8fdc5f69a2a6a9abb4649ef5c882323b6d512f0"}, "erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"}, "ex_doc": {:hex, :ex_doc, "0.34.2", "13eedf3844ccdce25cfd837b99bea9ad92c4e511233199440488d217c92571e8", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "5ce5f16b41208a50106afed3de6a2ed34f4acfd65715b82a0b84b49d995f95c1"}, @@ -21,5 +21,5 @@ "nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"}, "postgrex": {:hex, :postgrex, "0.19.1", "73b498508b69aded53907fe48a1fee811be34cc720e69ef4ccd568c8715495ea", [:mix], [{:db_connection, "~> 2.1", [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", "8bac7885a18f381e091ec6caf41bda7bb8c77912bb0e9285212829afe5d8a8f8"}, "stream_data": {:hex, :stream_data, "1.1.1", "fd515ca95619cca83ba08b20f5e814aaf1e5ebff114659dc9731f966c9226246", [:mix], [], "hexpm", "45d0cd46bd06738463fd53f22b70042dbb58c384bb99ef4e7576e7bb7d3b8c8c"}, - "telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"}, + "telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"}, } From 8849f17cf45c397ae14800ad57009acfa808202d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 7 Sep 2024 02:21:38 +0000 Subject: [PATCH 19/20] Bump excoveralls from 0.18.2 to 0.18.3 Bumps [excoveralls](https://github.com/parroty/excoveralls) from 0.18.2 to 0.18.3. - [Release notes](https://github.com/parroty/excoveralls/releases) - [Changelog](https://github.com/parroty/excoveralls/blob/master/CHANGELOG.md) - [Commits](https://github.com/parroty/excoveralls/compare/v0.18.2...v0.18.3) --- updated-dependencies: - dependency-name: excoveralls dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- mix.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mix.lock b/mix.lock index 5c5a68b2..b919654c 100644 --- a/mix.lock +++ b/mix.lock @@ -10,7 +10,7 @@ "erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"}, "ex_doc": {:hex, :ex_doc, "0.34.2", "13eedf3844ccdce25cfd837b99bea9ad92c4e511233199440488d217c92571e8", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "5ce5f16b41208a50106afed3de6a2ed34f4acfd65715b82a0b84b49d995f95c1"}, "ex_machina": {:hex, :ex_machina, "2.8.0", "a0e847b5712065055ec3255840e2c78ef9366634d62390839d4880483be38abe", [:mix], [{:ecto, "~> 2.2 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: true]}, {:ecto_sql, "~> 3.0", [hex: :ecto_sql, repo: "hexpm", optional: true]}], "hexpm", "79fe1a9c64c0c1c1fab6c4fa5d871682cb90de5885320c187d117004627a7729"}, - "excoveralls": {:hex, :excoveralls, "0.18.2", "86efd87a0676a3198ff50b8c77620ea2f445e7d414afa9ec6c4ba84c9f8bdcc2", [:mix], [{:castore, "~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "230262c418f0de64077626a498bd4fdf1126d5c2559bb0e6b43deac3005225a4"}, + "excoveralls": {:hex, :excoveralls, "0.18.3", "bca47a24d69a3179951f51f1db6d3ed63bca9017f476fe520eb78602d45f7756", [:mix], [{:castore, "~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "746f404fcd09d5029f1b211739afb8fb8575d775b21f6a3908e7ce3e640724c6"}, "file_system": {:hex, :file_system, "1.0.1", "79e8ceaddb0416f8b8cd02a0127bdbababe7bf4a23d2a395b983c1f8b3f73edd", [:mix], [], "hexpm", "4414d1f38863ddf9120720cd976fce5bdde8e91d8283353f0e31850fa89feb9e"}, "jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"}, "makeup": {:hex, :makeup, "1.1.2", "9ba8837913bdf757787e71c1581c21f9d2455f4dd04cfca785c70bbfff1a76a3", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cce1566b81fbcbd21eca8ffe808f33b221f9eee2cbc7a1706fc3da9ff18e6cac"}, From ed56444d73d0b80954d0a86d7dcf809427b7b45a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 7 Sep 2024 02:28:08 +0000 Subject: [PATCH 20/20] Bump ecto from 3.12.2 to 3.12.3 Bumps [ecto](https://github.com/elixir-ecto/ecto) from 3.12.2 to 3.12.3. - [Release notes](https://github.com/elixir-ecto/ecto/releases) - [Changelog](https://github.com/elixir-ecto/ecto/blob/master/CHANGELOG.md) - [Commits](https://github.com/elixir-ecto/ecto/compare/v3.12.2...v3.12.3) --- updated-dependencies: - dependency-name: ecto dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- mix.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mix.lock b/mix.lock index b919654c..0a32bc54 100644 --- a/mix.lock +++ b/mix.lock @@ -5,7 +5,7 @@ "decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"}, "dialyxir": {:hex, :dialyxir, "1.4.3", "edd0124f358f0b9e95bfe53a9fcf806d615d8f838e2202a9f430d59566b6b53b", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "bf2cfb75cd5c5006bec30141b131663299c661a864ec7fbbc72dfa557487a986"}, "earmark_parser": {:hex, :earmark_parser, "1.4.41", "ab34711c9dc6212dda44fcd20ecb87ac3f3fce6f0ca2f28d4a00e4154f8cd599", [:mix], [], "hexpm", "a81a04c7e34b6617c2792e291b5a2e57ab316365c2644ddc553bb9ed863ebefa"}, - "ecto": {:hex, :ecto, "3.12.2", "bae2094f038e9664ce5f089e5f3b6132a535d8b018bd280a485c2f33df5c0ce1", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "492e67c70f3a71c6afe80d946d3ced52ecc57c53c9829791bfff1830ff5a1f0c"}, + "ecto": {:hex, :ecto, "3.12.3", "1a9111560731f6c3606924c81c870a68a34c819f6d4f03822f370ea31a582208", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "9efd91506ae722f95e48dc49e70d0cb632ede3b7a23896252a60a14ac6d59165"}, "ecto_sql": {:hex, :ecto_sql, "3.12.0", "73cea17edfa54bde76ee8561b30d29ea08f630959685006d9c6e7d1e59113b7d", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.12", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.7", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.19 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "dc9e4d206f274f3947e96142a8fdc5f69a2a6a9abb4649ef5c882323b6d512f0"}, "erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"}, "ex_doc": {:hex, :ex_doc, "0.34.2", "13eedf3844ccdce25cfd837b99bea9ad92c4e511233199440488d217c92571e8", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "5ce5f16b41208a50106afed3de6a2ed34f4acfd65715b82a0b84b49d995f95c1"},