elixir-sqlite / ecto_sqlite3

An Ecto SQLite3 adapter.
https://hexdocs.pm/ecto_sqlite3
MIT License
300 stars 45 forks source link

Set minimum ecto version to 3.12 #148

Closed ivanov closed 3 months ago

ivanov commented 3 months ago

Thank you for working on ecto_sqlite3!

The latest release starts using Ecto.Query.ByExpr which only became available in Ecto 3.12.0, so this simple PR updates the relevant dependency versions. Without this change, on Ecto 3.11, users will get run into an error like this:

==> ecto_sqlite3
Compiling 4 files (.ex)
     error: Ecto.Query.ByExpr.__struct__/0 is undefined, cannot expand struct Ecto.Query.ByExpr. Make sure the struct name is correct. If the struct name exists and is correct but it still cannot be found, you likely have cyclic module usage in your code
     │
 842 │   defp distinct(%ByExpr{expr: true}, _sources, _query), do: "DISTINCT "
     │                 ^
     │
     └─ lib/ecto/adapters/sqlite3/connection.ex:842:17: Ecto.Adapters.SQLite3.Connection.distinct/3

== Compilation error in file lib/ecto/adapters/sqlite3/connection.ex ==
** (CompileError) lib/ecto/adapters/sqlite3/connection.ex: cannot compile module Ecto.Adapters.SQLite3.Connection (errors have been logged)
    lib/ecto/adapters/sqlite3/connection.ex:842: (module)

You probably didn't come across this because ex_doc depends on earmark_parser that pulls in ecto 3.12.

warmwaffles commented 3 months ago

Bah I knew I was forgetting something when I fixed the 3.12 issue.