bastisawesome / guessinggame_ttv

A Twitch bot to play a word guessing game
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Database QoL Improvements #22

Open bastisawesome opened 1 year ago

bastisawesome commented 1 year ago

The database currently raises exceptions in instances where it would be possible to add new users to the database with default values of 0 for score and tokens. Instead of raising an exception, the database should be updated to allow inserting new users instead of raising an exception.

An example SQL query to be tested:

UPDATE OR REPLACE users SET 
    username=[username], 
    tokens=[pre-calculated tokens+amount], 
    score=[pre-calculated tokens+amount] 
WHERE username=[username]

A few examples where this could be used:

Tests would need to be added and updated to show this feature working correctly.