Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                

Deploy & host

Database

Every project ships with a built-in production database — no third-party service to set up.

Every project includes its own database. It is provisioned automatically, bound to your app, and deployed with each release, so there is no separate database service to sign up for, configure, or connect.

How it works

  • Each project gets 1 dedicated SQLite database (Cloudflare D1) exposed to your app as the DB binding.
  • Locally, the app runs against a local SQLite file so you can build and test offline.
  • On publish, the production database is created on first release and your schema migrations are applied automatically.

Because it is standard SQLite, the generated app talks to it through an ORM and ordinary SQL — nothing Layerwise-specific to learn.

View and edit your data

Open Database from the project sidebar to browse and edit your data directly, no SQL required.

  • Set Environment at the top of the page to Local or Online to work with your local development data or your live production data. Online becomes available once you have published the project.
  • The left panel lists your tables with a search box. Single-click a table to preview it, double-click to keep it open in a pinned tab.
  • Click a column header to sort, and page through large tables at the bottom.
  • Select Filter to show only the rows that match conditions on a column.
  • Add a row with Insert, edit a value by double-clicking a cell, and delete rows by selecting them and choosing Delete. True/false and date/time columns show the right control — a dropdown, a date & time picker — so you never enter raw 0/1 or timestamps.
  • Export the table from the actions menu at the right of the table toolbar with Export CSV or Export JSON. The file includes every row that matches your filters, in the current sort order. Choose where to save it, and Layerwise shows the file in its folder.

Local and Online are independent databases — your local file is for building and testing, and production is created on first publish. Edits made to Online change your live production data immediately.

Database browser with the Environment selector, table list, Insert, and Export menu marked

(1) Choose Local or Online, (2) select a table, then use (3) Insert or (4) Export.

Restore the online database

To undo changes to live data, choose Online, open the menu next to the Database title, and choose Restore. Pick a time in the last 30 days, or any time since the database was created if it's newer, then type the project name to confirm.

  • Rows and table structure go back to that time.
  • Sign-ups and sign-ins after that time are lost.

If a later publish changed the tables, the live app may break until you publish again. To undo the restore, choose Undo in the message that confirms it. Viewers can't restore a database.

Storage limits

Database storage is billed per GB-month from your team's credits. Each project gets 1 database, and your plan sets how many databases you can have and how much they can hold. On Free, your team's databases share 100 MB. On paid plans, each database can grow to 10 GB:

PlanDatabasesStorage
Free10100 MB per team
ProUnlimited10 GB per database
BusinessUnlimited10 GB per database
EnterpriseUnlimited10 GB per database

10 GB is Cloudflare's limit for a single database, so it's the same on every paid plan and can't be raised. Changing plans takes effect immediately: upgrading from Free raises the limit right away, and downgrading to Free applies the 100 MB team limit at once.

Monitor usage

Open the menu next to the Database title and point to Usage to see the selected database's size against its limit. On Free, Online shows your team's total against the shared 100 MB, plus this project's share. For Online, it also shows rows read and written. It shows the latest measurement each time you open the menu.

When a database fills up

As a database approaches its limit, Layerwise notifies everyone who has worked on the project — by email and in the app — at 50%, 75%, 85%, 95%, and 100% of the limit. On Free, these notices track the team's total and go to the team owner and everyone who has worked on one of the team's published projects.

At 100%, the published app becomes read-only. On Free, the limit is the 100 MB your team's databases share, so every published app in the team becomes read-only together. Pages keep loading, but the apps can't save changes, so the databases stop growing. To make them writable again:

  • Free up space in the database (on Free, in any of the team's databases), for example by deleting rows from the Online view of the Database page. Layerwise checks database size every hour, so apps can save changes again within an hour, or
  • On Free, upgrade your plan for a 10 GB limit per database. Apps recover right away.