Update models and schema insert

This commit is contained in:
Mikkel
2022-05-24 14:13:13 +02:00
parent fbefb00707
commit 9ee8ac658a
2 changed files with 34 additions and 14 deletions

View File

@ -78,7 +78,16 @@ class User(tuple, UserMixin):
#
# SQL
#
def get_user_by_id(id):
cur = conn.cursor()
sql = """
SELECT * FROM users
WHERE id = %s
"""
cur.execute(sql, (id,))
user = Customers(cur.fetchone()) if cur.rowcount > 0 else None;
cur.close()
return user