Skip to content

Commit

Permalink
Documentation fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike committed Oct 11, 2023
1 parent d8d940c commit 8b036b1
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions documentation/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,26 +122,18 @@ is available in this library.

This allows creating views like this:
```
class DBOrgType(Base):
__tablename__ = "org_type"
code: Mapped[str] = mapped_column(String(32), primary_key=True)
description: Mapped[str] = mapped_column(String(512), nullable=False)
org_type_view = view(
name="org_type_view",
metadata=Base.metadata,
selectable=select(*DBOrgType.__table__.columns),
)
org_view = view(
name="org_view",
metadata=Base.metadata,
selectable=select(
*DBOrg.__table__.columns,
DBOrgType.description.label("org_type_description"),
).select_from(
DBOrg.__table__.join(
DBOrgType.__table__,
DBOrg.org_type_code == DBOrgType.code,
isouter=True,
)
),
)
```

## PostgreSQL specific
Expand Down

0 comments on commit 8b036b1

Please sign in to comment.