0PricingLogin
Flask Academy · Lesson

Columns, Types, and Constraints

Pick column types and add nullable and unique.

Types Shape Your Data

Every column has a type that decides what it can hold and how the database stores it. Picking the right one keeps data clean. 🎯

Integer for Whole Numbers

Use db.Integer for counts, ids, and ages. It stores whole numbers efficiently and is the usual choice for primary keys.

age = db.Column(db.Integer)

All lessons in this course

  1. Install and Configure the Extension
  2. Define Your First Model Class
  3. Columns, Types, and Constraints
  4. Create the Schema with create_all
← Back to Flask Academy