original_docstring: Use DB to list category pages. Called by get_new_categoryPages()
docstring: Use DB to list category pages.
docstring_tokens: Use DB to list category pages .
code: def _db_get_new_category_pages(
      category: pywikibot.Category,
      start_time: pywikibot.Timestamp,
      end_time: pywikibot.Timestamp,
      namespaces: List[int],
  ) -> Iterator[Tuple[pywikibot.page.BasePage, datetime]]:
      """Use DB to list category pages. Called by get_new_categoryPages()"""
      if not wmcs:
          raise ConnectionError
  
      query = (
          "SELECT page_namespace, page_title, cl_timestamp "
          "FROM "
          "    categorylinks "
          "    JOIN page ON page_id = cl_from "
          "WHERE "
          '    cl_to = "{catname}" AND '
          '    cl_type = "page" AND '
          "    cl_timestamp >= {start_timestamp} AND "
          "    cl_timestamp < {end_timestamp} AND "
          "    page_namespace in ({nslist}) "
          "ORDER BY cl_timestamp "
      ).format(
          catname=category.title(underscore=True, with_ns=False),
          start_timestamp=start_time.totimestampformat(),
          end_timestamp=end_time.totimestampformat(),
          nslist=", ".join(str(n) for n in namespaces),
      )
  
      for ns, title, ts in pywikibot.data.mysql.mysql_query(query, dbname=site.dbName()):
          yield (
              pywikibot.Page(site, title=title.decode(encoding="utf-8"), ns=ns),
              ts,
          )
code_tokens: def _db_get_new_category_pages ( category : pywikibot . Category , start_time : pywikibot . Timestamp , end_time : pywikibot . Timestamp , namespaces : List [ int ] , ) -> Iterator [ Tuple [ pywikibot . page . BasePage , datetime ] ] : if not wmcs : raise ConnectionError query = ( "SELECT page_namespace, page_title, cl_timestamp " "FROM " "    categorylinks " "    JOIN page ON page_id = cl_from " "WHERE " '    cl_to = "{catname}" AND ' '    cl_type = "page" AND ' "    cl_timestamp >= {start_timestamp} AND " "    cl_timestamp < {end_timestamp} AND " "    page_namespace in ({nslist}) " "ORDER BY cl_timestamp " ) . format ( catname = category . title ( underscore = True , with_ns = False ) , start_timestamp = start_time . totimestampformat ( ) , end_timestamp = end_time . totimestampformat ( ) , nslist = ", " . join ( str ( n ) for n in namespaces ) , ) for ns , title , ts in pywikibot . data . mysql . mysql_query ( query , dbname = site . dbName ( ) ) : yield ( pywikibot . Page ( site , title = title . decode ( encoding = "utf-8" ) , ns = ns ) , ts , )
short_docstring: Use DB to list category pages.
short_docstring_tokens: Use DB to list category pages .
comment: """Use DB to list category pages. Called by get_new_categoryPages()"""