src/dirbs/utils.py
def query_db_schema_version(conn):
    """
    Function to fetch the DB version number from the database.

    Arguments:
        conn: dirbs db connection object
    Returns:
        DB schema version number or None if does not exists
    """
    logger = logging.getLogger('dirbs.db')
    with conn.cursor() as cur:
        try:
            cur.execute('SELECT MAX(version) FROM schema_version')  # noqa: Q440
            return cur.fetchone()[0]
        except psycopg2.ProgrammingError as ex:
            logger.error(str(ex).strip())
            return None

    Function to fetch the DB version number from the database.

    Arguments:
        conn: dirbs db connection object
    Returns:
        DB schema version number or None if does not exists
    
Function to fetch the DB version number from the database.
Function to fetch the DB version number from the database .
def query_db_schema_version(conn):
    logger = logging.getLogger('dirbs.db')
    with conn.cursor() as cur:
        try:
            cur.execute('SELECT MAX(version) FROM schema_version')  
            return cur.fetchone()[0]
        except psycopg2.ProgrammingError as ex:
            logger.error(str(ex).strip())
            return None
def query_db_schema_version ( conn ) : logger = logging . getLogger ( 'dirbs.db' ) with conn . cursor ( ) as cur : try : cur . execute ( 'SELECT MAX(version) FROM schema_version' ) return cur . fetchone ( ) [ 0 ] except psycopg2 . ProgrammingError as ex : logger . error ( str ( ex ) . strip ( ) ) return None
Function to fetch the DB version number from the database.
Function to fetch the DB version number from the database .
"""
    Function to fetch the DB version number from the database.

    Arguments:
        conn: dirbs db connection object
    Returns:
        DB schema version number or None if does not exists
    """ # noqa: Q440
DB schema version number or None if does not exists
DB schema version number or None if does not exists
conn
dirbs db connection object
dirbs db connection object