             switch type {
             case .Bookmark:
                 return itemFactory(row)
+            case .DynamicContainer:
+                // This should never be hit: we exclude dynamic containers from our models.
+                fallthrough
             case .Folder:
                 return folderFactory(row)
-            case .DynamicContainer:
-                fallthrough
             case .Separator:
                 return separatorFactory(row)
             case .Livemark:
                 return livemarkFactory(row)
             case .Query:
+                // This should never be hit: we exclude queries from our models.
                 return queryFactory(row)
             }
         }

        "       structure.parent AS _parent " +
        "FROM (\(either)) AS structure JOIN (\(values)) AS vals " +
        "ON vals.guid = structure.guid " +
        exclusion

        let withIcon =
        "SELECT bookmarks.id AS id, bookmarks.guid AS guid, bookmarks.type AS type, " +

        return bookmark
    }

    // We ignore queries altogether inside the model factory.
    private class func queryFactory(row: SDRow) -> BookmarkItem {
        log.warning("Creating a BookmarkItem from a query. This is almost certainly unexpected.")
        let id = row["id"] as! Int
        let guid = row["guid"] as! String
        let title = row["title"] as? String ?? SQLiteBookmarks.defaultItemTitle
        let bookmark = BookmarkItem(guid: guid, title: title, url: "about:blank")
        bookmark.id = id
        BookmarkFactory.addIcon(bookmark, row: row)
        return bookmark
