Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for PeeweeConnectionState (0.31 sec)

  1. docs_src/sql_databases_peewee/sql_app/database.py

    import peewee
    
    DATABASE_NAME = "test.db"
    db_state_default = {"closed": None, "conn": None, "ctx": None, "transactions": None}
    db_state = ContextVar("db_state", default=db_state_default.copy())
    
    
    class PeeweeConnectionState(peewee._ConnectionState):
        def __init__(self, **kwargs):
            super().__setattr__("_state", db_state)
            super().__init__(**kwargs)
    
        def __setattr__(self, name, value):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 662 bytes
    - Viewed (0)
  2. docs/em/docs/how-to/sql-databases-peewee.md

    !!! tip
        👉 🔜 ⚒ 🏒 🎭 ☑ 🕐❔ ⚙️ ⏮️ FastAPI. 🚫 🎲 📂 ⚖️ 📪 🔗 👈 ➖ ⚙️, 🏗 ❌, ♒️.
    
        ✋️ ⚫️ 🚫 🤝 🏒 🔁 💎-🏋️. 👆 🔜 ⚙️ 😐 `def` 🔢 & 🚫 `async def`.
    
    ### ⚙️ 🛃 `PeeweeConnectionState` 🎓
    
    🔜, 📁 `._state` 🔗 🔢 🏒 💽 `db` 🎚 ⚙️ 🆕 `PeeweeConnectionState`:
    
    ```Python hl_lines="24"
    {!../../../docs_src/sql_databases_peewee/sql_app/database.py!}
    ```
    
    !!! tip
        ⚒ 💭 👆 📁 `db._state` *⏮️* 🏗 `db`.
    
    !!! tip
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 19.2K bytes
    - Viewed (0)
  3. docs/en/docs/how-to/sql-databases-peewee.md

        But it doesn't give Peewee async super-powers. You should still use normal `def` functions and not `async def`.
    
    ### Use the custom `PeeweeConnectionState` class
    
    Now, overwrite the `._state` internal attribute in the Peewee database `db` object using the new `PeeweeConnectionState`:
    
    ```Python hl_lines="24"
    {!../../../docs_src/sql_databases_peewee/sql_app/database.py!}
    ```
    
    !!! tip
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Jan 16 13:23:25 GMT 2024
    - 23.6K bytes
    - Viewed (0)
Back to top