fixup! WIP
All checks were successful
Run tests / run-tests (push) Successful in 41s

This commit is contained in:
2025-12-08 21:43:05 +09:00
parent de896901bb
commit f1b15357f9
4 changed files with 6 additions and 3 deletions

View File

@@ -6,11 +6,11 @@ from sqlalchemy.orm import sessionmaker
from dibbler.conf import config
if (url := config.get("database", "url")) is not None:
database_url = url
database_url = url
elif (url_file := config.get("database", "url_file")) is not None:
with Path(url_file).open() as file:
database_url = file.read().strip()
with Path(url_file).open() as file:
database_url = file.read().strip()
engine = create_engine(database_url)
Session = sessionmaker(bind=engine)

View File

@@ -5,6 +5,7 @@ from sqlalchemy.orm import Mapped, mapped_column
from dibbler.models import Base
class ProductCache(Base):
product_id: Mapped[int] = mapped_column(Integer, primary_key=True)

View File

@@ -5,6 +5,7 @@ from sqlalchemy.orm import Mapped, mapped_column
from dibbler.models import Base
# More like user balance cash money flow, amirite?
class UserBalanceCache(Base):
user_id: Mapped[int] = mapped_column(Integer, primary_key=True)

View File

@@ -6,6 +6,7 @@ from dibbler.queries.current_penalty import current_penalty
# TODO: this type of transaction should be password protected.
# the password can be set as a string literal in the config file.
def adjust_penalty(
sql_session: Session,
user_id: int,