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 TABLESExamples
The catalogue: each table, its fields and its connections.
Return type and behaviour
The answer is {"tables": […]}, one entry per table you can query:
| Property | Example |
|---|---|
name | orders, the name you write in a statement |
schemaName | merchant |
description | What the table holds |
category | table, or report for an mv_ table |
columns | [{"name": "total", "kind": "money"}, …] |
candidateKeys | The 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
| Error | What happened | How to recover |
|---|---|---|
HTQL-1002 | LIST_TABLES() was called as a function: LIST_TABLES is not called by name; write the statement LIST TABLES | Write 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.