Remove code examples for Python 3.9

This commit is contained in:
Yurii Motov
2026-02-21 00:17:35 +01:00
parent 438f7d995d
commit e975d7746c
8 changed files with 4 additions and 100 deletions

View File

@@ -1,21 +0,0 @@
from typing import Optional
from sqlmodel import Field, SQLModel, create_engine
class Hero(SQLModel, table=True):
id: Optional[int] = Field(default=None, primary_key=True)
name: str
database_url = "mysql://user:password@localhost/dbname"
engine = create_engine(database_url, echo=True)
def create_db_and_tables():
SQLModel.metadata.create_all(engine)
if __name__ == "__main__":
create_db_and_tables()

View File

@@ -1,21 +0,0 @@
from typing import Optional
from sqlmodel import Field, SQLModel, create_engine
class Hero(SQLModel, table=True):
id: Optional[int] = Field(default=None, primary_key=True)
name: str = Field(max_length=100)
database_url = "mysql://user:password@localhost/dbname"
engine = create_engine(database_url, echo=True)
def create_db_and_tables():
SQLModel.metadata.create_all(engine)
if __name__ == "__main__":
create_db_and_tables()

View File

@@ -1,21 +0,0 @@
from typing import Optional
from sqlmodel import Field, SQLModel, String, create_engine
class Hero(SQLModel, table=True):
id: Optional[int] = Field(default=None, primary_key=True)
name: str = Field(sa_type=String)
database_url = "mysql://user:password@localhost/dbname"
engine = create_engine(database_url, echo=True)
def create_db_and_tables():
SQLModel.metadata.create_all(engine)
if __name__ == "__main__":
create_db_and_tables()

View File

@@ -1,21 +0,0 @@
from typing import Optional
from sqlmodel import Field, SQLModel, String, create_engine
class Hero(SQLModel, table=True):
id: Optional[int] = Field(default=None, primary_key=True)
name: str = Field(sa_type=String(length=255))
database_url = "mysql://user:password@localhost/dbname"
engine = create_engine(database_url, echo=True)
def create_db_and_tables():
SQLModel.metadata.create_all(engine)
if __name__ == "__main__":
create_db_and_tables()