doctrine / couchdb-client

CouchDB Client library
MIT License
122 stars 68 forks source link

Do not attempt to create views when querying them #26

Closed xrstf closed 8 years ago

xrstf commented 10 years ago

I am creating a view query and the executing it. For this I don't provide a DesignDocument instance, because I don't need one (name of design doc and view are enough after all).

Unfortunately, whenever a query fails for whatever reason, the query goes ahead and tries to create the view, which fails horribly because it has no DesignDocument to work with. As a nice side effect, the exception from not having a design document shadows the actual problem with my query.

It's completely wrong for a query (aka a reading access!) to suddenly create views in my database. Not only is it conceptionally wrong, it also won't work because my DB user has no write access (let alone being an admin that could fiddle with design documents). That's like Doctrine ORM trying a SELECT query and when it fails, it tries to create a table in my database.

For now I've worked around this by subclassing the Query and removing this weird error handling code.

beberlei commented 8 years ago

Fixed in ed6e036

xrstf commented 8 years ago

Thanks :)