Payments and data
Organize your business data
Give your site a database for orders, sign-ups, products and reviews. Learn how to turn it on, ask the agent to build tables, view your data and back it up.
A spreadsheet gets messy once customers start using your site. A database keeps the same information in tidy tables, and your site can read and write it by itself: orders, sign-ups, messages, stock levels, customer reviews.
You do not need to learn database words. You describe what you want to keep, the agent builds the tables, and you check the data on a page of your own project.
This page is the business view. For the tools in detail, see eCG Data: your app's database.
What a database is good for
| You want to | Ask the agent |
|---|---|
| Keep orders after checkout | "Save each order in the database with the customer name, items and total." |
| Collect sign-ups or enquiries | "Save contact form messages in a table I can look at." |
| Show products and stock | "Show my products from a table, with name, price, photo and stock." |
| Show customer reviews | "Add a reviews table and display the latest five on the home page." |
| Remember bookings | "Save bookings with date, time and guest count, and stop double bookings." |
Without a database, a site can look good but forget everything when the visitor leaves. With one, the information is still there tomorrow.
What you need
- A workspace plan that includes a database. A database comes with a plan. If yours does not, the page shows a card that says "Add a database to your app" and tells you how to start one. Your first project and your free eco stay free either way. See the pricing page.
- A project to attach it to. One database belongs to one project.
Turn the database on
- Open your project in the editor.
- Open More actions, then Database. Or open Project settings and, in the left menu under eCG Cloud, choose eCG Data.
- If you see No database yet, select Provision. The button shows "Provisioning…".
- When it is ready you see "Database provisioned!" and the status badge reads Active.
The page now shows four tabs: Overview, Diagram, Tables and SQL.
If provisioning fails, the page shows Provisioning failed with the reason. Select Retry.
Ask the agent to build your tables
The easiest way is to talk to the agent. Describe your business, not the tables.
"I run a bakery. Customers order cakes online. Save each order with the customer name, phone number, cake, pickup date and whether it is paid."
The agent proposes the database changes. A card appears in the chat that lists them, with a Run all in order button and a Show SQL option if you are curious. Nothing is changed until you select it. If you do not like a change, select Reject this statement.
When you approve, the card says "Database change applied." and your tables exist. See Approve database and server changes.
Look at your data
Open the Tables tab. You see each table with its number of rows and columns.
- Select a table.
- The rows load. Use Previous and Next to move through them. You see which rows are showing out of the total.
- Select Back to tables to return.
The Diagram tab draws your tables and how they connect, which helps when you want to explain your setup to someone. The Overview tab shows the health of the database.
The Tables tab is for looking. To change data, use your site or ask the agent. See Browse tables and run queries.
Back up your data
- Open the database page.
- Select Backup. The button shows "Dumping…".
- A file downloads: "Database dump downloaded".
If a table is very large, the file may be cut at 10,000 rows per table. Then you see: "Dump downloaded, but some tables were cut at 10,000 rows. Export those tables another way if you need every row." Keep your backups somewhere safe, such as your own drive, and make one before big changes. See Back up your data.
Keep your customers' data safe
You hold other people's personal details, so treat them with care.
- Collect only what you need. A phone number you never use is a risk you do not need.
- Do not put keys or passwords in your tables. Use Secrets. See Store keys and secrets safely.
- Give AI tools only the access they need. A tool that only reads can use a Read only key. See Connect other tools with access keys.
- Tell customers what you keep and why, in your privacy policy.
Sync and delete
- Sync updates the live preview with your database's connection details. The agent does this for you when you provision, so you rarely need it. Use it if the preview says the database is not configured.
- Delete removes the database for good. You must type "delete my database" to confirm, and then select Delete permanently. All its tables and data are gone and cannot be recovered. Take a Backup first.
If something goes wrong
| What you see | What to do |
|---|---|
| "A database comes with a plan." | Select Start your plan, or open the pricing page. Your app keeps working without it. |
| Provisioning failed | Select Retry. If it repeats, contact support from the help page. |
| Disconnected next to the status | Wait a moment and select Refresh on the Tables tab. If it stays, select Sync. |
| "No tables yet" | Ask the agent to create the tables you need. |
| The agent says a change failed | Select Ask the agent to fix this on the card. Nothing was applied, so your data is safe. |
| The site shows "Database API URL is not configured" | Select Sync, then reload the preview. |
| Backup fails: "Dump failed" | Try again. Check you have the project open. |