[omemo] Refactor Plugin
- Adapt to nbxmpp supporting OMEMO - Move python-axolotl code into backend folder
This commit is contained in:
15
omemo/backend/db_helpers.py
Normal file
15
omemo/backend/db_helpers.py
Normal file
@@ -0,0 +1,15 @@
|
||||
''' Database helper functions '''
|
||||
|
||||
|
||||
def table_exists(db, name):
|
||||
""" Check if the specified table exists in the db. """
|
||||
|
||||
query = """ SELECT name FROM sqlite_master
|
||||
WHERE type='table' AND name=?;
|
||||
"""
|
||||
return db.execute(query, (name, )).fetchone() is not None
|
||||
|
||||
|
||||
def user_version(db):
|
||||
""" Return the value of PRAGMA user_version. """
|
||||
return db.execute('PRAGMA user_version').fetchone()[0]
|
||||
Reference in New Issue
Block a user