                         error: true
                     }
                 db_name = arg.slice 0, end_arg_position
-                for database in databases.models
-                    if database.get('name') is db_name
-                        return {
-                            db_found: true
-                            error: false
-                            id: database.get('id')
-                            name: db_name
-                        }
-                return {
-                    db_found: false
-                    error: true
-                }
+                if @databases_available[db_name]?
+                    return {
+                        db_found: true
+                        error: false
+                        name: db_name
+                    }
+                else
+                    return {
+                        db_found: false
+                        error: true
+                    }
 
         # Function triggered when the user click on 'more results'
         show_more_results: (event) =>


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

                @extra_suggestions= namespaces_available
            else
                description = @descriptions[fn] @grouped_data
                @extra_suggestions= null

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