LIST TABLES

Ask HTQLDB which tables you can query and get back each one's fields and how it connects to the others, in one statement.

Syntax

The statement takes nothing else.

LIST TABLES

Examples

The catalogue: each table, its fields and its connections.

Return type and behaviour

The answer is {"tables": […]}, one entry per table you can query:

PropertyExample
nameorders, the name you write in a statement
schemaNamemerchant
descriptionWhat the table holds
categorytable, or report for an mv_ table
columns[{"name": "total", "kind": "money"}, …]
candidateKeysThe fields that identify a row
connections[{"name": "lines", "target": "order_lines", "cardinality": "many"}]

You see the platform's tables and the tables your account created.

Errors and exceptions
ErrorWhat happenedHow to recover
HTQL-1002LIST_TABLES() was called as a function: LIST_TABLES is not called by name; write the statement LIST TABLESWrite the statement LIST TABLES
Permissions and security

LIST TABLES runs for a signed in person or app whose roles can read the catalogue.

Best practices
  • Read the catalogue once when your application starts and keep it; it changes only when a table is added.
  • Tables you can query is the same list to read in the browser.