doveauth: ; in sqlite statements not necessary

This commit is contained in:
missytake
2023-10-14 15:40:13 +02:00
committed by holger krekel
parent a9669d5c0f
commit e061d98cfc

View File

@@ -35,7 +35,7 @@ class Connection:
def create_user(self, addr: str, password: str): def create_user(self, addr: str, password: str):
"""Create a row in the users table.""" """Create a row in the users table."""
self.execute("PRAGMA foreign_keys=on;") self.execute("PRAGMA foreign_keys=on")
q = """INSERT INTO users (addr, password, last_login) q = """INSERT INTO users (addr, password, last_login)
VALUES (?, ?, ?)""" VALUES (?, ?, ?)"""
self.execute(q, (addr, password, int(time.time()))) self.execute(q, (addr, password, int(time.time())))
@@ -116,7 +116,7 @@ class Database:
def get_schema_version(self) -> int: def get_schema_version(self) -> int:
with self.read_connection() as conn: with self.read_connection() as conn:
dbversion = conn.execute("PRAGMA user_version;").fetchone()[0] dbversion = conn.execute("PRAGMA user_version").fetchone()[0]
return dbversion return dbversion
CURRENT_DBVERSION = 1 CURRENT_DBVERSION = 1
@@ -137,4 +137,4 @@ class Database:
) )
""", """,
) )
conn.execute("PRAGMA user_version=%s;" % (self.CURRENT_DBVERSION,)) conn.execute("PRAGMA user_version=%s" % (self.CURRENT_DBVERSION,))