summaryrefslogtreecommitdiffstats
path: root/aurweb/db.py
diff options
context:
space:
mode:
Diffstat (limited to 'aurweb/db.py')
-rw-r--r--aurweb/db.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/aurweb/db.py b/aurweb/db.py
index 02aeba38..8b9b8ada 100644
--- a/aurweb/db.py
+++ b/aurweb/db.py
@@ -1,3 +1,5 @@
+import math
+
try:
import mysql.connector
except ImportError:
@@ -91,6 +93,7 @@ class Connection:
elif aur_db_backend == 'sqlite':
aur_db_name = aurweb.config.get('database', 'name')
self._conn = sqlite3.connect(aur_db_name)
+ self._conn.create_function("POWER", 2, math.pow)
self._paramstyle = sqlite3.paramstyle
else:
raise ValueError('unsupported database backend')