Spaces:
Runtime error
Runtime error
File size: 402 Bytes
3287512 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
import sqlite3
class Database:
def __init__(self, db_path=":memory:"): # Defaults to an in-memory database
self.connection = sqlite3.connect(db_path)
def execute(self, sql, params=()):
cursor = self.connection.cursor()
cursor.execute(sql, params)
self.connection.commit()
return cursor.fetchall()
def close(self):
self.connection.close()
|