Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for sessionmaker (0.15 sec)

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

    每个实例`SessionLocal`都会是一个数据库会话。当然该类本身还不是数据库会话。
    
    但是一旦我们创建了一个`SessionLocal`类的实例,这个实例将是实际的数据库会话。
    
    我们命名它是`SessionLocal`为了将它与我们从 SQLAlchemy 导入的`Session`区别开来。
    
    稍后我们将使用`Session`(从 SQLAlchemy 导入的那个)。
    
    要创建`SessionLocal`类,请使用函数`sessionmaker`:
    
    ```Python hl_lines="11"
    {!../../../docs_src/sql_databases/sql_app/database.py!}
    ```
    
    ### 创建一个`Base`类
    
    现在我们将使用`declarative_base()`返回一个类。
    
    稍后我们将用这个类继承,来创建每个数据库模型或类(ORM 模型):
    
    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/tutorial/sql-databases.md

    We name it `SessionLocal` to distinguish it from the `Session` we are importing from SQLAlchemy.
    
    We will use `Session` (the one imported from SQLAlchemy) later.
    
    To create the `SessionLocal` class, use the function `sessionmaker`:
    
    ```Python hl_lines="11"
    {!../../../docs_src/sql_databases/sql_app/database.py!}
    ```
    
    ### Create a `Base` class
    
    Now we will use the function `declarative_base()` that returns a class.
    
    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)
  3. docs/em/docs/tutorial/sql-databases.md

    ✋️ 🕐 👥 ✍ 👐 `SessionLocal` 🎓, 👉 👐 🔜 ☑ 💽 🎉.
    
    👥 📛 ⚫️ `SessionLocal` 🔬 ⚫️ ⚪️➡️ `Session` 👥 🏭 ⚪️➡️ 🇸🇲.
    
    👥 🔜 ⚙️ `Session` (1️⃣ 🗄 ⚪️➡️ 🇸🇲) ⏪.
    
    ✍ `SessionLocal` 🎓, ⚙️ 🔢 `sessionmaker`:
    
    ```Python hl_lines="11"
    {!../../../docs_src/sql_databases/sql_app/database.py!}
    ```
    
    ### ✍ `Base` 🎓
    
    🔜 👥 🔜 ⚙️ 🔢 `declarative_base()` 👈 📨 🎓.
    
    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)
Back to top