Database

Store structured content in PloyDB (Ploy DB) — a built-in database (DB) you edit like a spreadsheet, and use across your site, your automations, and Ploy's Agent.

A database is for structured data — content organized into fields, where every entry of a kind shares the same shape. Blog posts, job listings, team members, products, form submissions: each gets its own table, with the same columns on every row. Keep it in one place, and your site, your team, and Ploy's Agent all work from that single source.

One common use is as a CMS for your site. Ploy's Agent builds one template that turns every row into its own page, so publishing a post or a listing is as simple as adding a record — and you write and manage it all right in the table. No code, and no page to build each time.

You don't need to write database code. Ask Ploy's Agent to set up or edit tables, columns, records, and the pages that use them, or manage everything visually. Find your databases under Databases in the workspace sidebar.


When to Use a Database

Reach for a database whenever content repeats in a consistent shape:

  • Blog and changelog posts — announcements, release notes, updates.
  • Listings and directories — jobs, team members, customers, events.
  • Catalogs — products, pricing tiers, features.
  • Form submissions — contact requests, waitlist signups, RSVPs.
  • App data — accounts, users, sessions, and other application records.

Rule of thumb: if you'd keep it in a spreadsheet, it belongs in a database. For one-off content — a homepage hero, an About page — just edit the page. Running a blog? CMS & Blogging covers that end to end, and we recommend backing it with a database.


Core Concepts

TermDescription
DatabaseThe top-level container, owned by your workspace. Create as many as you need.
TableOne collection of things — Jobs, Team, Posts. A database holds many.
ColumnA typed property on a table — Title, Status, Published date.
RecordA single row — one job, one person, one entry.
Access keyA scoped credential that lets your published site read or write specific tables.

Creating a Database

Describe what you're modeling and let Ploy's Agent set it up:

  • "A database for job listings with title, department, location, and a status"
  • "A customer directory — company, industry, logo, and a link to their case study"

Ploy's Agent proposes the tables and columns and creates them once you approve; you can also build them by hand when Databases is available in your workspace. You don't have to start empty: choose Import CSV and point it at a new or existing table. Ploy reads the first row as your column names and picks a sensible type for each.

Migrating from another CMS?

You do not have to start with an empty database or a CSV. Paste your site URL into chat and ask Ploy to analyze the existing CMS. Ploy can map supported collections into PloyDB tables, let you review the proposed import, and then bring the records over. See Migrate CMS Content to PloyDB for supported sources and the full workflow.


Editing Your Data

The grid works like a spreadsheet:

  • Edit inline — click a cell and type; changes save as you go.
  • Record panel — open a single row to see all its fields in one view, easier for long values.
  • Filter, sort, reorder — filter any column, sort by any column, and drag rows and columns into the order you want.
  • Live updates — changes appear as they happen, including new submissions from your live site, with no refresh.

Columns can be text or long text, number, currency, or percent, checkbox, single- or multi-select, status, people, date, URL, email, or Relation. A Relation links records in compatible tables. Change a column's type later and Ploy converts the existing values for you; if a value can't convert, it stops and shows you which rows to fix.

  1. Open Databases, select a database, then select a table.
  2. Choose Add property, then Relation.
  3. Select the related table and link the relevant records.
  4. Check the links in the table before relying on them in a workflow.

Inspect relationships in Diagram view

Open a table, choose Add view, then Diagram. Inspect its cards and connections to understand how records relate.

A diagram is most useful when the table has meaningful relations. Creating the view does not invent missing links. Viewing a diagram is different from editing records; to change a relationship, update the relevant records in the table and check the links again.

Export a table view as CSV

Open Databases, choose a dataset, open its active Table view menu labelled Table, then select Export current view CSV. Dataset options are separate from the Table view menu. CSV export is available for Table views, not Kanban views.

The export includes every row matching the active search, filters, and sort order across pagination, up to 10,000 rows. It also preserves the visible columns and their current order. If more than 10,000 rows match, the dashboard warns that the downloaded result was truncated.

Workspace members with access to the database can export a Table view.

CSV is for interchange, not backup. An export is not a lossless backup or a consistent snapshot while records are changing. Options export as labels, list values use semicolons, checkboxes use true/false, and files export only their names. Exact option identity, labels that contain separators, file references, empty versus null values, and formula-like text may not round-trip exactly if you re-import the CSV.


Powering Pages with Your Data

Describe the page and Ploy's Agent builds it from your table, layout and all:

"Build a /jobs page listing every open role by department, with a detail page for each."

A page built this way keeps itself current: your edits reach visitors on their own, usually within a minute, with no republish. It stays fast, too, even with a lot of records.

Your site can collect information, too. Ask for a contact form, a waitlist, or an RSVP, and every submission lands straight in a table.

Browse generated pages in Pages Manager

When a database-backed dynamic route is connected to a table, expand that route in Pages. The expanded view lists its records with search and pagination, so you can find the entry you want without scanning the whole table.

Select a record to preview the real generated URL for that entry. Records shown only to demonstrate the route are clearly labelled Placeholder; they are not live content records. Choose records from the expanded route in Pages Manager, not from the preview URL bar.

Record actions

  • Chat about this: start a chat with the selected record already in context.
  • Run: appears when a text field on the table has been marked as the prompt. It runs that prompt for the selected record.
  • Related work: shows chats and artifacts associated with the record, so you can return to earlier work.

For the content workflow built on top of these records and routes, see CMS & Blogging.


Access Keys

A published site can't sign in the way you do, so it reaches a database with its own credential: an access key.

When Ploy's Agent builds a page that reads from a database, it creates the appropriate key and adds it to your site after you approve. The key's value isn't exposed along the way. To create, roll, or revoke keys yourself, open Manage access on the database (owner/admin only).

Every key belongs to one database. For each table, grant read access, write access, both, or neither. New keys have no table access until you configure them, and write-only keys can't read data back. A common setup uses a read-only key for pages that display content and a write-only key for forms.

Heads up: A key's value is shown once, when you create or roll it — Ploy doesn't keep a copy you can look up later. Copy it right then; if you lose it, roll for a new one.

A key lives as a Secret in your site's Environment Variables under a name you choose (e.g. JOBS_READ_TOKEN). When Ploy's Agent creates a key for a page it built, it sets that secret for you; if you make one yourself, you add it the same way. It takes effect the next time you publish. Later, you can roll a key to replace a leaked one, revoke it to turn it off, or change which tables it can reach.

Building outside Ploy? See Use PloyDB from your own app for the server-side API, authentication, and read and write examples.


Version history and restore

Ploy keeps a rolling 30-day history of every database. You can create a named restore point before a risky change, or roll the database back to any point in the last 30 days. Before a rollback, Ploy automatically creates an undo point, so you can reverse the restore if needed. Only workspace owners and admins can restore a database.


Secret Columns

Some columns hold sensitive values — a password hash, a session token, a user's API key. Ploy hides these from Ploy's Agent, so they never show up in a chat. Columns that look like credentials are hidden automatically, and you can flag any column yourself with Mark as secret. Only a person can un-hide one: Ploy's Agent can mark a column secret, but never reveal it.


Good to Know

  • From your own app — Use the external-app API from a backend, serverless function, or mobile client.
  • From the terminal — the PloyDB CLI lists databases, queries tables, exports table data, and bulk-imports CSVs for automations and agents.
  • Limits — up to 97 columns per table and 128 KB per text value; CSV imports up to 32 MB. Writes from published sites are rate-limited to help protect a database from abuse.

What's Next?