Instead of picking the relevant database on each login a db search param would allow picking it directly. And a query search param would allow automatically running it when opening the link. Queries could be marked as allow activation from url.