A prototype that only shows sample data tells you half the story. The interesting questions come once the data is real. Is the list too long? Is that field ever empty? Does the screen still make sense with your actual records in it?

Ynch apps can read and write your own Supabase or MySQL database. This walk-through puts a Supabase table into a list on your iPhone. It uses the same steps as the Connect a database tutorial, which has every file in full.

How it stays safe

Two rules carry most of the weight.

The app holds no credentials. Your Supabase URL and key are entered once in Ynch Studio and stored there, encrypted. The app’s files only name a connection.

The app can only do what you approved. Every read and write is declared as an operation: which table, which columns, which filters, how many rows. When a new version asks for something new, Studio lists it in plain words, such as “Read a list of rows from topics”, and nothing runs until you accept.

Use your Supabase project’s anon (publishable) key, never the service role key. With the anon key, your row level security policies stay in charge of who sees what.

1. Connect the database in Studio

In Studio, open your project, go to Database and choose Supabase. Give the connection a name and enter your project URL and anon key. Studio tests the connection before it saves it.

2. Name the connection in the app

.ynch/connections.json says which connection the app uses. There is no address and no key in it:

{
  "schemaVersion": "1.0.0",
  "connections": {
    "primary": { "cloudConnectionId": "conn_main", "provider": "supabase" }
  }
}

3. Describe a row

Say the table is topics, with id, name and description. A model in .ynch/models/topic.json describes one row: each field, its type and its limits.

4. Declare the read

An operation in .ynch/operations/list-topics.json is the whole of what the app may do with that table:

{
  "schemaVersion": "1.0.0",
  "id": "list-topics",
  "kind": "list",
  "connection": "primary",
  "connector": "supabase",
  "resource": "topics",
  "columns": ["id", "name", "description"],
  "responseModel": "topic",
  "parameters": {},
  "filters": [],
  "sort": [{ "field": "name", "direction": "asc" }, { "field": "id", "direction": "asc" }],
  "maxRows": 50,
  "pagination": { "mode": "offset", "defaultLimit": 25, "maxOffset": 10000 }
}

Three columns, sorted by name, at most 50 rows at a time. The sort always ends with the identity field so that paging is stable.

5. Show the rows

On a screen, a RecordList bound to that operation draws its child once per row. A Card with two Text components bound to name and description is enough for a first look.

6. Upload and accept

npx ynch check
npx ynch upload

In Studio, on Releases: approve and sign the draft, make it active, then Accept database changes after reading what the app asks for. Open the app on your iPhone and the list loads from your database.

Letting a coding agent do it

All of this is plain JSON, so a coding agent can write it. Give it the table’s columns and what you want on screen, point it at docs.ynch.ai/llms.txt, and have it run npx ynch check after every change. Keep the URL and key out of the conversation: they belong in Studio, and ynch check refuses files that contain addresses, hosts or keys.

Where to go next

  • Models and operations: filters, parameters and writing data back.
  • App sign-in: let your app’s users sign in with Supabase accounts and see only their own rows.
  • Photos and PDFs can be kept with Ynch or in your own Supabase storage.

Northline Builders, the showcase app, runs on a live database: projects, budgets, daily logs and photos, all through operations like the one above.