Skip to content

Commit a70978e

Browse files
committed
Update dependencies
1 parent 24b5452 commit a70978e

File tree

8 files changed

+127
-59
lines changed

8 files changed

+127
-59
lines changed

.github/workflows/ci.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
test:
13+
name: Run tests
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v3
18+
19+
- name: Start services
20+
run: docker compose up -d
21+
22+
- name: Setup Elixir and Erlang versions
23+
uses: erlef/setup-beam@v1
24+
id: setup-elixir
25+
with:
26+
version-type: strict
27+
version-file: .tool-versions
28+
29+
- name: Restore the cache
30+
uses: actions/cache@v3
31+
with:
32+
path: |
33+
deps
34+
_build
35+
dialyzer
36+
key: |
37+
${{ runner.os }}-${{ steps.setup-elixir.outputs.elixir-version }}-${{ steps.setup-elixir.outputs.otp-version }}-mixlockhash-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
38+
restore-keys: |
39+
${{ runner.os }}-${{ steps.setup-elixir.outputs.elixir-version }}-${{ steps.setup-elixir.outputs.otp-version }}-mixlockhash-
40+
41+
- name: Run CI
42+
run: |
43+
mix ci

.tool-versions

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
erlang 27.2
2+
elixir 1.18.0-otp-27

.travis.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

docker-compose.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
services:
2+
postgres:
3+
image: postgres:17-alpine
4+
environment:
5+
POSTGRES_USER: guest
6+
POSTGRES_PASSWORD: guest
7+
POSTGRES_DB: query_test
8+
ports:
9+
- "5432:5432"
10+
healthcheck:
11+
test: [ "CMD-SHELL", "pg_isready -U guest" ]
12+
interval: 5s
13+
timeout: 5s
14+
retries: 10
15+
restart: unless-stopped

lib/query.ex

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -68,24 +68,24 @@ defmodule Query do
6868
@type options :: [option()]
6969

7070
@app_config Application.get_all_env(:query)
71-
@opts_schema %{
72-
page_default: [default: 1, type: :integer],
73-
page_param: [default: "page", type: :binary],
74-
limit_default: [default: 20, type: :integer],
75-
limit_max: [default: 50, type: :integer],
76-
limit_param: [default: "limit", type: :binary],
77-
sort_default: [default: "id", type: :binary],
78-
sort_param: [default: "sort_by", type: :binary],
79-
sort_permitted: [default: [], type: {:list, :binary}],
80-
dir_default: [default: "asc", type: :binary],
81-
dir_param: [default: "dir", type: :binary],
82-
count: [default: true, type: :boolean],
83-
count_limit: [default: :infinite, type: [:atom, :integer]],
84-
count_column: [default: :id, type: :atom],
85-
scope: [required: false, type: [{:tuple, {:atom, :atom}}]],
86-
scope_permitted: [default: [], type: {:list, :binary}],
87-
preloads: [default: [], typee: {:list, :atom}]
88-
}
71+
@opts_schema KeywordValidator.schema!(
72+
page_default: [default: 1, is: :integer],
73+
page_param: [default: "page", is: :binary],
74+
limit_default: [default: 20, is: :integer],
75+
limit_max: [default: 50, is: :integer],
76+
limit_param: [default: "limit", is: :binary],
77+
sort_default: [default: "id", is: :binary],
78+
sort_param: [default: "sort_by", is: :binary],
79+
sort_permitted: [default: [], is: {:list, :binary}],
80+
dir_default: [default: "asc", is: :binary],
81+
dir_param: [default: "dir", is: :binary],
82+
count: [default: true, is: :boolean],
83+
count_limit: [default: :infinite, is: {:one_of, [:atom, :integer]}],
84+
count_column: [default: :id, is: :atom],
85+
scope: [required: false, is: {:tuple, {:atom, :atom}}],
86+
scope_permitted: [default: [], is: {:list, :binary}],
87+
preloads: [default: [], is: {:list, :atom}]
88+
)
8989

