fastapi updates
This commit is contained in:
@@ -61,8 +61,8 @@ This reference uses direct field arguments and full-update semantics to keep the
|
||||
Functions are the simplest default when grouping state or behavior in an object adds no value. Each function is a complete operation boundary: it can run standalone by resolving the cached factory from `database_url`, or compose into a caller-owned scope through `session`.
|
||||
|
||||
```python
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
from sqlmodel import select
|
||||
from sqlmodel.ext.asyncio.session import AsyncSession
|
||||
|
||||
from .session import session_scope
|
||||
from .session import transaction_scope
|
||||
@@ -170,7 +170,7 @@ Update and delete load the row through the same session that mutates it. This av
|
||||
A repository can provide a stable domain-facing interface when several callers need the same grouped operations. It stores repeatable database configuration, never a mutable session. Every method delegates to the analogous function and exposes the same optional-session contract.
|
||||
|
||||
```python
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
from sqlmodel.ext.asyncio.session import AsyncSession
|
||||
|
||||
class WidgetRepository:
|
||||
def __init__(self, database_url: str) -> None:
|
||||
|
||||
Reference in New Issue
Block a user