Skip to content

Commit 0864eab

Browse files
committed
Fix compile warnings and update CI matrix for latest Elixir/OTP
Two unrelated maintenance changes: 1. Fix redundant execute_ddl/1 clauses in connection.ex The file had two duplicate sets of execute_ddl/1 clauses: a newer set (with @impl true markers) and an older set of duplicates. The newer Ecto type system flags the duplicates as redundant warnings that fail the build with --warnings-as-errors. Remove the older duplicate clauses, keeping the first (correct) set intact. Also remove one redundant {:drop_if_exists, %Index{concurrently: true}} clause that is fully covered by the wildcard {:_, %Index{concurrently: true}} clause which raises the same ArgumentError. Preserves the original non-duplicate clauses for Constraint and Index rename operations that only existed in the second set. 2. Update CI matrix to Elixir 1.18-1.20 / OTP 27-29 Per the official Elixir/OTP compatibility table (June 2026): - Elixir 1.20: OTP 27-29 (latest) - Elixir 1.19: OTP 26-28 - Elixir 1.18: OTP 25-27 Drops Elixir 1.17 and OTP 26 (both EOL), adds Elixir 1.20 and OTP 29 (latest). Excludes 3 combinations that fall outside the official support ranges. Lint job runs on the latest (1.20+29). 6 valid combinations remain, all within official support ranges.
1 parent 7d21400 commit 0864eab

2 files changed

Lines changed: 9 additions & 107 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ jobs:
1515
strategy:
1616
matrix:
1717
os: ["ubuntu-latest"]
18-
elixir: ["1.19"]
19-
otp: ["28"]
18+
elixir: ["1.20"]
19+
otp: ["29"]
2020
steps:
2121
- uses: actions/checkout@v6
2222
- uses: erlef/setup-beam@v1
@@ -41,11 +41,15 @@ jobs:
4141
fail-fast: false
4242
matrix:
4343
os: ["ubuntu-latest"]
44-
elixir: ["1.19", "1.18", "1.17"]
45-
otp: ["28", "27", "26"]
44+
elixir: ["1.20", "1.19", "1.18"]
45+
otp: ["29", "28", "27"]
4646
exclude:
47-
- elixir: "1.17"
47+
- elixir: "1.18"
4848
otp: "28"
49+
- elixir: "1.18"
50+
otp: "29"
51+
- elixir: "1.19"
52+
otp: "29"
4953
steps:
5054
- uses: actions/checkout@v6
5155
- uses: erlef/setup-beam@v1

lib/ecto/adapters/sqlite3/connection.ex

Lines changed: 0 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -550,11 +550,6 @@ defmodule Ecto.Adapters.SQLite3.Connection do
550550
execute_ddl({:drop, index})
551551
end
552552

553-
@impl true
554-
def execute_ddl({:drop_if_exists, %Index{concurrently: true}}) do
555-
raise ArgumentError, "`concurrently` is not supported with SQLite3"
556-
end
557-
558553
@impl true
559554
def execute_ddl({:drop_if_exists, %Index{} = index}) do
560555
[
@@ -604,77 +599,10 @@ defmodule Ecto.Adapters.SQLite3.Connection do
604599
raise ArgumentError, "SQLite3 adapter does not support keyword lists in execute"
605600
end
606601

607-
@impl true
608-
def execute_ddl({:create, %Index{} = index}) do
609-
fields = Enum.map_intersperse(index.columns, ", ", &index_expr/1)
610-
611-
[
612-
[
613-
"CREATE ",
614-
if_do(index.unique, "UNIQUE "),
615-
"INDEX",
616-
?\s,
617-
quote_name(index.name),
618-
" ON ",
619-
quote_table(index.prefix, index.table),
620-
" (",
621-
fields,
622-
?),
623-
if_do(index.where, [" WHERE ", to_string(index.where)])
624-
]
625-
]
626-
end
627-
628-
def execute_ddl({:create_if_not_exists, %Index{} = index}) do
629-
fields = Enum.map_intersperse(index.columns, ", ", &index_expr/1)
630-
631-
[
632-
[
633-
"CREATE ",
634-
if_do(index.unique, "UNIQUE "),
635-
"INDEX IF NOT EXISTS",
636-
?\s,
637-
quote_name(index.name),
638-
" ON ",
639-
quote_table(index.prefix, index.table),
640-
" (",
641-
fields,
642-
?),
643-
if_do(index.where, [" WHERE ", to_string(index.where)])
644-
]
645-
]
646-
end
647-
648602
def execute_ddl({:create, %Constraint{}}) do
649603
raise ArgumentError, "SQLite3 does not support ALTER TABLE ADD CONSTRAINT."
650604
end
651605

652-
def execute_ddl({:drop, %Index{} = index}) do
653-
[
654-
[
655-
"DROP INDEX ",
656-
quote_table(index.prefix, index.name)
657-
]
658-
]
659-
end
660-
661-
def execute_ddl({:drop, %Index{} = index, _mode}) do
662-
execute_ddl({:drop, index})
663-
end
664-
665-
def execute_ddl({:drop_if_exists, %Index{} = index}) do
666-
[
667-
[
668-
"DROP INDEX IF EXISTS ",
669-
quote_table(index.prefix, index.name)
670-
]
671-
]
672-
end
673-
674-
def execute_ddl({:drop_if_exists, %Index{} = index, _mode}) do
675-
execute_ddl({:drop_if_exists, index})
676-
end
677-
678606
def execute_ddl({:drop, %Constraint{}, _mode}) do
679607
raise ArgumentError, "SQLite3 does not support ALTER TABLE DROP CONSTRAINT."
680608
end
@@ -683,43 +611,13 @@ defmodule Ecto.Adapters.SQLite3.Connection do
683611
raise ArgumentError, "SQLite3 does not support ALTER TABLE DROP CONSTRAINT."
684612
end
685613

686-
def execute_ddl({:rename, %Table{} = current_table, %Table{} = new_table}) do
687-
[
688-
[
689-
"ALTER TABLE ",
690-
quote_table(current_table.prefix, current_table.name),
691-
" RENAME TO ",
692-
quote_table(new_table.prefix, new_table.name)
693-
]
694-
]
695-
end
696-
697-
def execute_ddl({:rename, %Table{} = table, current_column, new_column}) do
698-
[
699-
[
700-
"ALTER TABLE ",
701-
quote_table(table.prefix, table.name),
702-
" RENAME COLUMN ",
703-
quote_name(current_column),
704-
" TO ",
705-
quote_name(new_column)
706-
]
707-
]
708-
end
709-
710614
def execute_ddl({:rename, %Index{} = index, new_index}) do
711615
[
712616
execute_ddl({:drop, index}),
713617
execute_ddl({:create, %Index{index | name: new_index}})
714618
]
715619
end
716620

717-
def execute_ddl(string) when is_binary(string), do: [string]
718-
719-
def execute_ddl(keyword) when is_list(keyword) do
720-
raise ArgumentError, "SQLite3 adapter does not support keyword lists in execute"
721-
end
722-
723621
@impl true
724622
def ddl_logs(_), do: []
725623

0 commit comments

Comments
 (0)