SGA-A / c2c

Source code for the custom app exclusive to cc, where most interactions begin and end.
MIT License
1 stars 0 forks source link

Store Shop Items within DB + other changes #79

Closed SGA-A closed 6 months ago

SGA-A commented 6 months ago

Describe the issue As the size of the bot increases, we want to add more items with different characteristics. The bot needs to be able to access these items and attributes. Since all items have a rigid set of characteristics, storing it in a database helps organize the data. In addition, we plan to add more items in the future and databases are a more robust solution of storing items.

Describe the solution Remove the dictionary and store all the keys and values as rows and columns respectively. This issue also removes the stock attribute, supply of items should not be limited.

We were originally considering making a function as well. It's parameter would be the item to fetch attributes of. But considering the varying use cases for selecting rows from the database, it may just create more inefficiencies and the SQL query made in each case should be different to meet the needs of the command.

As a result of this, we are also planning on reducing the number of SQL queries we make to the database as a whole. When we acquire a connection from the pool, we want to make one query only. There are certain exceptions to this however.