added db test commands
This commit is contained in:
1 parent
d564756511
commit
4d34daa1e7
3 files changed
+38
-3
No files matched your search
@@ -7,6 +7,21 @@ class Database:
|
||||
async def connect(self):
|
||||
if self.conn is None:
|
||||
self.conn = await aiosqlite.connect("FemBot.db")
|
||||
|
||||
try:
|
||||
await self.conn.execute("""
|
||||
CREATE TABLE IF NOT EXISTS test (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
message TEXT NOT NULL
|
||||
)
|
||||
""")
|
||||
|
||||
await self.conn.commit()
|
||||
print("Table check/creation completed successfully.")
|
||||
|
||||
except aiosqlite.Error as e:
|
||||
print(f"Failed to check/creation table: {e}")
|
||||
|
||||
return self.conn
|
||||
|
||||
async def close(self):
|
||||
|
||||
Reference in new issue
Block a user