Skip to main content
Every Lovable Cloud project includes a managed Postgres database. Describe the data your app needs in chat, and Lovable creates the tables and schema for you. For example, tell Lovable:
The Database view lets you inspect and manage that data directly, without writing code. To open it, go to Cloud tab → Database.

View tables and data

The Database view lists your project’s tables and views with their row counts. Tables populate as soon as your app saves information. Click a table to browse its records. Views are read-only. Tables open in an editable records view.

Edit records

Open a table to view and edit its records. Double-click a value to edit it in line. You can also:
  • Filter: add one or more column filters. Available operators depend on the column type, for example equals or contains for text, greater than or less than for numbers, and before or after for dates.
  • Add row: opens a form generated from the table’s schema. Auto-generated columns are filled in for you.
  • Edit row: opens the full row for editing. Updating rows currently supports tables with a single primary key.
  • Delete rows: select rows and click Delete. Deleting rows cannot be undone.
  • Export CSV: download the table’s records as a CSV file.
  • Refresh: reload the table after your app writes new data. The view does not update live.
Records are paginated. You can show 10, 25, 50, or 100 rows per page.
Edits apply directly to your project’s database. On projects with Test and Live environments, check which environment you are viewing before editing. See Test and Live environments.

Run SQL queries

For direct database access, use the SQL editor at Cloud tab → SQL editor:
  • The query editor autocompletes table and column names from your schema.
  • Run executes the query (or press ⌘/Ctrl + Enter), and Clear empties the editor.
  • Results appear in a table below the query. If a query fails, the error message appears in its place.
If a query contains a destructive statement such as DELETE, DROP, TRUNCATE, ALTER, or UPDATE, Lovable asks you to confirm before running it.
You rarely need SQL. For most changes, describing what you want in chat is safer, since Lovable applies schema changes as reviewed migrations and updates your app’s generated types.

Row level security (RLS) policies

Row level security (RLS) controls which data users can access across your database, storage, and realtime features. Think of a policy as a rule that decides which rows a signed-in user can see or change, for example “users can only read their own orders”. Lovable sets up these rules automatically when it builds features that store user data, so one user’s private data is never served to another. To review the rules, go to Cloud tab → Database → RLS policies. The RLS policies view lists each policy with:
  • Policy name: what the rule is for.
  • Command: the action the rule applies to. SELECT is reading data, INSERT is adding it, UPDATE is changing it, and DELETE is removing it.
  • Applies to: which users the rule covers, such as signed-in (authenticated) or anonymous (anon) users.
  • Rule expression: the condition that must be true for the action to be allowed.
You can filter by section (Tables, Storage, or Realtime) and by table. The RLS policies view is read-only. To change a policy, ask Lovable in chat, for example:

Backup and restore

Lovable Cloud takes a daily backup of your project’s database. You can browse and restore them from Cloud tab → Database → Backups. Up to roughly 14 days of backups are retained. Each entry shows the snapshot timestamp in UTC (for example, 18 May 2026, 04:27:12 UTC). Click Restore to this backup on any backup row and confirm in the dialog. Lovable rolls the database back to that point, schema and data, and the project’s database is unavailable for a few minutes while the restore runs.
Restoring is permanent. Any data created or changed after the chosen backup is lost. Because the schema is also reverted, your app may no longer match the database if it changed after the backup.When the restore finishes, ask Lovable in chat to test your app and patch any schema mismatches.
Restoring is available to anyone with edit access to the project. On Enterprise plans, every restore is recorded in your workspace audit log.

Database health check

Get an on-demand snapshot of your Cloud database, including connections, memory, disk usage, uptime, and more, directly from Lovable chat. Prompt Lovable in chat with something like:
Lovable returns a summary of your database’s current status so you can quickly spot issues such as high connection counts, low disk space, or memory pressure before they impact your app.

Find and fix database performance problems

Lovable can pinpoint the slowest queries in your database and use that data to optimize performance, so you can fix real bottlenecks before considering a larger instance. Prompt Lovable in chat with something like:
Lovable reads your database’s query statistics and ranks the heaviest queries by total execution time, with call counts and timing data for each. It then investigates the worst offenders, inspects their query plans, and applies targeted optimizations, such as adding an index, where they help. A few things to know:
  • Query statistics build up as your app handles real traffic. A brand new or recently restarted database may have nothing to report yet.
  • Finding slow queries is read-only. Lovable only changes your database when it applies a fix, and it tells you what it changed.

FAQ

No. Every Cloud project gets its own isolated backend, and there is no way for one project to read another project’s Cloud database. If several apps need to share one database, connect them to the same external Supabase project instead.
No. Backups cover the database only, both schema and data. Files in storage buckets are stored separately and are not part of database backups or database exports.
No. Lovable Cloud takes one backup per day and retains up to roughly 14 days of backups. You can restore to any of those daily snapshots, not to an arbitrary moment between them.