Skip to main content

Metadata and data query

The data query page is used to confirm data structures, validate SQL and preview results before developing APIs. It reuses the data source connection but exposes read-only capabilities only.

Open the query page​

  1. Go to Data Sources.
  2. Expand the target data source in the metadata tree on the left.
  3. Select a database and table, then click the table name.
  4. The data query page opens on the right and queries the table data by default.

The metadata tree is displayed in three levels:

Data source
└── Database / schema
└── Table / view
└── Column

Query page capabilities​

CapabilityDescription
Table data previewLoads the current table data by default, with pagination
Custom SQLWrite and execute read-only SQL in the editor
SQL formattingFormat the current SQL in one click
DDL scriptView the table DDL to generate query or migration scripts
Execution resultsShow column names, types and data; long text is truncated automatically
Duration and row countHelp assess query performance and result size

Read-only restrictions​

The platform allows only statements that begin with the following (leading whitespace is ignored):

SELECT ...
SHOW ...
DESC ...
DESCRIBE ...
EXPLAIN ...

Other statements (INSERT, UPDATE, DELETE, ALTER, DROP, CREATE, stored procedure calls, etc.) are rejected. This protection is enforced on the data source side and does not rely on frontend validation.

Query scope

The read-only restriction only guarantees statement type safety; it does not limit the data scope of the query. Configure a least-privilege account for the data source, and control sensitive data through views or row-level permissions.

Result preview​

  • Query results are displayed page by page; a single preview returns at most 100 rows.
  • The table supports horizontal scrolling when there are many columns.
  • NULL, binary data and very long text are handled according to display rules.
  • The response structure of non-relational data sources may not be a standard two-dimensional table; the platform converts it to a table where possible.

DDL script​

Click DDL script to view the DDL of the current table, to:

  • Confirm column types, primary keys, indexes and comments.
  • Copy it into SQL mode as a query foundation.
  • Compare table structures across environments.

FAQ​

SymptomCauseResolution
Query rejectedThe statement does not start with a read-only prefixUse SELECT / SHOW / DESC / DESCRIBE / EXPLAIN
Metadata is emptyThe account has no database or table permission, or the schema selection is wrongCheck account grants and the default schema
Connection timeoutNetwork or database loadCheck the firewall, connection pool and database status
Query is slowMissing indexes or a large data volumeAdd indexes, restrict conditions, return fewer columns
Special character errorThe table or column name contains - or another special characterWrap it in double quotes

Relationship to API development​

SQL validated on the data query page can be copied directly into SQL mode. Note:

  • The query page uses the data source account's permissions. APIs use the same data source at runtime but go through parameter binding, pagination and plugin processing.
  • The query page does not parse #{} parameters; write and parse parameter syntax for APIs in SQL mode.
  • Query page results do not pass through data plugins (filtering, masking, field mapping) and cannot replace final response validation for APIs.