refactor(db): Update SqlQueryBuilder references + Various refactors

Consolidates the creation of SQL query builders across multiple classes to ensure a unified approach for database operations.

Replaces manual type checks and specific query creators with a generic method for better maintainability and to prevent errors.

Improves code readability and reduces duplication, facilitating easier updates in the future.
This commit is contained in:
Sakura Akeno Isayeki 2025-04-28 15:50:55 +02:00
parent 27fde1f9ac
commit 084411f847
No known key found for this signature in database
GPG key ID: BAB781B71FD2E7E6
15 changed files with 399 additions and 488 deletions

View file

@ -59,11 +59,9 @@ namespace TShockAPI.DB
{
List<object> values = new List<object>();
using (var reader = database.QueryReader(creator.ReadColumn(table, wheres)))
{
while (reader.Read())
values.Add(reader.Reader.Get<object>(column));
}
using var reader = database.QueryReader(creator.ReadColumn(table, wheres));
while (reader.Read())
values.Add(reader.Reader.Get<object>(column));
return values;
}