Week 6: Data Types and Test Data
Due: Wednesday, Sep 30th
Thursday's class sets up virtual environments and generates data with Faker. The type hints reading is background for SQLModel in October, and it is the shortest of the three.
Prompt
Paste the standard prompt, then paste this block.
Topic: PostgreSQL data types, generating test data, and Python
type hints.
My learning objectives:
- Choose an appropriate PostgreSQL data type for a column, and
explain the choice.
- Generate realistic values using Faker providers.
- Read and write Python type hints for variables, parameters,
and return values.
Show me where this lives in the documentation. Tell me what the
official docs call each thing and roughly where to find it, and
give me search terms, rather than explaining everything yourself.
Sources
- Chapter 8: Data Types in the PostgreSQL 16 documentation. Skim the chapter to see what exists, then read closely on the types you expect to use: numeric, character, date and time, and boolean.
- Faker documentation, especially the standard providers.
- Python Types Intro from the FastAPI documentation.
Why type hints now
Type hints are not required in Python and you may not have seen them in earlier courses. SQLModel uses them to define tables, so a class attribute's type annotation becomes a column's data type. Reading this page now means October will be about databases rather than about syntax.