Skip to content
Snippets Groups Projects

Db setup

Merged suazo2 requested to merge db-setup into main
6 files
+ 70
3
Compare changes
  • Side-by-side
  • Inline
Files
6
+ 21
0
import mysql.connector
from utils import load_config
class SqlManager:
def __init__(self):
self.conn = None
def connect(self):
config = load_config()["database"]
self.conn = mysql.connector.connect(
host=config.get("host", "localhost"),
user=config.get("user"),
password=config.get("password"),
database=config.get("database")
)
def disconnect(self):
self.conn.close()
\ No newline at end of file
Loading