Page MenuHomePhabricator

Support queries against Quarry's own database and ToolsDB
Open, LowPublic


Add a way to specify the database server to attach to so that queries can be written against:

  • The tool owned databases in ToolsDB
  • The "local" database that is used to track Quarry's saved queries

This way you can for example find scripts that query specific tables with LIKE "%tablename%"

Event Timeline

Framawiki renamed this task from Query Quarry's own database to Query Quarry's own database and tools one.Jun 8 2018, 5:30 PM
bd808 renamed this task from Query Quarry's own database and tools one to Support queries against Quarry's own database and ToolsDB.Aug 2 2018, 11:02 PM
bd808 updated the task description. (Show Details)
Bstorm added a subscriber: Bstorm.

This would be trivial to add to the work on the parent task I just added. Therefore, adding it.

I dug around a little bit and realized it isn't as simple as what I stated above. The reason is that those are read-write databases, which dramatically changes the scope of what Quarry could do. In order to provide such services, this would require a read-only permission to most tables on ToolsDB. It would also require a review of and possible view layer/read-only role for the Quarry database.

This cannot be fitted into the scope of the replica changes. It also may be surprising for developers if their ToolsDB information became dramatically more public than it currently is, but that's more of a topic for discussion.

aborrero triaged this task as Low priority.

There's a clear path to adding database patterns to talk to toolsdb. The quarry database is how quarry works in dev mode, so it clearly works. However, I think it should be done with the read-only user used elsewhere. That's all pretty easy. It should also probably be done in two stages (one patch for toolsdb and one for self-query) so that we can roll back something that is found to be problematic.

I think letting users query public toolsdb databases has clear value (but not sure of the utility of querying quarry's internal db).

As the database selector field exists now, we could just check if the dbname has double underscores and ends in _p – that should indicate a tools database. Credentials used for connecting must not have write access to any database.

With PR-26 closed, should this task be closed as resolved?