Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 27 for xargs (0.12 sec)

  1. docs_src/sql_databases/sql_app_py310/database.py

    from sqlalchemy.orm import sessionmaker
    
    SQLALCHEMY_DATABASE_URL = "sqlite:///./sql_app.db"
    # SQLALCHEMY_DATABASE_URL = "postgresql://user:password@postgresserver/db"
    
    engine = create_engine(
        SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False}
    )
    SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 461 bytes
    - Viewed (0)
  2. tests/test_tutorial/test_dependencies/test_tutorial008d_an.py

        from docs_src.dependencies.tutorial008d_an import InternalError
    
        with pytest.raises(InternalError) as exc_info:
            client.get("/items/portal-gun")
        assert (
            exc_info.value.args[0] == "The portal gun is too dangerous to be owned by Rick"
        )
    
    
    def test_internal_server_error():
        from docs_src.dependencies.tutorial008d_an import app
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 1.2K bytes
    - Viewed (0)
  3. fastapi/utils.py

                }
            )
        try:
            return ModelField(**kwargs)  # type: ignore[arg-type]
        except (RuntimeError, PydanticSchemaGenerationError):
            raise fastapi.exceptions.FastAPIError(
                "Invalid args for response field! Hint: "
                f"check that {type_} is a valid Pydantic field type. "
                "If you are using a return type annotation that is not a valid Pydantic "
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  4. docs/zh/docs/tutorial/sql-databases.md

    ```
    
    #### 注意
    
    参数:
    
    ```Python
    connect_args={"check_same_thread": False}
    ```
    
    ...仅用于`SQLite`,在其他数据库不需要它。
    
    !!! info "技术细节"
    
        默认情况下,SQLite 只允许一个线程与其通信,假设有多个线程的话,也只将处理一个独立的请求。
    
        这是为了防止意外地为不同的事物(不同的请求)共享相同的连接。
    
        但是在 FastAPI 中,普遍使用def函数,多个线程可以为同一个请求与数据库交互,所以我们需要使用`connect_args={"check_same_thread": False}`来让SQLite允许这样。
    
        此外,我们将确保每个请求都在依赖项中获得自己的数据库连接会话,因此不需要该默认机制。
    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)
  5. tests/test_tutorial/test_dependencies/test_tutorial008d.py

        from docs_src.dependencies.tutorial008d import InternalError
    
        with pytest.raises(InternalError) as exc_info:
            client.get("/items/portal-gun")
        assert (
            exc_info.value.args[0] == "The portal gun is too dangerous to be owned by Rick"
        )
    
    
    def test_internal_server_error():
        from docs_src.dependencies.tutorial008d import app
    
        client = TestClient(app, raise_server_exceptions=False)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 1.2K bytes
    - Viewed (0)
  6. docs_src/sql_databases/sql_app_py39/tests/test_sql_app.py

    from sqlalchemy.orm import sessionmaker
    
    from ..database import Base
    from ..main import app, get_db
    
    SQLALCHEMY_DATABASE_URL = "sqlite:///./test.db"
    
    engine = create_engine(
        SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False}
    )
    TestingSessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
    
    
    Base.metadata.create_all(bind=engine)
    
    
    def override_get_db():
        try:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 1.2K bytes
    - Viewed (0)
  7. docs/em/docs/tutorial/sql-databases.md

    ```
    
    #### 🗒
    
    ❌:
    
    ```Python
    connect_args={"check_same_thread": False}
    ```
    
    ...💪 🕴 `SQLite`. ⚫️ 🚫 💪 🎏 💽.
    
    !!! info "📡 ℹ"
    
        🔢 🗄 🔜 🕴 ✔ 1️⃣ 🧵 🔗 ⏮️ ⚫️, 🤔 👈 🔠 🧵 🔜 🍵 🔬 📨.
    
        👉 ❎ 😫 🤝 🎏 🔗 🎏 👜 (🎏 📨).
    
        ✋️ FastAPI, ⚙️ 😐 🔢 (`def`) 🌅 🌘 1️⃣ 🧵 💪 🔗 ⏮️ 💽 🎏 📨, 👥 💪 ⚒ 🗄 💭 👈 ⚫️ 🔜 ✔ 👈 ⏮️ `connect_args={"check_same_thread": False}`.
    
    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)
  8. .pre-commit-config.yaml

        hooks:
        -   id: check-added-large-files
        -   id: check-toml
        -   id: check-yaml
            args:
            -   --unsafe
        -   id: end-of-file-fixer
        -   id: trailing-whitespace
    -   repo: https://github.com/charliermarsh/ruff-pre-commit
        rev: v0.2.0
        hooks:
        -   id: ruff
            args:
            - --fix
        -   id: ruff-format
    ci:
    Others
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 737 bytes
    - Viewed (0)
  9. docs_src/sql_databases/sql_app_py310/tests/test_sql_app.py

    from sqlalchemy.orm import sessionmaker
    
    from ..database import Base
    from ..main import app, get_db
    
    SQLALCHEMY_DATABASE_URL = "sqlite:///./test.db"
    
    engine = create_engine(
        SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False}
    )
    TestingSessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
    
    
    Base.metadata.create_all(bind=engine)
    
    
    def override_get_db():
        try:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 1.2K bytes
    - Viewed (0)
  10. docs_src/sql_databases/sql_app_py39/database.py

    from sqlalchemy.orm import sessionmaker
    
    SQLALCHEMY_DATABASE_URL = "sqlite:///./sql_app.db"
    # SQLALCHEMY_DATABASE_URL = "postgresql://user:password@postgresserver/db"
    
    engine = create_engine(
        SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False}
    )
    SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 461 bytes
    - Viewed (0)
Back to top