perceval/archive.py
def _count_table_rows(self, table_name):
        """Fetch the number of rows in a table"""

        cursor = self._db.cursor()
        select_stmt = "SELECT COUNT(*) FROM " + table_name

        try:
            cursor.execute(select_stmt)
            row = cursor.fetchone()
        except sqlite3.DatabaseError as e:
            msg = "invalid archive file; cause: %s" % str(e)
            raise ArchiveError(cause=msg)
        finally:
            cursor.close()

        return row[0]
def _count_table_rows(self, table_name):
        cursor = self._db.cursor()
        select_stmt = "SELECT COUNT(*) FROM " + table_name

        try:
            cursor.execute(select_stmt)
            row = cursor.fetchone()
        except sqlite3.DatabaseError as e:
            msg = "invalid archive file; cause: %s" % str(e)
            raise ArchiveError(cause=msg)
        finally:
            cursor.close()

        return row[0]
def _count_table_rows ( self , table_name ) : cursor = self . _db . cursor ( ) select_stmt = "SELECT COUNT(*) FROM " + table_name try : cursor . execute ( select_stmt ) row = cursor . fetchone ( ) except sqlite3 . DatabaseError as e : msg = "invalid archive file; cause: %s" % str ( e ) raise ArchiveError ( cause = msg ) finally : cursor . close ( ) return row [ 0 ]
Fetch the number of rows in a table
Fetch the number of rows in a table