Skip to main content

Query Settings

Below the SQL in the editor, a row of buttons opens the settings panels of the query, one at a time: Visibility, Custom CSS, Form settings, Add button, Import, Table settings, Thresholds, Log and Cache. The Create query page offers Visibility and Log; the other panels are in the editor once the query exists.

Some panels appear only when they apply to the SQL. Kvery reads the SQL without its strings and comments:

  • Form settings appears when the query has form variables. Its write-query part (the operation texts and the confirmation) appears when the SQL contains INSERT, UPDATE, DELETE, REPLACE, ALTER or CREATE followed by a space.
  • Add button, Import and Table settings appear when the SQL contains SELECT or EXEC followed by a space.

The settings are saved with Save (or Save and Run; for a shared query with a draft, Save (Draft) and Save (Draft) and Run). For a shared query only the SQL and the form fields are kept in a draft: the settings of these panels take effect when you save.

Form fields and saving​

While Update form on end of typing is ticked (the default), the field cards of the form variables follow the SQL as you type, paste, cut or drop text, or accept a suggestion with the mouse or by touch. When it is off, click Update form after changing the variables; the choice is remembered in the browser. When the SQL has form variables but their fields have not been generated, saving stops with the message "You must update the form before save!": click Update form, check the field cards, then save again. Expand all and Collapse all open or close every field card.

Visibility​

Only editors can see? hides the query from members without edit rights in the query list and in the search. It is a visibility setting, not an access restriction; see Members and permissions. Editors see such a query with a Private for editors icon in the list.

Custom CSS​

CSS rules (HTML tags are removed) that the run page of the query loads — in the app, on its shared link, in dashboard tiles and when another query opens it in a window. Use them to restyle the page of this query only.

Form settings​

SettingDefaultWhat it does
Form button textSendThe label of the button that sends the form
Form button colorGreenGreen, Dark blue, Dark gray, Red, Orange, Light blue, Light gray or Black
Successful operation textSuccessful operation!Shown after a successful run of a write query
Unsuccessful operation textOperation failed!Shown after a failed run of a write query
Confirm enabled?NoYes asks for confirmation before the form is sent
Confirm titleAre you sure?The title of the confirmation
Confirm textThe operation cannot be undone!The text of the confirmation
Confirm 'cancel' button textCancelThe button that cancels
Confirm 'ok' button textOKThe button that sends the form

The operation texts and the confirmation settings are offered for write queries. For a query that changes data, name the action on the button (for example "Delete order"), pick a colour that warns (Red) and turn the confirmation on.

Add button​

A read query can show a button above its result that opens another query — for example a form that adds a row to the table.

  • Add button text (default "+ Add new") and Add button color (default Dark blue).
  • Type — Hidden (the default: no button), Modal (the query opens in a window over the page) or New tab.
  • Joined query — the query the button opens, a query of the same group.
  • Query parameters (key1=value1&key2=value2) — the values passed to the joined query, one key=value pair per line or separated by &. A value can contain $name, which gets the value of name from the address of the current page (for example customer_id=$customer_id). A comma-separated list of variables, such as $customer_id, $status, passes them under their own names.

What happens after the joined query ran in a window is decided by the table settings: Auto close modal, after form executed? of the joined query closes the window, and Auto refresh table, after modal closed? of this query reloads its table.

Import​

A read query can take a file and send its rows to another query, the Import query (usually a write query, such as an INSERT). The run page of the read query then has an Import button above its table. See Importing data for the file format and the process.

  • Import query — the query that runs once for every row of the file.
  • Query parameters (column1=value1&column2=value2) *optional — renames columns: one column=parameter pair per line or separated by &, where column is the column name of the file (with _ in place of spaces) and parameter the name the import query gets it under. A pair whose value contains $name instead passes the value of name from the address of the current page to every row, under the name on the left.
  • Processing at the same time (number of rows) — how many rows one request processes (1 by default).

Table settings​

SettingDefaultWhat it does
Auto close modal, after form executed?onWhen this query runs in a window (opened by an add button or a link field of another query) and its form was sent successfully, the window closes
Auto refresh table, after modal closed?onWhen a window opened from this query's page closes, the table reloads its rows
Hide description in shared view?offLeaves the description row — with the selectors and the add button in it — out of the shared link page, dashboard tiles and windows
Hide form in shared view?offLeaves the form out of these pages
Show only table in shared view?offThese pages show only the result table, without the description row and the form (the form stays while there is no result)
Slug JSON keys (response time may be slower)onThe API answer uses slugged column names and returns JSON text values as nested JSON
Responsive?onColumns that do not fit are folded into an expandable part of their row
Responsive data in modal?offWith Responsive?, the folded columns open in a window instead
Table fix height in pixels (0 = disabled)0A fixed table height with a scroll bar
Fixed columns from left / Fixed columns from right0Columns that stay in place while the table scrolls sideways; offered when Responsive? is off
Rows per page25The page size of the table (at least 5)
Auto refresh table (sec)offReloads the rows every given number of seconds (at least 5); the page shows "Auto refresh:" with the interval instead of the layout and refresh selectors

Most of these settings can be overridden by a parameter in the address of the run page; hover a setting's label to see its parameter (for example ?hdscr=1&form=0, ?rowsPerPage=50, ?refresh=30). See Share URLs and embedding.

Thresholds​

The Slow query time (in seconds) after which a run tags the query, and the query's Rate Limit and Rate Limit Window in seconds (0 = disabled). A query created in a group starts with the group's values. See Thresholds and rate limits.

Log​

The Log level of the query (Disabled, or Restricted or Detailed, each of these two also only success and only error); a query created in a group starts with the group's log level. See Logs.

Cache​

Cache expiration in seconds (0 = disabled) turns on the result cache of the query for GET requests, and Clear cache removes the stored results. See Export and cache.