from glob import glob
from typing import Optional
from sqlmodel import Field, Session, SQLModel, create_engine, select


class Image(SQLModel, table=True):
    key: Optional[int] = Field(default=None, primary_key=True)
    image_name: str
    label: str
    image_url: str

engine = create_engine("sqlite:///image.db")

def read_images():
    with Session(engine) as session:
        statement = select(Image)
        images = session.exec(statement).all()
        return images
    
read_images()
sqlmodel.select sqlmodel.Session sqlmodel.create_engine sqlmodel.Field
[((283, 318), 'sqlmodel.create_engine', 'create_engine', (['"""sqlite:///image.db"""'], {}), "('sqlite:///image.db')\n", (296, 318), False, 'from sqlmodel import Field, Session, SQLModel, create_engine, select\n'), ((181, 218), 'sqlmodel.Field', 'Field', ([], {'default': 'None', 'primary_key': '(True)'}), '(default=None, primary_key=True)\n', (186, 218), False, 'from sqlmodel import Field, Session, SQLModel, create_engine, select\n'), ((348, 363), 'sqlmodel.Session', 'Session', (['engine'], {}), '(engine)\n', (355, 363), False, 'from sqlmodel import Field, Session, SQLModel, create_engine, select\n'), ((396, 409), 'sqlmodel.select', 'select', (['Image'], {}), '(Image)\n', (402, 409), False, 'from sqlmodel import Field, Session, SQLModel, create_engine, select\n')]