default attributes on db object are now queries

This commit is contained in:
evilchili
2024-04-20 23:40:28 -07:00
parent 12c643c542
commit 5ec27e9344
2 changed files with 2 additions and 5 deletions
+1 -4
View File
@@ -85,10 +85,7 @@ class SQLDatabaseManager:
return json.dumps(results, indent=2, cls=AlchemyEncoder)
def __getattr__(self, name: str):
try:
return self.tables[name]
except KeyError:
raise AttributeError(f"{self} does not contain the attribute '{name}'.")
return self.query(getattr(ttfrog.db.schema, name))
db = SQLDatabaseManager()