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()
|
load_dotenv()
|
||||||
|
|
||||||
|
|
||||||
class Base(DeclarativeBase):
|
class Base(DeclarativeBase):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
database_url = URL.create(
|
database_url = URL.create(
|
||||||
drivername = "mysql+pymysql",
|
drivername="mysql+pymysql",
|
||||||
username = os.getenv("MYSQL_USER"),
|
username=os.getenv("MYSQL_USER"),
|
||||||
password = os.getenv("MYSQL_PASSWORD"),
|
password=os.getenv("MYSQL_PASSWORD"),
|
||||||
host = os.getenv("MYSQL_HOST"),
|
host=os.getenv("MYSQL_HOST"),
|
||||||
port = int(os.getenv("MYSQL_PORT")),
|
port=int(os.getenv("MYSQL_PORT")),
|
||||||
database = os.getenv("MYSQL_DATABASE"),
|
database=os.getenv("MYSQL_DATABASE"),
|
||||||
)
|
)
|
||||||
|
|
||||||
engine = create_engine(database_url, pool_pre_ping=True)
|
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:
|
with Session(engine, expire_on_commit=False) as session:
|
||||||
yield session
|
yield session
|
||||||
|
|
||||||
SessionDep = Annotated[
|
|
||||||
Session,
|
|
||||||
Depends(get_session)
|
|
||||||
]
|
|
||||||
|
|
||||||
|
SessionDep = Annotated[Session, Depends(get_session)]
|
||||||
|
|||||||
@@ -9,16 +9,16 @@ class Todo(Base):
|
|||||||
__tablename__ = "todos"
|
__tablename__ = "todos"
|
||||||
id: Mapped[int] = mapped_column(
|
id: Mapped[int] = mapped_column(
|
||||||
BIGINT(unsigned=True),
|
BIGINT(unsigned=True),
|
||||||
primary_key = True,
|
primary_key=True,
|
||||||
autoincrement = True,
|
autoincrement=True,
|
||||||
)
|
)
|
||||||
task: Mapped[str] = mapped_column(
|
task: Mapped[str] = mapped_column(
|
||||||
String(200),
|
String(200),
|
||||||
nullable = False,
|
nullable=False,
|
||||||
)
|
)
|
||||||
completion: Mapped[bool] = mapped_column(
|
completion: Mapped[bool] = mapped_column(
|
||||||
Boolean,
|
Boolean,
|
||||||
nullable = False,
|
nullable=False,
|
||||||
default = False,
|
default=False,
|
||||||
server_default = false(),
|
server_default=false(),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user