             # We cannot have ".db(" in a db name
             last_db_position = query_before_cursor.lastIndexOf('.db(')
             if last_db_position is -1
-                for database in databases.models
-                    if database.get('name') is 'test'
-                        database_test_id = database.get('id')
-                        break
-                if database_test_id?
+                found = false
+                if @databases_available['test']?
                     return {
                         db_found: true
                         error: false
-                        id: database_test_id
                         name: 'test'
                     }
                 else

            $(document).unbind 'mouseup', @handle_mouseup

            clearTimeout @timeout_driver_connect
            # We do not destroy the cursor, because the user might come back and use it.
    
    class @SharedResultView extends Backbone.View
        template_json_tree:


                description.description = @namespaces_suggestions_template(data) + description.description

                @extra_suggestions = @databases_available[database_used.name]
            else
                description = @descriptions[fn] @grouped_data
                @extra_suggestions= null
