Skip to main content

Table mode

Table mode uses a two-dimensional table to select fields and conditions, and the platform generates SQL automatically. It is suitable for business users who are not familiar with SQL to quickly develop standard query APIs.

Creation steps​

  1. Go to the Workbench and click Table Mode.
  2. Select a data source and schema.
  3. Select a table; the platform loads column names, types and descriptions automatically.
  4. Select items in the field table:
Selection typeEffect
Condition parameterGenerates a request parameter for WHERE filtering
Response parameterGenerates SELECT columns and response fields
Sort fieldAdded to the sort list; ascending or descending order can be selected
  1. Confirm parameter types, required flags, examples and descriptions in the right panel.
  2. After tests pass, save and release.

Generation logic​

Selections on the page are converted to SQL:

SELECT id, order_no, amount, status
FROM orders
WHERE status = #{status}
AND created_at >= #{startTime}
ORDER BY created_at DESC
  • Condition parameters are automatically populated in the request parameter panel on the right; custom additions are not supported.
  • Response parameters are linked to the response parameter panel on the right.
  • Field descriptions come from database comments.
  • Sort fields support multiple fields; ORDER BY is generated in page order.
  • Condition operators default to =; use Filter Conditions to configure like, range comparisons or in with multiple values.

Visual filter configuration​

Selecting a condition parameter only produces an equality condition. Use the Filter Conditions dialog to configure like, >=, in and other operators.

How to open​

  1. After selecting a table, click Filter Conditions in the header of the Select Parameters card.
  2. Add, edit or remove conditions in the dialog, then click OK to write them back to the request parameter list. Cancel discards every change.
When the entry is disabled

The button is disabled when no table is selected, or when the operation type is not a query (insert / delete) — only query APIs generate a WHERE clause, so operators configured for other types would have no effect.

Configurable fields​

ColumnDescription
Filter fieldSelected from the columns of the current table; searchable; each option shows "column name + comment"
Parameter nameGenerated by camel-casing the column name; editable
Operator=, !=, >, >=, <, <=, like, not like, in, not in
Parameter typeString, Int, Float, Date, Array, Boolean; mapped from the column type when a field is selected
RequiredOff by default and wrapped in <if>, ignored when not passed; when on, it becomes a hard condition that must be passed
Default valueDefault parameter value; optional
ExampleUsed for documentation and test prefill only; separate multiple values of in with commas
DeleteRemoves the condition together with its request parameter

Operators and generated SQL​

OperatorGenerated WHERE fragment
=, !=, >, >=, <, <=Comparison expressions such as col>=#{param}
like / not likecol like concat('%', concat(#{param}, '%'))
in / not incol in <foreach collection="param" item="item" open="(" separator="," close=")">#{item}</foreach>
  • Values are always bound with #{}; only column names come from table metadata, so user input is never concatenated.
  • Conditions are joined with and in list order; when the first condition is optional and not passed, <where> strips the leading and.
  • Optional numeric conditions (Int / Float / Double / Boolean) only check null, so a passed 0 is not dropped.

Synchronization and validation​

  • Linked with the request parameter panel: both edit the same set of parameters. Renaming a parameter or changing its type, required flag or default value in the dialog is reflected in the panel, and vice versa.
  • Operators are maintained in the dialog only: the operator column in the request parameter panel is read-only to avoid conflicting edits.
  • Parameter name rules: Chinese, English letters, digits and underscores only, and it must not start with a digit. Names must be unique within one API. pageNum / pageSize are reserved for pagination and cannot be used when pagination is off.
  • in / not in requires Array: choosing in / not in switches the parameter type to Array, and Array parameters only support =, in and not in; switching back to a scalar type resets the operator to =.
  • Inline validation: rows with an empty, invalid or duplicate parameter name, no filter field, or an in operator on a non-Array type are highlighted, and OK stays disabled with the reason shown.
  • Pagination parameters are excluded: pageNum / pageSize never appear in the condition list.
  • Non-relational data sources: for MongoDB, Elasticsearch and similar sources the operator is locked to =, and other operators are rejected on save.

Relationship with result preview​

Result preview only checks the table structure and samples data; it does not apply filter conditions, so previewed data is unaffected by them. Use Test and fill in Query parameters to verify the actual filtering.

Generated example​

Conditions: status = (required), amount >=, order_no like, tenant_id in:

SELECT id, order_no, amount, status
FROM orders
<where>
status = #{status}
and amount >= #{minAmount}
and order_no like concat('%', concat(#{orderNo}, '%'))
and tenant_id in
<foreach collection="tenantId" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</where>

Parameters and pagination​

Request parameters in table mode come from the selected condition fields:

  • The parameter location defaults to Query and can be adjusted as needed.
  • Types are inferred from column types and must be confirmed manually.
  • After pagination is selected, callers must pass pageNum and pageSize.
  • pageSize has an upper limit of 1000.

Capability boundaries​

ItemLimitation
Operation typeQuery only; insert, update and delete are not available in table mode
HTTP methodPUT / PATCH / DELETE are not provided
Number of tablesSingle table only; JOIN is not supported
Custom SQLNot supported; use script mode for complex queries
Hive data sourceInsert is not provided; update and delete are also unavailable
ElasticsearchHTTP methods and operation types are further narrowed; refer to the options available on the page
Filter operatorsOnly query APIs can configure them; non-relational data sources such as MongoDB / Elasticsearch support = only
Condition combinationConditions are always joined with and; or and grouping are not supported
ParametersCannot be added manually; they can only come from selected fields
When to switch to script mode

Use SQL script mode when you need multi-table joins, aggregation, subqueries, dynamic conditions, batch writes or stored procedures.

Testing and release​

Table APIs also support:

  • Online testing: fill in Query / Body / Header according to parameter locations.
  • Test cases: save request snapshots and run regression.
  • Mock: simulate responses when real data is unavailable.
  • Release to environments, version management and synchronization.

The release flow is the same as script mode. See Workbench overview.

FAQ​

SymptomCauseResolution
Field has no descriptionThe database does not maintain commentsAdd the description manually in response parameters
Query result is emptyCondition parameters are not passed or types do not matchCheck required flags and parameter types
Cannot select insert/updateTable mode supports queries onlySwitch to script mode
Sorting does not take effectNo sort field is selected or no direction is setConfirm the settings in the sort list
Parameters cannot be addedTable mode parameters are linked to fieldsUse script mode or adjust the table fields
Filter Conditions button is disabledNo table is selected, or the operation type is not a querySelect a table first; use script mode for insert/delete APIs
like / >= has no effectThe data source is non-relational, or the API is not a queryNon-relational sources support = only; make sure the operation type is query
Preview shows no filteringResult preview does not run the WHERE clauseUse Test with parameters to verify
Save reports an invalid parameter nameThe name contains spaces, dots or hyphens, or starts with a digitUse Chinese characters, letters, digits and underscores
Save reports a duplicate parameter nameIt clashes with an existing request or pagination parameterRename it or delete the duplicate condition in the dialog