{"id":38538,"date":"2024-11-01T18:18:03","date_gmt":"2024-11-01T18:18:03","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=38538"},"modified":"2024-11-26T06:44:03","modified_gmt":"2024-11-26T06:44:03","slug":"fastapi-%ec%84%9c%eb%b2%84%ea%b0%9c%eb%b0%9c-%eb%b9%84%eb%8f%99%ea%b8%b0-%eb%8d%b0%ec%9d%b4%ed%84%b0%eb%b2%a0%ec%9d%b4%ec%8a%a4-%ec%97%b0%eb%8f%99-async-sqlalchemy-tortoise-orm","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/38538\/","title":{"rendered":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \ube44\ub3d9\uae30 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc5f0\ub3d9 (async SQLAlchemy, Tortoise ORM)"},"content":{"rendered":"<p><body><\/p>\n<div class=\"section\">\n<p>FastAPI\ub294 \ube44\ub3d9\uae30 \uc9c0\uc6d0\uc744 \uae30\ubcf8\uc73c\ub85c \uc81c\uacf5\ud558\uc5ec \ub192\uc740 \uc131\ub2a5\uacfc \ud6a8\uc728\uc131\uc744 \uc790\ub791\ud558\ub294 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\uc785\ub2c8\ub2e4. \uc774\ub7ec\ud55c FastAPI\uc758 \uc7a5\uc810\uc740 \ube44\ub3d9\uae30 \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub97c \ud1b5\ud574 \ub354\uc6b1 \uadf9\ub300\ud654\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ubcf8 \uac15\uc88c\uc5d0\uc11c\ub294 FastAPI\uc640 \ud568\uaed8 \uc0ac\uc6a9\ud560 \uc218 \uc788\ub294 \ub450 \uac00\uc9c0 \ube44\ub3d9\uae30 \ub370\uc774\ud130\ubca0\uc774\uc2a4 ORM\uc778 <strong>async SQLAlchemy<\/strong>\uc640 <strong>Tortoise ORM<\/strong>\uc744 \uc774\uc6a9\ud55c \uc11c\ubc84 \uac1c\ubc1c \ubc29\ubc95\uc744 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n<\/div>\n<div class=\"section\">\n<h2>1. FastAPI \uc18c\uac1c<\/h2>\n<p>FastAPI\ub294 Python\uc73c\ub85c \uc791\uc131\ub41c \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \ube60\ub974\uace0 \uac04\ud3b8\ud558\uac8c RESTful API\ub97c \uac1c\ubc1c\ud560 \uc218 \uc788\ub3c4\ub85d \ub3c4\uc640\uc90d\ub2c8\ub2e4. FastAPI\ub294 Starlette\uc744 \uae30\ubc18\uc73c\ub85c \ud558\uc5ec \uad6c\ud604\ub418\uc5c8\uc73c\uba70, \ud0c0\uc785 \ud78c\ud2b8\ub97c \ud65c\uc6a9\ud558\uc5ec \uc790\ub3d9\uc73c\ub85c API \ubb38\uc11c\ub97c \uc0dd\uc131\ud569\ub2c8\ub2e4. \uc774\ub7ec\ud55c \ud2b9\uc131 \ub355\ubd84\uc5d0 FastAPI\ub294 \ub192\uc740 \uc0dd\uc0b0\uc131\uacfc \uc131\ub2a5\uc744 \uc81c\uacf5\ud558\uba70, \ub300\uaddc\ubaa8 \uc11c\ube44\uc2a4\uc640 \uc2e4\uc2dc\uac04 API\uc5d0 \uc801\ud569\ud55c \uc120\ud0dd\uc774 \ub429\ub2c8\ub2e4.<\/p>\n<\/div>\n<div class=\"section\">\n<h2>2. \ube44\ub3d9\uae30 \ud504\ub85c\uadf8\ub798\ubc0d \uac1c\ub150<\/h2>\n<p>\ube44\ub3d9\uae30 \ud504\ub85c\uadf8\ub798\ubc0d\uc740 \ud0dc\uc2a4\ud06c\ub97c \ub3d9\uc2dc\uc5d0 \ucc98\ub9ac\ud560 \uc218 \uc788\ub3c4\ub85d \ud574\uc8fc\ub294 \ud504\ub85c\uadf8\ub798\ubc0d \ubaa8\ub378\uc785\ub2c8\ub2e4. \uc77c\ubc18\uc801\uc778 \ub3d9\uae30 \ud504\ub85c\uadf8\ub798\ubc0d\uc5d0\uc11c\ub294 \ud558\ub098\uc758 \uc791\uc5c5\uc774 \ub05d\ub09c \ud6c4 \ub2e4\uc74c \uc791\uc5c5\uc744 \uc2dc\uc791\ud558\ub294 \ubc29\uc2dd\uc774\uc9c0\ub9cc, \ube44\ub3d9\uae30 \ud504\ub85c\uadf8\ub798\ubc0d\uc5d0\uc11c\ub294 \uc791\uc5c5\uc744 \uae30\ub2e4\ub9ac\ub294 \ub3d9\uc548 \ub2e4\ub978 \uc791\uc5c5\uc744 \uc218\ud589\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc774\ub85c \uc778\ud574 I\/O \uc791\uc5c5\uc5d0 \uc18c\uc694\ub418\ub294 \uc2dc\uac04\uc744 \uc904\uc77c \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<\/div>\n<div class=\"section\">\n<h2>3. async SQLAlchemy<\/h2>\n<h3>3.1 \uc18c\uac1c<\/h3>\n<p>SQLAlchemy\ub294 Python\uc5d0\uc11c \uac00\uc7a5 \ub110\ub9ac \uc0ac\uc6a9\ub418\ub294 ORM(Object Relational Mapping) \ub77c\uc774\ube0c\ub7ec\ub9ac\uc785\ub2c8\ub2e4. <strong>async SQLAlchemy<\/strong>\ub294 \ube44\ub3d9\uae30 I\/O\ub97c \uc9c0\uc6d0\ud558\ub294 SQLAlchemy\uc758 \ud655\uc7a5\uc73c\ub85c, FastAPI\uc640 \ud568\uaed8 \uc0ac\uc6a9\ud560 \uc218 \uc788\ub294 \uac15\ub825\ud55c \ub3c4\uad6c\uc785\ub2c8\ub2e4.<\/p>\n<h3>3.2 \uc124\uce58<\/h3>\n<pre><code>pip install sqlalchemy[asyncio] asyncpg<\/code><\/pre>\n<h3>3.3 \uae30\ubcf8 \uc0ac\uc6a9\ubc95<\/h3>\n<p>async SQLAlchemy\ub97c \uc0ac\uc6a9\ud558\uc5ec FastAPI\uc640 \uc5f0\uacb0\ud558\ub294 \uae30\ubcf8\uc801\uc778 \ubc29\ubc95\uc740 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4:<\/p>\n<pre><code>from fastapi import FastAPI\nfrom sqlalchemy.ext.asyncio import create_async_engine, AsyncSession\nfrom sqlalchemy.orm import sessionmaker, declarative_base\n\nDATABASE_URL = \"postgresql+asyncpg:\/\/user:password@localhost\/dbname\"\nengine = create_async_engine(DATABASE_URL, echo=True)\nSessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine, class_=AsyncSession)\nBase = declarative_base()\n\napp = FastAPI()\n\n# \ub370\uc774\ud130 \ubaa8\ub378 \uc815\uc758\nclass Item(Base):\n    __tablename__ = 'items'\n    \n    id = Column(Integer, primary_key=True, index=True)\n    name = Column(String, index=True)\n    description = Column(String, index=True)\n\n# \ube44\ub3d9\uae30 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc138\uc158 \uad00\ub9ac \ucee4\ub7fd\ud2f4 \ud568\uc218\nasync def get_db():\n    async with SessionLocal() as session:\n        yield session<\/code><\/pre>\n<\/div>\n<div class=\"section\">\n<h3>3.4 CRUD \uc0dd\uc131<\/h3>\n<p>FastAPI\uc5d0\uc11c \ube44\ub3d9\uae30 \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub97c \uc0ac\uc6a9\ud558\uc5ec CRUD(Create, Read, Update, Delete) API\ub97c \ub9cc\ub4dc\ub294 \ubc29\ubc95\uc740 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4:<\/p>\n<pre><code>@app.post(\"\/items\/\")\nasync def create_item(item: Item, db: AsyncSession = Depends(get_db)):\n    db.add(item)\n    await db.commit()\n    await db.refresh(item)\n    return item\n<\/code><\/pre>\n<pre><code>@app.get(\"\/items\/{item_id}\")\nasync def read_item(item_id: int, db: AsyncSession = Depends(get_db)):\n    return await db.get(Item, item_id)\n<\/code><\/pre>\n<pre><code>@app.put(\"\/items\/{item_id}\")\nasync def update_item(item_id: int, item: Item, db: AsyncSession = Depends(get_db)):\n    db_item = await db.get(Item, item_id)\n    if db_item:\n        db_item.name = item.name\n        db_item.description = item.description\n        await db.commit()\n        await db.refresh(db_item)\n        return db_item\n    return {\"error\": \"Item not found\"}\n<\/code><\/pre>\n<pre><code>@app.delete(\"\/items\/{item_id}\")\nasync def delete_item(item_id: int, db: AsyncSession = Depends(get_db)):\n    db_item = await db.get(Item, item_id)\n    if db_item:\n        await db.delete(db_item)\n        await db.commit()\n        return {\"message\": \"Item deleted\"}\n    return {\"error\": \"Item not found\"}\n<\/code><\/pre>\n<\/div>\n<div class=\"section\">\n<h2>4. Tortoise ORM<\/h2>\n<h3>4.1 \uc18c\uac1c<\/h3>\n<p>Tortoise ORM\uc740 \ube44\ub3d9\uae30 \ud658\uacbd\uc744 \uc704\ud574 \uc124\uacc4\ub41c ORM\uc73c\ub85c, \uac04\uacb0\ud558\uace0 \uc0ac\uc6a9\ud558\uae30 \uc26c\uc6b4 API\ub97c \uc81c\uacf5\ud569\ub2c8\ub2e4. \ube44\ub3d9\uae30 \uae30\ubc18\uc758 FastAPI\uc640 \uc798 \uc5b4\uc6b8\ub9bd\ub2c8\ub2e4.<\/p>\n<h3>4.2 \uc124\uce58<\/h3>\n<pre><code>pip install tortoise-orm aiosqlite<\/code><\/pre>\n<h3>4.3 \uae30\ubcf8 \uc0ac\uc6a9\ubc95<\/h3>\n<p>FastAPI\uc640 Tortoise ORM\uc744 \uc5f0\ub3d9\ud558\uae30 \uc704\ud55c \uae30\ubcf8\uc801\uc778 \uc124\uc815\uc740 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4:<\/p>\n<pre><code>from fastapi import FastAPI\nfrom tortoise import fields\nfrom tortoise.models import Model\nfrom tortoise import Tortoise\n\napp = FastAPI()\n\n# \ub370\uc774\ud130 \ubaa8\ub378 \uc815\uc758\nclass Item(Model):\n    id = fields.IntField(pk=True)\n    name = fields.CharField(max_length=255)\n    description = fields.TextField()\n\n# Tortoise \ucd08\uae30\ud654\n@app.on_event(\"startup\")\nasync def startup():\n    await Tortoise.init(\n        db_url='sqlite:\/\/db.sqlite3',\n        modules={\"models\": [\"__main__\"]}\n    )\n    await Tortoise.generate_schemas()\n\n@app.on_event(\"shutdown\")\nasync def shutdown():\n    await Tortoise.close_connections()\n<\/code><\/pre>\n<\/div>\n<div class=\"section\">\n<h3>4.4 CRUD \uc0dd\uc131<\/h3>\n<p>Tortoise ORM\uc744 \uc0ac\uc6a9\ud558\uc5ec CRUD API\ub97c \uad6c\ud604\ud558\ub294 \ubc29\ubc95\uc740 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4:<\/p>\n<pre><code>@app.post(\"\/items\/\")\nasync def create_item(item: Item):\n    await item.save()\n    return item\n<\/code><\/pre>\n<pre><code>@app.get(\"\/items\/{item_id}\")\nasync def read_item(item_id: int):\n    return await Item.get(id=item_id)\n<\/code><\/pre>\n<pre><code>@app.put(\"\/items\/{item_id}\")\nasync def update_item(item_id: int, item: Item):\n    db_item = await Item.get(id=item_id)\n    if db_item:\n        db_item.name = item.name\n        db_item.description = item.description\n        await db_item.save()\n        return db_item\n    return {\"error\": \"Item not found\"}\n<\/code><\/pre>\n<pre><code>@app.delete(\"\/items\/{item_id}\")\nasync def delete_item(item_id: int):\n    db_item = await Item.get(id=item_id)\n    if db_item:\n        await db_item.delete()\n        return {\"message\": \"Item deleted\"}\n    return {\"error\": \"Item not found\"}\n<\/code><\/pre>\n<\/div>\n<div class=\"section\">\n<h2>5. \uacb0\ub860<\/h2>\n<p>FastAPI\ub294 \ube44\ub3d9\uae30 \ucc98\ub9ac\ub97c \uae30\ubcf8\uc73c\ub85c \uc9c0\uc6d0\ud558\uc5ec, \ub192\uc740 \uc131\ub2a5\uc758 API \uc11c\ubc84\ub97c \uc190\uc27d\uac8c \uad6c\ucd95\ud560 \uc218 \uc788\uac8c \ud574\uc90d\ub2c8\ub2e4. async SQLAlchemy\uc640 Tortoise ORM\uc740 \uac01\uac01\uc758 \uc7a5\uc810\uc744 \uac00\uc9c0\uace0 \uc788\uc73c\uba70, \uc0c1\ud669\uc5d0 \ub9de\ucd94\uc5b4 \uc801\uc808\ud55c \uc120\ud0dd\uc744 \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ubcf8 \uac15\uc88c\ub97c \ud1b5\ud574 FastAPI\uc640 \ube44\ub3d9\uae30 \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc758 \ud1b5\ud569 \ubc29\ubc95\uc744 \ubc30\uc6b0\uace0, \uc2e4\uc81c\ub85c API\ub97c \uad6c\ud604\ud574 \ubcf4\uc168\uae30\ub97c \ubc14\ub78d\ub2c8\ub2e4. FastAPI\uc758 \uac15\ub825\ud55c \uae30\ub2a5\uc744 \ud65c\uc6a9\ud558\uc5ec \ud6cc\ub96d\ud55c \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uac1c\ubc1c\ud558\uc2dc\uae30 \ubc14\ub78d\ub2c8\ub2e4.<\/p>\n<\/div>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>FastAPI\ub294 \ube44\ub3d9\uae30 \uc9c0\uc6d0\uc744 \uae30\ubcf8\uc73c\ub85c \uc81c\uacf5\ud558\uc5ec \ub192\uc740 \uc131\ub2a5\uacfc \ud6a8\uc728\uc131\uc744 \uc790\ub791\ud558\ub294 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\uc785\ub2c8\ub2e4. \uc774\ub7ec\ud55c FastAPI\uc758 \uc7a5\uc810\uc740 \ube44\ub3d9\uae30 \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub97c \ud1b5\ud574 \ub354\uc6b1 \uadf9\ub300\ud654\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ubcf8 \uac15\uc88c\uc5d0\uc11c\ub294 FastAPI\uc640 \ud568\uaed8 \uc0ac\uc6a9\ud560 \uc218 \uc788\ub294 \ub450 \uac00\uc9c0 \ube44\ub3d9\uae30 \ub370\uc774\ud130\ubca0\uc774\uc2a4 ORM\uc778 async SQLAlchemy\uc640 Tortoise ORM\uc744 \uc774\uc6a9\ud55c \uc11c\ubc84 \uac1c\ubc1c \ubc29\ubc95\uc744 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. 1. FastAPI \uc18c\uac1c FastAPI\ub294 Python\uc73c\ub85c \uc791\uc131\ub41c \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \ube60\ub974\uace0 \uac04\ud3b8\ud558\uac8c RESTful API\ub97c \uac1c\ubc1c\ud560 &hellip; <a href=\"https:\/\/atmokpo.com\/w\/38538\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;FastAPI \uc11c\ubc84\uac1c\ubc1c, \ube44\ub3d9\uae30 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc5f0\ub3d9 (async SQLAlchemy, Tortoise ORM)&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[183],"tags":[],"class_list":["post-38538","post","type-post","status-publish","format-standard","hentry","category-fastapi"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>FastAPI \uc11c\ubc84\uac1c\ubc1c, \ube44\ub3d9\uae30 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc5f0\ub3d9 (async SQLAlchemy, Tortoise ORM) - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/atmokpo.com\/w\/38538\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"FastAPI \uc11c\ubc84\uac1c\ubc1c, \ube44\ub3d9\uae30 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc5f0\ub3d9 (async SQLAlchemy, Tortoise ORM) - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"FastAPI\ub294 \ube44\ub3d9\uae30 \uc9c0\uc6d0\uc744 \uae30\ubcf8\uc73c\ub85c \uc81c\uacf5\ud558\uc5ec \ub192\uc740 \uc131\ub2a5\uacfc \ud6a8\uc728\uc131\uc744 \uc790\ub791\ud558\ub294 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\uc785\ub2c8\ub2e4. \uc774\ub7ec\ud55c FastAPI\uc758 \uc7a5\uc810\uc740 \ube44\ub3d9\uae30 \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub97c \ud1b5\ud574 \ub354\uc6b1 \uadf9\ub300\ud654\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ubcf8 \uac15\uc88c\uc5d0\uc11c\ub294 FastAPI\uc640 \ud568\uaed8 \uc0ac\uc6a9\ud560 \uc218 \uc788\ub294 \ub450 \uac00\uc9c0 \ube44\ub3d9\uae30 \ub370\uc774\ud130\ubca0\uc774\uc2a4 ORM\uc778 async SQLAlchemy\uc640 Tortoise ORM\uc744 \uc774\uc6a9\ud55c \uc11c\ubc84 \uac1c\ubc1c \ubc29\ubc95\uc744 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. 1. FastAPI \uc18c\uac1c FastAPI\ub294 Python\uc73c\ub85c \uc791\uc131\ub41c \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \ube60\ub974\uace0 \uac04\ud3b8\ud558\uac8c RESTful API\ub97c \uac1c\ubc1c\ud560 &hellip; \ub354 \ubcf4\uae30 &quot;FastAPI \uc11c\ubc84\uac1c\ubc1c, \ube44\ub3d9\uae30 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc5f0\ub3d9 (async SQLAlchemy, Tortoise ORM)&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/38538\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-01T18:18:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-26T06:44:03+00:00\" \/>\n<meta name=\"author\" content=\"root\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:site\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:label1\" content=\"\uae00\uc4f4\uc774\" \/>\n\t<meta name=\"twitter:data1\" content=\"root\" \/>\n\t<meta name=\"twitter:label2\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data2\" content=\"3\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/atmokpo.com\/w\/38538\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38538\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"FastAPI \uc11c\ubc84\uac1c\ubc1c, \ube44\ub3d9\uae30 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc5f0\ub3d9 (async SQLAlchemy, Tortoise ORM)\",\"datePublished\":\"2024-11-01T18:18:03+00:00\",\"dateModified\":\"2024-11-26T06:44:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38538\/\"},\"wordCount\":74,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"FastAPI\uc11c\ubc84\uac1c\ubc1c\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/38538\/\",\"url\":\"https:\/\/atmokpo.com\/w\/38538\/\",\"name\":\"FastAPI \uc11c\ubc84\uac1c\ubc1c, \ube44\ub3d9\uae30 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc5f0\ub3d9 (async SQLAlchemy, Tortoise ORM) - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-01T18:18:03+00:00\",\"dateModified\":\"2024-11-26T06:44:03+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38538\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/38538\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/38538\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"FastAPI \uc11c\ubc84\uac1c\ubc1c, \ube44\ub3d9\uae30 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc5f0\ub3d9 (async SQLAlchemy, Tortoise ORM)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/atmokpo.com\/w\/#website\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/atmokpo.com\/w\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"contentUrl\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"width\":400,\"height\":400,\"caption\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\"},\"image\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/bebubo4\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\",\"name\":\"root\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"caption\":\"root\"},\"sameAs\":[\"http:\/\/atmokpo.com\/w\"],\"url\":\"https:\/\/atmokpo.com\/w\/author\/root\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \ube44\ub3d9\uae30 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc5f0\ub3d9 (async SQLAlchemy, Tortoise ORM) - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/atmokpo.com\/w\/38538\/","og_locale":"ko_KR","og_type":"article","og_title":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \ube44\ub3d9\uae30 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc5f0\ub3d9 (async SQLAlchemy, Tortoise ORM) - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"FastAPI\ub294 \ube44\ub3d9\uae30 \uc9c0\uc6d0\uc744 \uae30\ubcf8\uc73c\ub85c \uc81c\uacf5\ud558\uc5ec \ub192\uc740 \uc131\ub2a5\uacfc \ud6a8\uc728\uc131\uc744 \uc790\ub791\ud558\ub294 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\uc785\ub2c8\ub2e4. \uc774\ub7ec\ud55c FastAPI\uc758 \uc7a5\uc810\uc740 \ube44\ub3d9\uae30 \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub97c \ud1b5\ud574 \ub354\uc6b1 \uadf9\ub300\ud654\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ubcf8 \uac15\uc88c\uc5d0\uc11c\ub294 FastAPI\uc640 \ud568\uaed8 \uc0ac\uc6a9\ud560 \uc218 \uc788\ub294 \ub450 \uac00\uc9c0 \ube44\ub3d9\uae30 \ub370\uc774\ud130\ubca0\uc774\uc2a4 ORM\uc778 async SQLAlchemy\uc640 Tortoise ORM\uc744 \uc774\uc6a9\ud55c \uc11c\ubc84 \uac1c\ubc1c \ubc29\ubc95\uc744 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. 1. FastAPI \uc18c\uac1c FastAPI\ub294 Python\uc73c\ub85c \uc791\uc131\ub41c \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \ube60\ub974\uace0 \uac04\ud3b8\ud558\uac8c RESTful API\ub97c \uac1c\ubc1c\ud560 &hellip; \ub354 \ubcf4\uae30 \"FastAPI \uc11c\ubc84\uac1c\ubc1c, \ube44\ub3d9\uae30 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc5f0\ub3d9 (async SQLAlchemy, Tortoise ORM)\"","og_url":"https:\/\/atmokpo.com\/w\/38538\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-01T18:18:03+00:00","article_modified_time":"2024-11-26T06:44:03+00:00","author":"root","twitter_card":"summary_large_image","twitter_creator":"@bebubo4","twitter_site":"@bebubo4","twitter_misc":{"\uae00\uc4f4\uc774":"root","\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"3\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/atmokpo.com\/w\/38538\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/38538\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \ube44\ub3d9\uae30 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc5f0\ub3d9 (async SQLAlchemy, Tortoise ORM)","datePublished":"2024-11-01T18:18:03+00:00","dateModified":"2024-11-26T06:44:03+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/38538\/"},"wordCount":74,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["FastAPI\uc11c\ubc84\uac1c\ubc1c"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/38538\/","url":"https:\/\/atmokpo.com\/w\/38538\/","name":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \ube44\ub3d9\uae30 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc5f0\ub3d9 (async SQLAlchemy, Tortoise ORM) - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-01T18:18:03+00:00","dateModified":"2024-11-26T06:44:03+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/38538\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/38538\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/38538\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \ube44\ub3d9\uae30 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc5f0\ub3d9 (async SQLAlchemy, Tortoise ORM)"}]},{"@type":"WebSite","@id":"https:\/\/atmokpo.com\/w\/#website","url":"https:\/\/atmokpo.com\/w\/","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","description":"","publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/atmokpo.com\/w\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/atmokpo.com\/w\/#organization","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","url":"https:\/\/atmokpo.com\/w\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/","url":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","contentUrl":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","width":400,"height":400,"caption":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8"},"image":{"@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/bebubo4"]},{"@type":"Person","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7","name":"root","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","caption":"root"},"sameAs":["http:\/\/atmokpo.com\/w"],"url":"https:\/\/atmokpo.com\/w\/author\/root\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38538","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/comments?post=38538"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38538\/revisions"}],"predecessor-version":[{"id":38539,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38538\/revisions\/38539"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=38538"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=38538"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=38538"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}