{"product_id":"fastapi-with-postgresql-and-sqlalchemy-liora-byteforge-9798170303892","title":"FastAPI with PostgreSQL and SQLAlchemy: Build database-driven Python APIs with FastAPI, PostgreSQL, SQLAlchemy, Alembic, relationships, CRUD operation","description":"\u003cp\u003e\u003cb\u003eMove beyond basic FastAPI routes and learn how to build database-backed Python APIs that are structured for real-world development.\u003c\/b\u003e\u003c\/p\u003e\u003cp\u003eFastAPI makes it easy to create modern APIs-but production applications need reliable persistence, safe database operations, maintainable models, controlled schema changes, and efficient queries.\u003c\/p\u003e\u003cp\u003e\u003cb\u003eFastAPI with PostgreSQL and SQLAlchemy\u003c\/b\u003e takes you step by step through building a practical relational database layer for FastAPI using modern Python development practices.\u003c\/p\u003e\u003cp\u003eInstead of disconnected examples, you will build and evolve a realistic \u003cb\u003eSupportDesk API\u003c\/b\u003e, learning how customers, tickets, comments, and tags fit together inside a relational backend.\u003c\/p\u003e\u003cp\u003eYou will learn how to: \u003c\/p\u003e\u003cul\u003e\n\u003cli\u003eConnect FastAPI to PostgreSQL with \u003cb\u003eSQLAlchemy 2.x and Psycopg 3\u003c\/b\u003e\n\u003c\/li\u003e\n\u003cli\u003eConfigure database URLs and manage SQLAlchemy Engines and Sessions safely\u003c\/li\u003e\n\u003cli\u003eDesign modern ORM models with Mapped, mapped_column, constraints, defaults, indexes, and timestamps\u003c\/li\u003e\n\u003cli\u003eManage database schema changes with \u003cb\u003eAlembic migrations\u003c\/b\u003e\n\u003c\/li\u003e\n\u003cli\u003eBuild complete \u003cb\u003eCreate, Read, Update, and Delete (CRUD)\u003c\/b\u003e APIs\u003c\/li\u003e\n\u003cli\u003eSeparate database operations from FastAPI route logic\u003c\/li\u003e\n\u003cli\u003eModel \u003cb\u003eone-to-many and many-to-many relationships\u003c\/b\u003e\n\u003c\/li\u003e\n\u003cli\u003eWork with foreign keys, association tables, cascades, and related data\u003c\/li\u003e\n\u003cli\u003ePrevent N+1 query problems with deliberate relationship loading\u003c\/li\u003e\n\u003cli\u003eConnect \u003cb\u003ePydantic schemas\u003c\/b\u003e cleanly to SQLAlchemy ORM models\u003c\/li\u003e\n\u003cli\u003eAdd filtering, sorting, and pagination to database queries\u003c\/li\u003e\n\u003cli\u003eHandle database errors, transactions, commits, and rollbacks correctly\u003c\/li\u003e\n\u003cli\u003eImprove query performance with indexes, bounded queries, and PostgreSQL execution plans\u003c\/li\u003e\n\u003cli\u003eManage environment configuration, secrets, and connection pooling\u003c\/li\u003e\n\u003cli\u003eTest real PostgreSQL database operations\u003c\/li\u003e\n\u003cli\u003ePrepare Alembic migrations and FastAPI database infrastructure for production deployment\u003c\/li\u003e\n\u003c\/ul\u003e\u003cp\u003eThe book focuses on \u003cb\u003emodern SQLAlchemy 2.x patterns\u003c\/b\u003e, avoiding outdated session.query() tutorials and unnecessary architectural complexity. Each concept is introduced when it becomes useful, with practical code and clear explanations of what FastAPI, SQLAlchemy, Psycopg, Alembic, Pydantic, and PostgreSQL are each responsible for.\u003c\/p\u003e\u003cp\u003eThis book is ideal for Python developers who already understand basic FastAPI concepts and are ready to build APIs that store and manage real relational data. No advanced PostgreSQL or SQLAlchemy experience is required.\u003c\/p\u003e\u003cp\u003eBy the end, you will understand not only how to connect FastAPI to a database, but how to design a database-backed API that is \u003cb\u003emaintainable, testable, transaction-safe, migration-ready, and prepared for production\u003c\/b\u003e.\u003c\/p\u003e\u003cp\u003e\u003cb\u003eBuild the database foundation your FastAPI applications need to grow beyond simple demos and into real backend systems.\u003c\/b\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003eBook 2 of the FastAPI Development Series.\u003c\/b\u003e\u003c\/p\u003e\u003cbr\u003e\u003cbr\u003e\u003cb\u003eAuthor:\u003c\/b\u003e Liora Byteforge\u003cbr\u003e\u003cb\u003eISBN-13:\u003c\/b\u003e 9798170303892\u003cbr\u003e\u003cb\u003ePublisher:\u003c\/b\u003e Independently Published\u003cbr\u003e\u003cb\u003eLanguage:\u003c\/b\u003e English\u003cbr\u003e\u003cb\u003ePublished:\u003c\/b\u003e 08\/27\/2026\u003cbr\u003e\u003cb\u003ePages:\u003c\/b\u003e 398\u003cbr\u003e\u003cb\u003eFormat:\u003c\/b\u003e Paperback\u003cbr\u003e\u003cb\u003eWeight:\u003c\/b\u003e 1.52lbs\u003cbr\u003e\u003cb\u003eSize:\u003c\/b\u003e 10.00h x 7.00w x 0.82d","brand":"Liora Byteforge","offers":[{"title":"Paperback","offer_id":50593664237823,"sku":"9798170303892","price":24.99,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0662\/2982\/9887\/files\/img_049de09f-d34b-4366-96d0-43e5f51d9e2c.jpg?v=1791122650","url":"https:\/\/www.whiterainbookhouse.com\/products\/fastapi-with-postgresql-and-sqlalchemy-liora-byteforge-9798170303892","provider":"WR Book House","version":"1.0","type":"link"}