src/pds_doi_service/core/db/doi_database.py
def check_if_table_exists(self, table_name):
        """
        Check if the expected default table exists in the current database.

        If a database connection has not been made yet, one is created by
        this method.
        """
        logger.info("Checking for existence of DOI table %s", table_name)

        o_table_exists_flag = False

        if self.m_my_conn is None:
            logger.warn("Not connected to %s, establishing new connection...", self.m_database_name)
            self.create_connection()

        table_pointer = self.m_my_conn.cursor()

        # Get the count of tables with the given name.
        query_string = f"SELECT count(name) FROM sqlite_master WHERE type='table' AND name='{table_name}'"

        logger.info("Executing query: %s", query_string)
        table_pointer.execute(query_string)

        # If the count is 1, then table exists.
        if table_pointer.fetchone()[0] == 1:
            o_table_exists_flag = True

        logger.debug("o_table_exists_flag: %s", o_table_exists_flag)

        return o_table_exists_flag

        Check if the expected default table exists in the current database.

        If a database connection has not been made yet, one is created by
        this method.
        
Check if the expected default table exists in the current database.
If a database connection has not been made yet, one is created by
this method.
Check if the expected default table exists in the current database . If a database connection has not been made yet one is created by this method .
def check_if_table_exists(self, table_name):
        logger.info("Checking for existence of DOI table %s", table_name)
        o_table_exists_flag = False
        if self.m_my_conn is None:
            logger.warn("Not connected to %s, establishing new connection...", self.m_database_name)
            self.create_connection()
        table_pointer = self.m_my_conn.cursor()
        query_string = f"SELECT count(name) FROM sqlite_master WHERE type='table' AND name='{table_name}'"
        logger.info("Executing query: %s", query_string)
        table_pointer.execute(query_string)
        if table_pointer.fetchone()[0] == 1:
            o_table_exists_flag = True
        logger.debug("o_table_exists_flag: %s", o_table_exists_flag)
        return o_table_exists_flag
def check_if_table_exists ( self , table_name ) : logger . info ( "Checking for existence of DOI table %s" , table_name ) o_table_exists_flag = False if self . m_my_conn is None : logger . warn ( "Not connected to %s, establishing new connection..." , self . m_database_name ) self . create_connection ( ) table_pointer = self . m_my_conn . cursor ( ) query_string = f"SELECT count(name) FROM sqlite_master WHERE type='table' AND name='{table_name}'" logger . info ( "Executing query: %s" , query_string ) table_pointer . execute ( query_string ) if table_pointer . fetchone ( ) [ 0 ] == 1 : o_table_exists_flag = True logger . debug ( "o_table_exists_flag: %s" , o_table_exists_flag ) return o_table_exists_flag
Check if the expected default table exists in the current database.
Check if the expected default table exists in the current database .
"""
        Check if the expected default table exists in the current database.

        If a database connection has not been made yet, one is created by
        this method.
        """ # Get the count of tables with the given name. # If the count is 1, then table exists.
self
table_name