Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 267 for get_db (0.05 seconds)

  1. tests/test_security_scopes.py

    @pytest.fixture(name="app")
    def app_fixture(call_counter: dict[str, int]):
        def get_db():
            call_counter["count"] += 1
            return f"db_{call_counter['count']}"
    
        def get_user(db: Annotated[str, Depends(get_db)]):
            return "user"
    
        app = FastAPI()
    
        @app.get("/")
        def endpoint(
            db: Annotated[str, Depends(get_db)],
            user: Annotated[str, Security(get_user, scopes=["read"])],
        ):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Dec 17 21:25:59 GMT 2025
    - 1006 bytes
    - Click Count (0)
  2. docs_src/dependencies/tutorial010_py310.py

        def __init__(self):
            self.db = DBSession()
    
        def __enter__(self):
            return self.db
    
        def __exit__(self, exc_type, exc_value, traceback):
            self.db.close()
    
    
    async def get_db():
        with MySuperContextManager() as db:
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 292 bytes
    - Click Count (0)
  3. fastapi/.agents/skills/fastapi/references/dependencies.md

    ```python
    from typing import Annotated
    
    from fastapi import Depends, FastAPI
    
    app = FastAPI()
    
    
    def get_db():
        db = DBSession()
        try:
            yield db
        finally:
            db.close()
    
    
    DBDep = Annotated[DBSession, Depends(get_db)]
    
    
    @app.get("/items/")
    async def read_items(db: DBDep):
        return db.query(Item).all()
    ```
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 01 10:05:57 GMT 2026
    - 3.2K bytes
    - Click Count (0)
  4. docs_src/dependencies/tutorial007_py310.py

    async def get_db():
        db = DBSession()
        try:
            yield db
        finally:
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 99 bytes
    - Click Count (0)
  5. tests/test_custom_route_class.py

    router_b = APIRouter(route_class=APIRouteB)
    router_c = APIRouter(route_class=APIRouteC)
    
    
    @router_a.get("/")
    def get_a():
        return {"msg": "A"}
    
    
    @router_b.get("/")
    def get_b():
        return {"msg": "B"}
    
    
    @router_c.get("/")
    def get_c():
        return {"msg": "C"}
    
    
    router_b.include_router(router=router_c, prefix="/c")
    router_a.include_router(router=router_b, prefix="/b")
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Feb 08 10:18:38 GMT 2026
    - 3.3K bytes
    - Click Count (0)
  6. src/main/java/jcifs/util/Crypto.java

         */
        public static MessageDigest getMD4() {
            try {
                return MessageDigest.getInstance("MD4", getProvider());
            } catch (final NoSuchAlgorithmException e) {
                throw new CIFSUnsupportedCryptoException(e);
            }
        }
    
        /**
         * Get an MD5 message digest instance.
         * @return MD5 digest instance
         */
        public static MessageDigest getMD5() {
            try {
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Sat Aug 16 01:32:48 GMT 2025
    - 5.7K bytes
    - Click Count (0)
  7. src/test/java/jcifs/util/CryptoTest.java

        void testHashVariousInputSizes(String input) {
            // Given
            byte[] data = input.getBytes();
    
            // When
            MessageDigest md4 = Crypto.getMD4();
            MessageDigest md5 = Crypto.getMD5();
            byte[] md4Hash = md4.digest(data);
            byte[] md5Hash = md5.digest(data);
    
            // Then
            assertNotNull(md4Hash);
            assertNotNull(md5Hash);
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 7.4K bytes
    - Click Count (0)
  8. compat/maven-model-builder/src/main/java/org/apache/maven/model/profile/activation/JdkVersionProfileActivator.java

    import org.apache.maven.model.profile.ProfileActivationContext;
    
    /**
     * Determines profile activation based on the version of the current Java runtime.
     *
     * @see Activation#getJdk()
     * @deprecated use {@code org.apache.maven.api.services.ModelBuilder} instead
     */
    @Named("jdk-version")
    @Singleton
    @Deprecated(since = "4.0.0")
    public class JdkVersionProfileActivator implements ProfileActivator {
    
    Created: Sun Apr 05 03:35:12 GMT 2026
    - Last Modified: Tue Feb 25 08:27:34 GMT 2025
    - 6.6K bytes
    - Click Count (0)
  9. compat/maven-compat/src/main/java/org/apache/maven/profiles/activation/JdkPrefixProfileActivator.java

        }
    
        @Override
        protected boolean canDetectActivation(Profile profile) {
            return profile.getActivation() != null
                    && profile.getActivation().getJdk() != null
                    && !profile.getActivation().getJdk().isEmpty();
        }
    Created: Sun Apr 05 03:35:12 GMT 2026
    - Last Modified: Fri Jun 06 14:28:57 GMT 2025
    - 3K bytes
    - Click Count (0)
  10. docs/en/docs/release-notes.md

    * Make sure the `*` in short features in the docs is consistent (after `.`) in all languages. PR [#1424](https://github.com/tiangolo/fastapi/pull/1424).
    * Update order of execution for `get_db` in SQLAlchemy tutorial. PR [#1293](https://github.com/tiangolo/fastapi/pull/1293) by [@bcb](https://github.com/bcb).
    * Fix typos in Async docs. PR [#1423](https://github.com/tiangolo/fastapi/pull/1423).
    
    ## 0.54.2 (2020-05-16)
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Apr 03 12:07:04 GMT 2026
    - 631K bytes
    - Click Count (0)
Back to Top