9090
@doc """
9191
Fetches data from the given repository based on the params and options given.

mix.exs

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
defmodule Query.Mixfile do
22
use Mix.Project
33

4-
@version "0.5.1"
4+
@version "0.6.0"
55

66
def project do
77
[
88
app: :query,
99
version: @version,
1010
elixir: "~> 1.5",
1111
elixirc_paths: elixirc_paths(Mix.env()),
12+
aliases: aliases(),
13+
preferred_cli_env: preferred_cli_env(),
1214
description: description(),
1315
package: package(),
1416
start_permanent: Mix.env() == :prod,
@@ -23,6 +25,33 @@ defmodule Query.Mixfile do
2325
]
2426
end
2527

28+
# Aliases are shortcuts or tasks specific to the current project.
29+
defp aliases do
30+
[
31+
setup: [
32+
"local.hex --if-missing --force",
33+
"local.rebar --if-missing --force",
34+
"deps.get"
35+
],
36+
ci: [
37+
"setup",
38+
"compile --warnings-as-errors",
39+
"format --check-formatted",
40+
"ecto.drop -r Query.Ecto.Repo",
41+
"ecto.create -r Query.Ecto.Repo",
42+
"ecto.migrate -r Query.Ecto.Repo",
43+
"test"
44+
]
45+
]
46+
end
47+
48+
# Specifies the preferred env for mix commands.
49+
defp preferred_cli_env do
50+
[
51+
ci: :test
52+
]
53+
end
54+
2655
defp description do
2756
"""
2857
Query adds simple tools to aid the use of Ecto in web settings.
@@ -47,10 +76,10 @@ defmodule Query.Mixfile do
4776
# Run "mix help deps" to learn about dependencies.
4877
defp deps do
4978
[
50-
{:ecto, "~> 3.0"},
51-
{:keyword_validator, "~> 1.0"},
52-
{:ecto_sql, "~> 3.0", only: :test},
53-
{:postgrex, "~> 0.14.1", only: :test},
79+
{:ecto, "~> 3.13"},
80+
{:ecto_sql, "~> 3.13", only: :test},
81+
{:keyword_validator, "~> 2.0"},
82+
{:postgrex, "~> 0.19", only: :test},
5483
{:ex_doc, "~> 0.20", only: :dev, runtime: false}
5584
]
5685
end

