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

Commit

Permalink
Merge pull request #76 from LimaoC/mitch-register-driver
Browse files Browse the repository at this point in the history
Implemented login system driver
  • Loading branch information
MitchellJC authored Oct 6, 2024
2 parents 8d62e9a + 2f7c87c commit 063e708
Show file tree
Hide file tree
Showing 4 changed files with 303 additions and 382 deletions.
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

0 comments on commit 063e708

Please sign in to comment.