Skip to content

Commit

Permalink
✨ SQLAlchemy
Browse files Browse the repository at this point in the history
  • Loading branch information
juftin committed Aug 23, 2023
1 parent c76b555 commit 73c859f
Show file tree
Hide file tree
Showing 36 changed files with 1,683 additions and 1,842 deletions.
1 change: 1 addition & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ services:
environment:
ZOO_PRODUCTION: true
ZOO_DOCKER: true
ZOO_JWT_EXPIRATION: 3600
ZOO_DATABASE_DRIVER: postgresql+asyncpg
ZOO_DATABASE_HOST: db
ZOO_DATABASE_PORT: 5432
Expand Down
15 changes: 0 additions & 15 deletions docs/infrastructure.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,6 @@ interface for interacting with databases in Python. SQLModel is built on top
of [Pydantic](https://pydantic-docs.helpmanual.io/) and
[SQLAlchemy](https://www.sqlalchemy.org/), a popular SQL toolkit and ORM for Python.

#### SQLModel

```python
from typing import Optional

from sqlmodel import Field, SQLModel


class Hero(SQLModel, table=True):
id: Optional[int] = Field(default=None, primary_key=True)
name: str
secret_name: str
age: Optional[int] = None
```

### Database Migrations

`zoo` uses [Alembic](https://alembic.sqlalchemy.org/en/latest/) for database migrations. Alembic
Expand Down
Loading

0 comments on commit 73c859f

Please sign in to comment.