On SEDE, we currently have the magic syntax site://, which expands to the domain name of the site on which the query is currently being run. So, for example, in queries run from https://data.stackexchange.com/stackoverflow/, site://questions/ will autoexpand to https://stackoverflow.com/questions/.

I would like to request a similar magic syntax for linking to other queries on SEDE. I propose that we use sede:// for this. The idea is that a query run on the Stack Overflow database (i.e. https://data.stackexchange.com/stackoverflow/) would autoexpand sede://query/259634?UserId=1 to https://data.stackexchange.com/stackoverflow/query/259634?UserId=1, and similarly for other databases on SEDE.

The immediate use-case that prompted this was as follows: I wrote a query that provided summary information about the top commenters for a given site. I then wanted to "drill-down" and examine individual comments by some of those top commenters. What would be ideal is if I could include an extra column in the results like 'sede://query/1234567?UserId=' + CAST(UserId AS nvarchar) that would automatically be converted to a link to query 1234567 (which would do the drill-down) with the UserId parameter automatically filled in. This way, there would be no need to hardcode https://data.stackexchange.com/<sitename>/ in the column, and the query would be usable on all sites without changes.


Seems reasonable enough. I have this working locally, though I changed sede:// to query://, and the expected path is just a query ID.

Before I push out the changes for a PR, I'd like to expand this to be able to link to queries on the linked site as well, just in case that's ever useful (i.e. swap between main and meta and vice versa). I'm open to suggestion on what form this should take.

For now though I've just put out a pull request for the base functionality, pending a pull and redeploy.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .