Session 8 / 15๐Ÿ”Žืขื‘

In one sentence

Students choose the right database, work with data stores, Airtable and Postgres, and build a secure mini-CRM.

Preparation before the session

Time plan

  1. 00:00โ€“00:15 Review + the midterm exam
  2. 00:15โ€“00:40 Why a database? Sheets vs. a DB
  3. 00:40โ€“01:05 Make's data stores
  4. 01:05โ€“01:20 โ˜• Break
  5. 01:20โ€“01:45 Airtable
  6. 01:45โ€“02:15 A little SQL + Supabase
  7. 02:15โ€“02:50 Building together: a mini-CRM
  8. 02:50โ€“03:00 Summary and practice

Lecture parts and activity type

PartActivity type
Sheets vs. a databaseComparison
Data stores and data structuresDemo
Airtable โ€” a CRM people loveDemo
A little SQLDemo in the SQL Editor
Make + Supabase / PostgresExplanation + simulation
Building together: a mini-CRMBuilding together

The 3 messages that must get across

  1. The tool by the need.
  2. Parameters always.
  3. One source of truth.

Questions for class discussion

  • Where in your organization is there a "sheet that became a system"?
  • Who needs to see data and who needs to edit it?
  • What's the risk in a two-way sync?

Live demo script

A data store as memory

  1. Data structure โ€” Data stores โ†’ Add data store โ†’ Data structure: Add โ†’ fields.
  2. In the scenario โ€” After the clean-up: Data store โ†’ Get a record (key: email).
  3. Filter โ€” count Does not exist.
  4. Update โ€” Add/replace a record: key email, count = ifempty(โ€ฆ)+1, firstSeen = ifempty(โ€ฆ; now).

An Airtable CRM

  1. Base โ€” Contacts (Name, Email, Company), Deals (Name, Contact โŸถ link, Stage, Value).
  2. Token โ€” airtable.com/create/tokens โ†’ scopes data.records:read/write, schema.bases:read โ†’ Base.
  3. Upsert โ€” Airtable โ†’ Upsert a Record (or Search โ†’ Router โ†’ Create/Update).
  4. Deal โ€” Airtable โ†’ Create a Record โ†’ Contact: an array with the id.

Supabase + an API

  1. Table โ€” Supabase โ†’ SQL Editor โ†’ CREATE TABLE.
  2. Connection โ€” PostgreSQL โ†’ Execute a query โ†’ Add connection (Database details โ†’ Connection string).
  3. POST โ€” Webhook โ†’ auth โ†’ Execute a query with parameters โ†’ Create JSON โ†’ 201.
  4. GET โ€” Webhook โ†’ select * from deals where email = $1 โ†’ Array aggregator โ†’ Router 200/404.

Problems students will run into

ProblemQuick fix
Get a record stops when there is no recordIn the settings: make sure the module returns an empty bundle, or use Check the existence.
The key doesn't matchCapital letters/spaces.
INVALID_MULTIPLE_CHOICE_OPTIONSA Stage value that doesn't exist in the single select.
403The token wasn't given access to this base.
connection refused / timeoutWrong host/port or SSL off.
permission denied for tableThe connection's user has no permissions โ€” use postgres or set up GRANT.
Telegram was sent 4 timesThe Text aggregator is missing.
total arrives as textPostgres numeric โ€” parseNumber.

Tips from the classroom

  • Connecting Postgres to Supabase is the hurdle โ€” prepare a ready connection string.
  • Demonstrate SQL injection on a test database.
  • The Increment function is a pleasant surprise.

Adapting to different levels

For students who struggle: A data store + Airtable only.

For fast students: RPC and the stage history.

Answer key โ€” multiple-choice questions

Students see the answers in shuffled order, so the key gives the wording of the right answer.

#Right answer
1A small table inside Make with a key and a data structure
2A relation between records in different tables
3SELECT stage, SUM(value) FROM deals GROUP BY stage
4In a connection / Keychain
5Returns the new record's id
6When there is a lot of data, relations, and parallel work
7Whether a key exists (Boolean)
8Filters on Airtable's side

Homework

  1. An active mini-CRM.
  2. Preparing for session 9: create an API key at OpenAI or Anthropic (or make sure you have access to the Make AI Provider). A Gmail account with 10 sample emails.