code: def save_named_query(self, alias, querystring, afterwards=None):
          
          if self.ro:
              raise DatabaseROError()
          self.writequeue.append(('setconfig', afterwards, 'query.' + alias,
                                  querystring))
docs: add an alias for a query string.
  
          These are stored in the notmuch database and can be used as part of
          more complex queries using the syntax "query:alias".
          See :manpage:`notmuch-search-terms(7)` for more info.
  
          :param alias: name of shortcut
          :type alias: str
          :param querystring: value, i.e., the full query string
          :type querystring: str
          :param afterwards: callback to trigger after adding the alias
          :type afterwards: callable or None