Automatically create DBs on query through aggregation
Closes T59