eCG Cloud: data and actions

Browse tables and run queries

Use the eCG Data console to see your tables, read rows, view a diagram of how tables connect, and run SQL with the read-only or the full-access role.

The eCG Data console lets you look inside your app's database. You can see which tables exist, read their rows, view how they connect, and run SQL queries. It has four tabs: Overview, Diagram, Tables and SQL.

Open the console

  • From the Cloud page, open the eCG Data tab and select an app.
  • Or open the app in the editor, open More actions, then Project settings, and choose eCG Data under eCG Cloud. The database icon in the editor toolbar opens the same place.

The console only opens for an app whose eCG Data is active. See eCG Data: your app's database for setup and statuses.

Who can see what

You can If you are
Open Overview, Diagram and the table list in Tables, and run read-only queries Anyone who can open the project, including view-only members
Open a table to read its rows, run queries with full access, and download a backup Someone who can edit the project

The rows of a table can hold customer details such as names, emails and sign-in details. That is why rows are shown only to people who can edit the project.

The Overview tab

This tab shows how healthy the data is: Speed, Storage, Security, and a list of your tables with a protection badge on each. The badges are explained in eCG Data.

The Diagram tab

The diagram draws every table as a box with its columns, and draws a line between tables that point at each other. A key symbol marks a primary key, the column that identifies each row. A link symbol marks a foreign key, a column that points at a row in another table.

Control What it does
Find table or column Highlights matches. Clear search empties the box.
Drag a table Moves it. Your layout stays until you restore it.
Drag the empty canvas Pans around.
Mouse wheel Zooms in and out.
Zoom in, Zoom out, Reset zoom to 100% Zoom with buttons.
Fit Zooms so every table is in view.
Expand all, Collapse all Shows all columns or only the table names.
Restore the automatic layout Puts the tables back in their starting places.
Full screen, Exit full screen Gives the diagram the whole window.
Esc Clears the search or a selection.

The line at the bottom reads, for example, "6 tables · 5 relationships". If the app has no tables yet, the tab says: "No tables yet. The diagram appears once the app creates its first table."

The Tables tab

This tab lists every table with its number of rows and columns, and the names and types of its first columns.

  1. Select a table. Its rows open, 20 at a time.
  2. Select Next and Previous to move through them. The line between shows a range such as "21–40 of 135".
  3. Select ← Back to tables to return to the list.

The tab is for reading. You cannot edit a row here. To change data, ask the agent in the editor chat, or use the SQL tab with full access.

A table with no rows says "No rows in this table." Select Refresh above the list if a table you expect is missing.

The SQL tab

SQL is the standard language for asking a database questions. You do not need to know it to run your app. If you want to look at your data directly, this tab is the way.

  1. Next to Role:, choose anon (read-only) or service (full access). See the table below.
  2. Type your query in the box. It starts with SELECT * FROM your_table LIMIT 10;. Replace your_table with a real table name.
  3. Select Run Query. The button reads Running… while it works.
  4. Read the result under the button.

The two roles

Role What it can do
anon (read-only) One SELECT query at a time. It sees only what a visitor to your app could see, following each table's access rules.
service (full access) Everything: read, add, change and delete rows, and create or change tables. Several statements can run together. It ignores row protection.

A query that takes too long is stopped, and the box shows the reason.

Think of anon as "what a visitor sees" and service as "what your app's own server work can do". A table marked deny all returns no rows to anon, even when it holds data. Switch to service to see it.

With service, a batch of statements runs as one unit. If one fails, none of them is kept. New tables made this way are protected as deny all automatically.

Read the result

Message What it means
"12 rows returned" A query that reads data. The rows show in a table below.
"Statement ran: CREATE TABLE" A change that returns no rows ran.
"Statement ran: UPDATE - 3 rows affected" A change touched that many rows.
"(4 statements)" at the end You ran several statements together.
A red message in a box The query failed. The message comes from the database and says why, for example that a column does not exist.

In anon mode the message "Only SELECT queries are allowed in read-only (anon) mode" appears if you try to change something or put a second statement after a semicolon. Switch the role to service, or ask the agent.

Long values are cut short in the result table. A result is shown as it is returned, so keep queries small, for example with LIMIT 50.