Skip to content

Selecting database in a view adds it to the query #203

Description

@azul

The database method on views allows specifying the database to query from.

  User.by_login.database(User.tmp_database).key("bla").first

However the database parameter gets added to the query so it's also present in the url. So the couch logs for this query for me show:

GET /tmp_users/_design/User/_view/by_login?database=http%3A%2F%2Flocalhost%3A5984%2Ftmp_users&key=%22bla%22&limit=1&include_docs=true&reduce=false 200

I would expect the query to not contain the database:

GET /tmp_users/_design/User/_view/by_login?key=%22bla%22&limit=1&include_docs=true&reduce=false 200

The database parameter clutters the query and also leaks credentials in the couch logs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions