Programming tutorial - IT technology blog

SQLModel in FastAPI: Building Type-Safe APIs Without the Pydantic + SQLAlchemy Boilerplate

SQLModel unifies SQLAlchemy ORM and Pydantic validation in a single class definition, eliminating the need to maintain synchronized database and API schemas. After six months in production, it has consistently reduced model code by around 40% with no loss in type safety. This guide covers the complete workflow: quick setup, the Base/Table/Read class pattern, relationships, Alembic migrations, async support, and the production gotchas worth knowing before you hit them.
Programming tutorial - IT technology blog

Modern Java with Records, Sealed Classes, and Pattern Matching: Write Cleaner, Safer Code in Java 17–21

Java Records, Sealed Classes, and Pattern Matching — stable since Java 17 and fully mature in Java 21 — cut boilerplate dramatically, make type hierarchies exhaustive by design, and push invalid states to compile-time errors instead of runtime surprises. This guide walks through all three with practical examples: from a one-line Point record to sealed event hierarchies and record deconstruction in switch expressions.