mix.lock

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
%{
2-
"connection": {:hex, :connection, "1.0.4", "a1cae72211f0eef17705aaededacac3eb30e6625b04a6117c1b2db6ace7d5976", [:mix], [], "hexpm"},
3-
"db_connection": {:hex, :db_connection, "2.0.6", "bde2f85d047969c5b5800cb8f4b3ed6316c8cb11487afedac4aa5f93fd39abfa", [:mix], [{:connection, "~> 1.0.2", [hex: :connection, repo: "hexpm", optional: false]}], "hexpm"},
4-
"decimal": {:hex, :decimal, "1.7.0", "30d6b52c88541f9a66637359ddf85016df9eb266170d53105f02e4a67e00c5aa", [:mix], [], "hexpm"},
5-
"earmark": {:hex, :earmark, "1.3.2", "b840562ea3d67795ffbb5bd88940b1bed0ed9fa32834915125ea7d02e35888a5", [:mix], [], "hexpm"},
6-
"ecto": {:hex, :ecto, "3.1.3", "b3c2ef40b742fa76e2cc1c2fa46965e445d1ea8fd92330d64e0ae84114f53bcf", [:mix], [{:decimal, "~> 1.6", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm"},
7-
"ecto_sql": {:hex, :ecto_sql, "3.1.1", "af2458e7a467d75a6389e1d4ebfb57c328ccc684d6ee52145f7b34e94efb5fc4", [:mix], [{:db_connection, "~> 2.0", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.1.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:mariaex, "~> 0.9.1", [hex: :mariaex, repo: "hexpm", optional: true]}, {:myxql, "~> 0.2.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.14.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm"},
8-
"ex_doc": {:hex, :ex_doc, "0.20.2", "1bd0dfb0304bade58beb77f20f21ee3558cc3c753743ae0ddbb0fd7ba2912331", [:mix], [{:earmark, "~> 1.3", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.10", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm"},
9-
"keyword_validator": {:hex, :keyword_validator, "1.0.0", "a1421d0ae47ff3638b45b695427a00302ca278b869b9d9f9f22d4da5e0f4d660", [:mix], [], "hexpm"},
10-
"makeup": {:hex, :makeup, "0.8.0", "9cf32aea71c7fe0a4b2e9246c2c4978f9070257e5c9ce6d4a28ec450a839b55f", [:mix], [{:nimble_parsec, "~> 0.5.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm"},
11-
"makeup_elixir": {:hex, :makeup_elixir, "0.13.0", "be7a477997dcac2e48a9d695ec730b2d22418292675c75aa2d34ba0909dcdeda", [:mix], [{:makeup, "~> 0.8", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm"},
12-
"nimble_parsec": {:hex, :nimble_parsec, "0.5.0", "90e2eca3d0266e5c53f8fbe0079694740b9c91b6747f2b7e3c5d21966bba8300", [:mix], [], "hexpm"},
2+
"connection": {:hex, :connection, "1.0.4", "a1cae72211f0eef17705aaededacac3eb30e6625b04a6117c1b2db6ace7d5976", [:mix], [], "hexpm", "4a0850c9be22a43af9920a71ab17c051f5f7d45c209e40269a1938832510e4d9"},
3+
"db_connection": {:hex, :db_connection, "2.8.1", "9abdc1e68c34c6163f6fb96a96532272d13ad7ca45262156ae8b7ec6d9dc4bec", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "a61a3d489b239d76f326e03b98794fb8e45168396c925ef25feb405ed09da8fd"},
4+
"decimal": {:hex, :decimal, "2.3.0", "3ad6255aa77b4a3c4f818171b12d237500e63525c2fd056699967a3e7ea20f62", [:mix], [], "hexpm", "a4d66355cb29cb47c3cf30e71329e58361cfcb37c34235ef3bf1d7bf3773aeac"},
5+
"earmark": {:hex, :earmark, "1.3.2", "b840562ea3d67795ffbb5bd88940b1bed0ed9fa32834915125ea7d02e35888a5", [:mix], [], "hexpm", "e3be2bc3ae67781db529b80aa7e7c49904a988596e2dbff897425b48b3581161"},
6+
"ecto": {:hex, :ecto, "3.13.3", "6a983f0917f8bdc7a89e96f2bf013f220503a0da5d8623224ba987515b3f0d80", [: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", "1927db768f53a88843ff25b6ba7946599a8ca8a055f69ad8058a1432a399af94"},
7+
"ecto_sql": {:hex, :ecto_sql, "3.13.2", "a07d2461d84107b3d037097c822ffdd36ed69d1cf7c0f70e12a3d1decf04e2e1", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.13.0", [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", "539274ab0ecf1a0078a6a72ef3465629e4d6018a3028095dc90f60a19c371717"},
8+
"ex_doc": {:hex, :ex_doc, "0.20.2", "1bd0dfb0304bade58beb77f20f21ee3558cc3c753743ae0ddbb0fd7ba2912331", [:mix], [{:earmark, "~> 1.3", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.10", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm", "8e24fc8ff9a50b9f557ff020d6c91a03cded7e59ac3e0eec8a27e771430c7d27"},
9+
"keyword_validator": {:hex, :keyword_validator, "2.1.0", "03dea179912e9ef280f4784affbfecd12957ef578d88b7aea4bbef68b7db3882", [:mix], [], "hexpm", "9c8cff861cadea92d9b9469983ba58bc35d03a2ceb38c39665e401e8668e324f"},
10+
"makeup": {:hex, :makeup, "0.8.0", "9cf32aea71c7fe0a4b2e9246c2c4978f9070257e5c9ce6d4a28ec450a839b55f", [:mix], [{:nimble_parsec, "~> 0.5.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "5fbc8e549aa9afeea2847c0769e3970537ed302f93a23ac612602e805d9d1e7f"},
11+
"makeup_elixir": {:hex, :makeup_elixir, "0.13.0", "be7a477997dcac2e48a9d695ec730b2d22418292675c75aa2d34ba0909dcdeda", [:mix], [{:makeup, "~> 0.8", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "adf0218695e22caeda2820eaba703fa46c91820d53813a2223413da3ef4ba515"},
12+
"nimble_parsec": {:hex, :nimble_parsec, "0.5.0", "90e2eca3d0266e5c53f8fbe0079694740b9c91b6747f2b7e3c5d21966bba8300", [:mix], [], "hexpm", "5c040b8469c1ff1b10093d3186e2e10dbe483cd73d79ec017993fb3985b8a9b3"},
1313
"poolboy": {:hex, :poolboy, "1.5.1", "6b46163901cfd0a1b43d692657ed9d7e599853b3b21b95ae5ae0a777cf9b6ca8", [:rebar], [], "hexpm"},
14-
"postgrex": {:hex, :postgrex, "0.14.2", "6680591bbce28d92f043249205e8b01b36cab9ef2a7911abc43649242e1a3b78", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.0", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm"},
15-
"telemetry": {:hex, :telemetry, "0.4.0", "8339bee3fa8b91cb84d14c2935f8ecf399ccd87301ad6da6b71c09553834b2ab", [:rebar3], [], "hexpm"},
14+
"postgrex": {:hex, :postgrex, "0.21.1", "2c5cc830ec11e7a0067dd4d623c049b3ef807e9507a424985b8dcf921224cd88", [: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", "27d8d21c103c3cc68851b533ff99eef353e6a0ff98dc444ea751de43eb48bdac"},
15+
"telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"},
1616
}

test/support/repo.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ defmodule Query.Ecto.Repo do
99
database: "query_test",
1010
hostname: "localhost",
1111
port: 5432,
12-
username: "postgres",
13-
password: ""
12+
username: "guest",
13+
password: "guest"
1414
)
1515

1616
{:ok, config}

0 commit comments

Comments
 (0)