Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 55 for sqlmodel (0.05 seconds)

  1. docs/en/docs/how-to/testing-database.md

    # Testing a Database { #testing-a-database }
    
    You can study about databases, SQL, and SQLModel in the [SQLModel docs](https://sqlmodel.tiangolo.com/). ๐Ÿค“
    
    There's a mini [tutorial on using SQLModel with FastAPI](https://sqlmodel.tiangolo.com/tutorial/fastapi/). โœจ
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 393 bytes
    - Click Count (0)
  2. docs_src/sql_databases/tutorial001_py310.py

    from fastapi import Depends, FastAPI, HTTPException, Query
    from sqlmodel import Field, Session, SQLModel, create_engine, select
    
    
    class Hero(SQLModel, table=True):
        id: int | None = Field(default=None, primary_key=True)
        name: str = Field(index=True)
        age: int | None = Field(default=None, index=True)
        secret_name: str
    
    
    sqlite_file_name = "database.db"
    sqlite_url = f"sqlite:///{sqlite_file_name}"
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Oct 09 19:44:42 GMT 2024
    - 1.7K bytes
    - Click Count (0)
  3. docs_src/sql_databases/tutorial001_an_py310.py

    from typing import Annotated
    
    from fastapi import Depends, FastAPI, HTTPException, Query
    from sqlmodel import Field, Session, SQLModel, create_engine, select
    
    
    class Hero(SQLModel, table=True):
        id: int | None = Field(default=None, primary_key=True)
        name: str = Field(index=True)
        age: int | None = Field(default=None, index=True)
        secret_name: str
    
    
    sqlite_file_name = "database.db"
    sqlite_url = f"sqlite:///{sqlite_file_name}"
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Oct 09 19:44:42 GMT 2024
    - 1.7K bytes
    - Click Count (0)
  4. docs_src/sql_databases/tutorial002_py310.py

    from fastapi import Depends, FastAPI, HTTPException, Query
    from sqlmodel import Field, Session, SQLModel, create_engine, select
    
    
    class HeroBase(SQLModel):
        name: str = Field(index=True)
        age: int | None = Field(default=None, index=True)
    
    
    class Hero(HeroBase, table=True):
        id: int | None = Field(default=None, primary_key=True)
        secret_name: str
    
    
    class HeroPublic(HeroBase):
        id: int
    
    
    class HeroCreate(HeroBase):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Oct 09 19:44:42 GMT 2024
    - 2.5K bytes
    - Click Count (0)
  5. docs_src/dependencies/tutorial014_an_py310.py

    import time
    from typing import Annotated
    
    from fastapi import Depends, FastAPI, HTTPException
    from fastapi.responses import StreamingResponse
    from sqlmodel import Field, Session, SQLModel, create_engine
    
    engine = create_engine("postgresql+psycopg://postgres:postgres@localhost/db")
    
    
    class User(SQLModel, table=True):
        id: int | None = Field(default=None, primary_key=True)
        name: str
    
    
    app = FastAPI()
    
    
    def get_session():
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Mon Sep 29 03:29:38 GMT 2025
    - 957 bytes
    - Click Count (0)
  6. docs_src/sql_databases/tutorial002_an_py310.py

    from typing import Annotated
    
    from fastapi import Depends, FastAPI, HTTPException, Query
    from sqlmodel import Field, Session, SQLModel, create_engine, select
    
    
    class HeroBase(SQLModel):
        name: str = Field(index=True)
        age: int | None = Field(default=None, index=True)
    
    
    class Hero(HeroBase, table=True):
        id: int | None = Field(default=None, primary_key=True)
        secret_name: str
    
    
    class HeroPublic(HeroBase):
        id: int
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Oct 09 19:44:42 GMT 2024
    - 2.5K bytes
    - Click Count (0)
  7. docs_src/dependencies/tutorial013_an_py310.py

    import time
    from typing import Annotated
    
    from fastapi import Depends, FastAPI, HTTPException
    from fastapi.responses import StreamingResponse
    from sqlmodel import Field, Session, SQLModel, create_engine
    
    engine = create_engine("postgresql+psycopg://postgres:postgres@localhost/db")
    
    
    class User(SQLModel, table=True):
        id: int | None = Field(default=None, primary_key=True)
        name: str
    
    
    app = FastAPI()
    
    
    def get_session():
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Mon Sep 29 03:29:38 GMT 2025
    - 937 bytes
    - Click Count (0)
  8. fastapi/.agents/skills/fastapi/references/other-tools.md

        return f"Hello {name}"
    
    
    @app.get("/items/")
    def read_items():
        result = syncify(do_async_work)(name="World")
        return {"message": result}
    ```
    
    ## SQLModel for SQL databases
    
    When working with SQL databases, prefer using SQLModel as it is integrated with Pydantic and will allow declaring data validation with the same models.
    
    Prefer it over SQLAlchemy.
    
    ## HTTPX
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 01 10:05:57 GMT 2026
    - 1.5K bytes
    - Click Count (0)
  9. docs/ko/docs/project-generation.md

    ## Full Stack FastAPI ํ…œํ”Œ๋ฆฟ - ๊ธฐ์ˆ  ์Šคํƒ๊ณผ ๊ธฐ๋Šฅ๋“ค { #full-stack-fastapi-template-technology-stack-and-features }
    
    - โšก Python ๋ฐฑ์—”๋“œ API๋ฅผ ์œ„ํ•œ [**FastAPI**](https://fastapi.tiangolo.com/ko).
        - ๐Ÿงฐ Python SQL ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์ƒํ˜ธ์ž‘์šฉ์„ ์œ„ํ•œ [SQLModel](https://sqlmodel.tiangolo.com) (ORM).
        - ๐Ÿ” FastAPI์— ์˜ํ•ด ์‚ฌ์šฉ๋˜๋Š”, ๋ฐ์ดํ„ฐ ๊ฒ€์ฆ๊ณผ ์„ค์ • ๊ด€๋ฆฌ๋ฅผ ์œ„ํ•œ [Pydantic](https://docs.pydantic.dev).
        - ๐Ÿ’พ SQL ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋กœ์„œ์˜ [PostgreSQL](https://www.postgresql.org).
    - ๐Ÿš€ ํ”„๋ก ํŠธ์—”๋“œ๋ฅผ ์œ„ํ•œ [React](https://react.dev).
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:06:26 GMT 2026
    - 2.3K bytes
    - Click Count (0)
  10. docs/zh-hant/docs/project-generation.md

    ## ๅ…จ็ซฏ FastAPI ็ฏ„ๆœฌ - ๆŠ€่ก“ๅ †็–Š่ˆ‡ๅŠŸ่ƒฝ { #full-stack-fastapi-template-technology-stack-and-features }
    
    - โšก [**FastAPI**](https://fastapi.tiangolo.com/zh-hant) ไฝœ็‚บ Python ๅพŒ็ซฏ APIใ€‚
      - ๐Ÿงฐ [SQLModel](https://sqlmodel.tiangolo.com) ไฝœ็‚บ Python ่ˆ‡ SQL ่ณ‡ๆ–™ๅบซไบ’ๅ‹•๏ผˆORM๏ผ‰ใ€‚
      - ๐Ÿ” [Pydantic](https://docs.pydantic.dev)๏ผˆ็”ฑ FastAPI ไฝฟ็”จ๏ผ‰็”จๆ–ผ่ณ‡ๆ–™้ฉ—่ญ‰่ˆ‡่จญๅฎš็ฎก็†ใ€‚
      - ๐Ÿ’พ [PostgreSQL](https://www.postgresql.org) ไฝœ็‚บ SQL ่ณ‡ๆ–™ๅบซใ€‚
    - ๐Ÿš€ [React](https://react.dev) ไฝœ็‚บๅ‰็ซฏใ€‚
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 1.8K bytes
    - Click Count (0)
Back to Top