Skip to content

Repo.get with query not using query arguments #215

@faultyserver

Description

@faultyserver

I've run into this a few times now. Using Repo.get with a query passed to it ignores everything about the query except for the preloads. For example:

Repo.get(Session, session_id, Query.where(valid: "true"))

Generates a query like:

SELECT * FROM acc_sessions WHERE key='...' LIMIT 1

Where the valid = "true" has not been added to the query string.

Reading the docs for Repo.get, it looks like that is intentional, but it seems rather limiting and unintuitive to me. Like in the example above, I'd like to be able to use that query parameter as a way of filtering out results that I'm not interested in, rather than having to use Repo.all(...).first.

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