Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

Implemented login system driver #76

Merged
merged 11 commits into from
Oct 6, 2024
13 changes: 13 additions & 0 deletions client/data/routines.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,19 @@ def create_user() -> int:
return user_id


def next_user_id() -> int:
"""
Returns:
The id that would be assigned to a new user if one was created
"""
with _connect() as connection:
cursor = connection.cursor()
result = cursor.execute("SELECT last_insert_rowid() FROM user;")
ids = result.fetchone()
last_user_id = 0 if len(ids) == 0 else ids[0]
return last_user_id + 1


def save_posture(posture: Posture) -> None:
"""Stores the posture record in the database.

Expand Down
Loading