Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
novanai committed Jan 15, 2025
1 parent a9a8a90 commit 2236b46
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import miru

from src.config import DEBUG, TOKEN
from src.database import init_db

bot = hikari.GatewayBot(
token=TOKEN,
Expand Down
14 changes: 6 additions & 8 deletions src/database.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.asyncio import create_async_engine, async_sessionmaker
from sqlalchemy.ext.asyncio import async_sessionmaker, create_async_engine
from sqlalchemy.ext.declarative import declarative_base
import logging

from src.config import DB_HOST, DB_NAME, DB_USER, DB_PASSWORD
from src.config import DB_HOST, DB_NAME, DB_PASSWORD, DB_USER

logger = logging.getLogger(__name__)

engine = create_async_engine(f"postgresql+asyncpg://{DB_USER}:{DB_PASSWORD}@{DB_HOST}/{DB_NAME}", echo=False)
engine = create_async_engine(
f"postgresql+asyncpg://{DB_USER}:{DB_PASSWORD}@{DB_HOST}/{DB_NAME}", echo=False
)


Base = declarative_base()
Session = async_sessionmaker(bind=engine)


async def init_db():
async def init_db() -> None:
async with engine.begin() as conn:
await conn.run_sync(Base.metadata.create_all)

0 comments on commit 2236b46

Please sign in to comment.