Skip to content

Ecto V3.12.0 (2024-08-12) breaking change for queries #181

Open
@twister3454

Description

@twister3454

jamedb_oracle Master branch v 0.5.10

From the changelog for Ecto V3.12.0 (2024-08-12):
"distinct, group_by, order_by and window expressions use the new Ecto.Query.ByExpr struct rather than the old Ecto.Query.QueryExpr struct"
[Ecto.Query] Subqueries are now supported in distinct, group_by, order_by and window expressions

The ByExpr struct is similar to the QueryExpr struct, but has an additional field for subqueries.

The Jamdb.Oracle.Query module uses the QueryExpr struct for the distinct, group_by, and order_by functions. This causes a "no function clause matches" type of error because ecto 3.12.0 and above passes a ByExpr struct instead of a QueryExpr strict. Replacing QueryExpr with ByExpr in these functions gets the queries working again.

Example "defp distinct(%QueryExpr{expr: []}, _, _), do: {[], []}" becomes "defp distinct(%ByExpr{expr: []}, _, _), do: {[], []}"

ByExpr needs to be added to the Jamedb.Oracle.Query module's alias line.
alias Ecto.Query.{BooleanExpr, JoinExpr, QueryExpr, WithExpr, ByExpr}

I didn't check the database window functions, but they will probably require the same change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions