Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for 23 (0.17 sec)

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

    === "Python 3.9+"
    
        ```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`创建数据库会话,然后关闭它。
    
    所以我们就可以在*路径操作函数*中创建需要的依赖,就能直接获取会话。
    
    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/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)
  3. docs/en/docs/tutorial/sql-databases.md

    === "Python 3.9+"
    
        ```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