Format Python code and mark release script executable
This commit is contained in:
+9
-7
@@ -7,16 +7,18 @@ from sqlalchemy.orm import DeclarativeBase
|
||||
|
||||
load_dotenv()
|
||||
|
||||
|
||||
class Base(DeclarativeBase):
|
||||
pass
|
||||
|
||||
|
||||
database_url = URL.create(
|
||||
drivername = "mysql+pymysql",
|
||||
username = os.getenv("MYSQL_USER"),
|
||||
password = os.getenv("MYSQL_PASSWORD"),
|
||||
host = os.getenv("MYSQL_HOST"),
|
||||
port = int(os.getenv("MYSQL_PORT")),
|
||||
database = os.getenv("MYSQL_DATABASE"),
|
||||
)
|
||||
drivername="mysql+pymysql",
|
||||
username=os.getenv("MYSQL_USER"),
|
||||
password=os.getenv("MYSQL_PASSWORD"),
|
||||
host=os.getenv("MYSQL_HOST"),
|
||||
port=int(os.getenv("MYSQL_PORT")),
|
||||
database=os.getenv("MYSQL_DATABASE"),
|
||||
)
|
||||
|
||||
engine = create_engine(database_url, pool_pre_ping=True)
|
||||
|
||||
+1
-4
@@ -10,8 +10,5 @@ def get_session():
|
||||
with Session(engine, expire_on_commit=False) as session:
|
||||
yield session
|
||||
|
||||
SessionDep = Annotated[
|
||||
Session,
|
||||
Depends(get_session)
|
||||
]
|
||||
|
||||
SessionDep = Annotated[Session, Depends(get_session)]
|
||||
|
||||
@@ -9,16 +9,16 @@ class Todo(Base):
|
||||
__tablename__ = "todos"
|
||||
id: Mapped[int] = mapped_column(
|
||||
BIGINT(unsigned=True),
|
||||
primary_key = True,
|
||||
autoincrement = True,
|
||||
primary_key=True,
|
||||
autoincrement=True,
|
||||
)
|
||||
task: Mapped[str] = mapped_column(
|
||||
String(200),
|
||||
nullable = False,
|
||||
nullable=False,
|
||||
)
|
||||
completion: Mapped[bool] = mapped_column(
|
||||
Boolean,
|
||||
nullable = False,
|
||||
default = False,
|
||||
server_default = false(),
|
||||
nullable=False,
|
||||
default=False,
|
||||
server_default=false(),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user