Skip to content

Ecto.QueryError on get_by using MultiLevel/DistCache #12

@bglusman

Description

@bglusman

I'm experimenting with a Nebulex Repo cache for ecto for some common, rarely changing structs, and I thought a MultiLevel cache was a good fit, with a local and a DistCache on kubernetes... it seems to work fine for the simplest use case, with RepoCache.get working fine, locally or on kubernetes, and RepoCache.get_by works fine locally with jsut LocalCache as the adapter, but when calling a get_by with the same MultiLevel/DistCache adapter, I get the QueryError:

deps/ecto/lib/ecto/repo/queryable.ex:353: keyword lists can only be interpolated at the top level of where, having, distinct, order_by, update or a join's on in query:

from f in MyApp.Module
  where: f.id == ^[user_id: 5, resource_id: 280],
  select: f

Didn't expect the Ecto part would behave differently with different adapters, but curious for thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions