Chapter 14: Data and failure

Table and row

A table is a named collection of records that all have the same fields, like a strict spreadsheet. A row is one record, such as one order. A column is one field, such as its total, and every value in it is the same kind of thing.

Agents copy the shape of the objects in their code straight into tables, often one big table with a text column full of JSON. It runs, and then it can't be searched, checked or joined. Describing the tables yourself is one of the cheapest ways to steer the whole design.

Say it to your agent

“Use three tables: customers, orders and order_items, with one row per thing and no JSON columns for data we filter on. Every list query needs an ORDER BY, ending in the primary key so that the order is stable.”

The workshop

Name a word, or describe what you mean in everyday language.