FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Adding more to decorator docs by jocho-here · Pull Request #489 · encode/databases · GitHub

This repository was archived by the owner on Aug 19, 2025. It is now read-only.
/ databases Public archive

Adding more to decorator docs - #489

Open
jocho-here wants to merge 3 commits into
encode:masterfrom
jocho-here:adding-to-decorator-usage-docs
Open

Adding more to decorator docs#489
jocho-here wants to merge 3 commits into
encode:masterfrom
jocho-here:adding-to-decorator-usage-docs

Conversation

Copy link
Copy Markdown

I wasn't able to find a way to properly use the transaction decorator when using with other decorators in the docs.
I thought it would be helpful to add this portion so others can also be aware they need to put the decorator right above the function signature without going into the code and finding out about it themselves.

```python
@router.post("/my-awesome-endpoint")
@database.transaction()
async def awesome_endpoint():

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think it would be better to mention something general that "If using multiple decorators, the @database.transaction() should be the most inner to the function definition. But maybe with better wording 😄

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL