       where attachment.linkMode = #{Zotero.Attachments.LINK_MODE_LINKED_URL}
     """
 
-    nokey = """
+    items = """
       with citekey as (#{@query.citekeys})
       select item.itemID
       from items item

      where citekey.parentItemID is null
    """

    nokeys = yield Zotero.DB.queryAsync(nokey)
    for item in (nokeys || [])
      Zotero.debug("No citation key: #{item.itemID}")

    debug('KeyManager.init() done')
    return

module.exports = new KeyManager()

debug = require('./debug.coffee')

class KeyManager
  init: Zotero.Promise.coroutine(->
    debug('KeyManager.init()')
    @query = {
      field: {}
