import sqlite3


def get_version(cxn):
    """Get the current database version."""
    sql = '''SELECT value FROM metadata WHERE label = ?'''
    try:
        result = cxn.execute(sql, ('version', ))
        return result.fetchone()[0]
    except sqlite3.OperationalError:
        return '1.0'