Build and customize

Approve database and server changes

See how the agent changes your database and server functions, when they apply by themselves, and how to run, reject or deploy the ones waiting for you.

Some changes reach beyond your pages. The agent can change your database (the tables where your site keeps information) and add server functions (small pieces of code that run on the server, for example to handle a payment or send a message). These change how your site behaves for real visitors, so eComGear shows you what is happening.

This page explains what the agent does by itself, and what to do when a change is waiting for you.

What counts as a database or server change

Change Examples
Database changes Creating or changing a table, adding a column, setting who can see what, or changing every row at once
Server functions Code that handles a login, a booking, a form, a payment, or a call to another service

Normal edits to your pages, text, colors and images are not in this group. They show up in the preview and can be undone with Undo this change.

Database changes and server functions live in your eCG Cloud. To learn more, see eCG Cloud overview and eCG Actions.

What happens when you ask for one

  1. You ask for a feature that needs it, for example "Add a booking form that saves each booking".
  2. The agent writes the page and prepares the database change or the server function.
  3. When the request finishes, eComGear applies what the agent prepared. The status line says "Applying the database and server changes…".
  4. The reply shows a card. You see "1 database change applied" or "1 server function deployed", and "Nothing left to run" or "Nothing left to deploy".

In Build mode, you do not press anything for this. It happens at the end of the request.

In Plan mode, nothing is applied. A plan only describes the work. See Plan mode and Build mode.

When a change waits for you

Sometimes a change is not applied automatically, and a card asks you to act. This happens when:

  • An earlier session left a change that was never applied.
  • Applying took too long. The request finishes, and the change stays waiting so you can retry.
  • A server function could not go live, so you can deploy it again.

The card appears above the message box so it never scrolls away. The chat shows how many are waiting: "1 database change waiting for you" or "2 server functions waiting for you".

Approve database changes

A database card lists each statement in order, with a number.

  1. Read the list. Click a statement, or Show SQL, to see the full text. Click Hide SQL to fold it away.
  2. If everything looks right, click Run all in order.
  3. The changes run together as one unit. If one fails, none of them are applied. You see "One statement failed; nothing was applied."
  4. On success you see "Database change applied" or "N database changes applied, in order."

Each statement shows a status:

Status Meaning
waiting Not run yet
applied Done
rejected You rejected it, so it will not run
failed on last run It failed. Open it to read the reason

Reject a statement

Click the cross on a statement (Reject this statement) if you do not want it. A rejected statement never runs.

When a statement fails

A failed statement opens and says "Something went wrong with this step. You can try again or ask the agent to fix it." Choose Ask the agent to fix this. The agent prepares a corrected version, and you run it.

After you decide

When no statement is left waiting, the agent carries on by itself. If you ran them, the chat says "Ran the database changes" and the agent continues, taking into account that the data is now there. If you rejected them all, it says "Declined the database changes" and the agent finds another way or tells you what it blocks.

Approve server functions

A server function card lists each function with its name and the first line of its code.

Badge Meaning
Public: anyone with your site's key can call it Visitors to your site can use it
Private: only you can call it Only you can use it
Full data access It can read and change all your data
Limited data access It sees only what it needs

Below the badges you see the status: "waiting for you", "live", "not deployed" or "discarded". Click a function to see its full code.

  1. Read the badges. A function that is Public with Full data access deserves a careful look.
  2. Click Deploy on a function (tooltip: Deploy this function) to put it live.
  3. If you have more than one waiting, you can click Deploy all.
  4. You see "[name] is live." or "N functions deployed."

To remove one, click the cross (Discard this function). You see "[name] will not be deployed."

The card says it plainly: "Nothing is live until you deploy it. This runs on the server, next to your database."

Deploy all stops at the first failure

Deploying several is not all-or-nothing. If the third fails, the first two stay live. The message says which one failed and how many were deployed before it: "[name] failed; the 2 before it did deploy."

A failed function says "Nothing was deployed. You can deploy again, or ask the agent to change it." Click Deploy again, or ask the agent to fix the code.

You can keep working

You can use a server function card while the agent is still working. A database card is locked until the request ends, so nothing runs out of order.

If something goes wrong

What you see What to do
"One statement failed; nothing was applied." Open the failed statement, read the reason, then Ask the agent to fix this.
"[name] could not go live" in the reply The change is kept. Click Deploy on the card, or ask the agent to fix it.
A card stays after you clicked Reload the page. The card reads from your account.
You rejected something by mistake Ask the agent to prepare it again.
Your page breaks after a database change See Fix a page that does not load.

For your data itself, see Back up your data and Data console.