Skip to content

Commit fbd247c

Browse files
committed
fix: get only certain fields from the user table
this is better than a select * because we exactly know what fields we'll get
1 parent 40abf4d commit fbd247c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

database/database.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ def create_database(database_path):
7373
connection.close()
7474

7575
def get_user(self, user_id):
76-
self.cursor.execute("SELECT * FROM users WHERE user_id=?;", [str(user_id)])
76+
self.cursor.execute("SELECT user_id, first_name, last_name, username, games_played, games_won, games_tie, last_played"
77+
" FROM users WHERE user_id=?;", [str(user_id)])
7778

7879
result = self.cursor.fetchone()
7980
if not result or len(result) == 0:

0 commit comments

Comments
 (0)