Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for 5952 (0.13 sec)

  1. docs/zh/docs/tutorial/sql-databases.md

        ```Python hl_lines="21-26  29-32  35-40  43-47  50-53"
        {!> ../../../docs_src/sql_databases/sql_app_py39/main.py!}
        ```
    
    === "Python 3.8+"
    
        ```Python hl_lines="23-28  31-34  37-42  45-49  52-55"
        {!> ../../../docs_src/sql_databases/sql_app/main.py!}
        ```
    
    我们在依赖项中的每个请求之前利用`yield`创建数据库会话,然后关闭它。
    
    所以我们就可以在*路径操作函数*中创建需要的依赖,就能直接获取会话。
    
    这样,我们就可以直接从*路径操作函数*内部调用`crud.get_user`并使用该会话,来进行对数据库操作。
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 27K bytes
    - Viewed (0)
  2. docs/en/docs/release-notes.md

    * ✏ Tweak wording to clarify `docs/en/docs/project-generation.md`. PR [#5930](https://github.com/tiangolo/fastapi/pull/5930) by [@chandra-deb](https://github.com/chandra-deb).
    * ✏ Update Pydantic GitHub URLs. PR [#5952](https://github.com/tiangolo/fastapi/pull/5952) by [@yezz123](https://github.com/yezz123).
    * 📝 Add opinion from Cisco. PR [#5981](https://github.com/tiangolo/fastapi/pull/5981) by [@tiangolo](https://github.com/tiangolo).
    
    ### Translations
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri May 03 23:25:42 GMT 2024
    - 388.1K bytes
    - Viewed (1)
  3. docs/em/docs/tutorial/sql-databases.md

    ### ✍ 👆 **FastAPI** *➡ 🛠️*
    
    🔜, 😒, 📥 🐩 **FastAPI** *➡ 🛠️* 📟.
    
    === "🐍 3️⃣.6️⃣ & 🔛"
    
        ```Python hl_lines="23-28  31-34  37-42  45-49  52-55"
        {!> ../../../docs_src/sql_databases/sql_app/main.py!}
        ```
    
    === "🐍 3️⃣.9️⃣ & 🔛"
    
        ```Python hl_lines="21-26  29-32  35-40  43-47  50-53"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 25.2K bytes
    - Viewed (1)
  4. docs/en/docs/tutorial/sql-databases.md

        ```Python hl_lines="21-26  29-32  35-40  43-47  50-53"
        {!> ../../../docs_src/sql_databases/sql_app_py39/main.py!}
        ```
    
    === "Python 3.8+"
    
        ```Python hl_lines="23-28  31-34  37-42  45-49  52-55"
        {!> ../../../docs_src/sql_databases/sql_app/main.py!}
        ```
    
    We are creating the database session before each request in the dependency with `yield`, and then closing it afterwards.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 29.6K bytes
    - Viewed (0)
Back to top