HUE-1790 [dbquery] Explicit db restriction property

Make 'get_databases' return only usable databases.
Add better error message.