Select data error from postgre

I m just fetch data use some conditions, then got this error, whats the message?

protocol Ecto.Queryable not implemented for %Pcdd.LotteryOdds{__meta__: #Ecto.Schema.Metadata<:built, "lotteryodds">, id: nil, inserted_at: nil, lotteryType: nil, minBet: nil, odds: nil, oneBet: nil, oneTerm: nil, rebet: nil, result: nil, status: nil, type: nil, type1: nil, type2: nil, updated_at: nil}

that’s my model file code use some below change ,

def get_all(type ) do info = LotteryOdds |> Repo.all from l in info, where: l.type == ^type end

If I change to like this, thats ok
Repo.all( from l in LotteryOdds, where: l.type == ^type )

Could you include the query statement & the Schema definition for Pcdd.LotteryOdds too? It helps pinpointing the issue

It usually is caused by using a queried resource as a query. Something like this:

# User is already fetched
user = User |> Repo.all

# But you use it as a query
from u in user, where: == ^id

# This errors too
user |> where(id: id)

Please include the full code snippet, error message and stacktrace if you would like feedback on what is wrong in your code. But you cannot execute user |> where(id: id) if user is a User struct/data.