Poetry

Poetry commands #

Init poetry #

poetry init
poetry env remove --all
poetry install

Tables #

poetry run python - << 'EOF'                                  
from app.adapters.outgoing.database.database import Base
print(Base.metadata.tables)
EOF

DB Config url #

poetry run python - << 'EOF'
from decouple import config
print("DATABASE_URL =", config("DATABASE_URL"))
EOF

Alembic #

poetry run alembic revision --autogenerate -m "initial schema"
poetry run alembic upgrade head
poetry run alembic current

Displays Tables #

poetry run python -c "from app.adapters.outgoing.database.database import Base; print(Base.metadata.tables.keys())"

–dict_keys([‘assets’, ‘asset_types’, ‘sessions’])

Run app #

poetry run uvicorn app.main:app --reload