Skip to content

Commit

Permalink
Fix spec for Ecto.Query.Builder.CTE build/5 and apply/4 (#4151)
Browse files Browse the repository at this point in the history
  • Loading branch information
prihandi committed Apr 11, 2023
1 parent caaaa3c commit 7d4b8ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ecto/query/builder/cte.ex
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 35,7 @@ defmodule Ecto.Query.Builder.CTE do
If possible, it does all calculations at compile time to avoid
runtime work.
"""
@spec build(Macro.t, Macro.t, Macro.t, boolean(), Macro.Env.t) :: Macro.t
@spec build(Macro.t, Macro.t, Macro.t, nil | boolean(), Macro.Env.t) :: Macro.t
def build(query, name, cte, materialized, env) do
Builder.apply_query(query, __MODULE__, [escape(name, env), build_cte(name, cte, env), materialized], env)
end
Expand Down Expand Up @@ -73,7 73,7 @@ defmodule Ecto.Query.Builder.CTE do
@doc """
The callback applied by `build/4` to build the query.
"""
@spec apply(Ecto.Queryable.t, bitstring, Ecto.Queryable.t, boolean()) :: Ecto.Query.t
@spec apply(Ecto.Queryable.t, bitstring, Ecto.Queryable.t, nil | boolean()) :: Ecto.Query.t
# Runtime
def apply(%Ecto.Query{with_ctes: with_expr} = query, name, %_{} = with_query, materialized) do
%{query | with_ctes: apply_cte(with_expr, name, with_query, materialized)}
Expand Down

0 comments on commit 7d4b8ca

Please sign in to comment.