Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 82 for Database (0.17 sec)

  1. docs/en/docs/tutorial/encoder.md

    For example, if you need to store it in a database.
    
    For that, **FastAPI** provides a `jsonable_encoder()` function.
    
    ## Using the `jsonable_encoder`
    
    Let's imagine that you have a database `fake_db` that only receives JSON compatible data.
    
    For example, it doesn't receive `datetime` objects, as those are not compatible with JSON.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 1.8K bytes
    - Viewed (0)
  2. docs/en/docs/tutorial/testing.md

    !!! tip
        If you want to call `async` functions in your tests apart from sending requests to your FastAPI application (e.g. asynchronous database functions), have a look at the [Async Tests](../advanced/async-tests.md){.internal-link target=_blank} in the advanced tutorial.
    
    ## Separating tests
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 6.2K bytes
    - Viewed (0)
  3. docs/en/docs/deployment/concepts.md

    To achieve this, you will normally have a **separate program** that would make sure your application is run on startup. And in many cases, it would also make sure other components or applications are also run, for example, a database.
    
    ### Example Tools to Run at Startup
    
    Some examples of the tools that can do this job are:
    
    * Docker
    * Kubernetes
    * Docker Compose
    * Docker in Swarm Mode
    * Systemd
    * Supervisor
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 18K bytes
    - Viewed (0)
  4. docs/zh/docs/advanced/async-sql-databases.md

    * 创建 `DATABASE_URL`
    * 创建 `database`
    
    ```Python hl_lines="3  9  12"
    {!../../../docs_src/async_sql_databases/tutorial001.py!}
    ```
    
    !!! tip "提示"
    
        连接 PostgreSQL 等数据库时,需要修改 `DATABASE_URL`。
    
    ## 创建表
    
    本例中,使用 Python 文件创建表,但在生产环境中,应使用集成迁移等功能的 Alembic 创建表。
    
    本例在启动 **FastAPI** 应用前,直接执行这些操作。
    
    * 创建 `engine`
    * 使用 `metadata` 对象创建所有表
    
    ```Python hl_lines="25-28"
    Plain Text
    - Registered: Sun Mar 31 07:19:09 GMT 2024
    - Last Modified: Sat Mar 30 22:44:40 GMT 2024
    - 4.3K bytes
    - Viewed (0)
  5. docs/em/docs/advanced/async-sql-databases.md

    * ✍ `DATABASE_URL`.
    * ✍ `database` 🎚.
    
    ```Python hl_lines="3  9  12"
    {!../../../docs_src/async_sql_databases/tutorial001.py!}
    ```
    
    !!! tip
        🚥 👆 🔗 🎏 💽 (✅ ✳), 👆 🔜 💪 🔀 `DATABASE_URL`.
    
    ## ✍ 🏓
    
    👉 💼, 👥 🏗 🏓 🎏 🐍 📁, ✋️ 🏭, 👆 🔜 🎲 💚 ✍ 👫 ⏮️ ⚗, 🛠️ ⏮️ 🛠️, ♒️.
    
    📥, 👉 📄 🔜 🏃 🔗, ▶️️ ⏭ ▶️ 👆 **FastAPI** 🈸.
    
    * ✍ `engine`.
    * ✍ 🌐 🏓 ⚪️➡️ `metadata` 🎚.
    
    ```Python hl_lines="25-28"
    Plain Text
    - Registered: Sun Mar 31 07:19:09 GMT 2024
    - Last Modified: Sat Apr 01 09:26:04 GMT 2023
    - 4K bytes
    - Viewed (0)
  6. tests/test_dependency_normal_exceptions.py

    initial_fake_database = {"rick": "Rick Sanchez"}
    
    fake_database = initial_fake_database.copy()
    
    initial_state = {"except": False, "finally": False}
    
    state = initial_state.copy()
    
    app = FastAPI()
    
    
    async def get_database():
        temp_database = fake_database.copy()
        try:
            yield temp_database
            fake_database.update(temp_database)
        except HTTPException:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  7. docs_src/sql_databases/sql_app/tests/test_sql_app.py

    from sqlalchemy import create_engine
    from sqlalchemy.orm import sessionmaker
    from sqlalchemy.pool import StaticPool
    
    from ..database import Base
    from ..main import app, get_db
    
    SQLALCHEMY_DATABASE_URL = "sqlite://"
    
    engine = create_engine(
        SQLALCHEMY_DATABASE_URL,
        connect_args={"check_same_thread": False},
        poolclass=StaticPool,
    )
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jun 22 11:20:12 GMT 2023
    - 1.2K bytes
    - Viewed (0)
  8. docs/en/docs/features.md

    This also means that in many cases you can pass the same object you get from a request **directly to the database**, as everything is validated automatically.
    
    The same applies the other way around, in many cases you can just pass the object you get from the database **directly to the client**.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 9.3K bytes
    - Viewed (0)
  9. docs_src/query_params_str_validations/tutorial008_an_py310.py

    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(
        q: Annotated[
            str | None,
            Query(
                title="Query string",
                description="Query string for the items to search in the database that have a good match",
                min_length=3,
            ),
        ] = None,
    ):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 498 bytes
    - Viewed (0)
  10. docs_src/query_params_str_validations/tutorial010_an_py39.py

    async def read_items(
        q: Annotated[
            Union[str, None],
            Query(
                alias="item-query",
                title="Query string",
                description="Query string for the items to search in the database that have a good match",
                min_length=3,
                max_length=50,
                pattern="^fixedquery$",
                deprecated=True,
            ),
        ] = None,
    ):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 635 bytes
    - Viewed (0)
Back to top