Refactor database management and schema initialization
- Removed the old npc_memory.db file. - Updated time.txt with a new timestamp. - Refactored transaction recording in bank_functions.py to use parameterized queries. - Enhanced DatabaseManager in sql_commands.py to support singleton pattern and improved table creation logic. - Added methods for sanitizing SQL identifiers and parsing insert columns for upsert operations. - Improved error handling and connection management in execute_query, fetch_one, fetch_all, and fetch_as_dataframe methods. - Introduced a new bootstrap_database.py script for initializing the database schema. - Updated app.py to use the new initialize_database function for database management.
This commit is contained in:
@@ -63,7 +63,7 @@ class CustomCommandsCog(commands.Cog):
|
||||
)
|
||||
self.invalidate_cache(guild_id) # Invalidate cache after change
|
||||
|
||||
if deleted_rows is not None and len(deleted_rows) > 0:
|
||||
if deleted_rows and deleted_rows > 0:
|
||||
await ctx.send(f"Custom command `{command_name}` has been deleted!")
|
||||
else:
|
||||
await ctx.send(f"Custom command `{command_name}` not found.")
|
||||
|
||||
Reference in New Issue
Block a user