Skip to content

List database tables

GET/v1/databases/{uid}/data/tables

Lists the tables and views in a PostgreSQL or MySQL database, for use with Browse table rows. Redis databases have no tables; use List keys instead.

  • PostgreSQL: tables, partitioned tables, views, materialized views and foreign tables in every schema except the system schemas, limited to those the database user can SELECT. Partitions are left out. Tables in public come first.
  • MySQL: tables and views in every schema except mysql, information_schema, performance_schema and sys. Tables in the database's own schema come first.
  • At most 2000 entries are returned.

The database must be ready. Data browser calls share a small platform-wide pool of connections; when it is full you get 409 and should retry shortly. Requires the secrets read permission (owner, admin or developer role).

Authentication

Send your API key as Authorization: Bearer <token>. The request is scoped to the workspace in X-Workspace-Slug.

Path parameters

uidstringRequired

The database's uid.

Headers

X-Workspace-SlugstringRequired

Slug of the workspace the request acts on. You can also pass it as the workspace_slug query parameter.

Response

200

The tables and views.

successbooleanRequired

true when the request succeeded.

messagestringRequired

Human-readable status message.

dataarray of objects
Show item attributes
schemastringRequired

Schema (PostgreSQL) or database (MySQL) the table belongs to.

namestringRequired

Table or view name.

kindstringRequired

PostgreSQL: table, partitioned_table, view, materialized_view or foreign_table. MySQL: table, view, or the lower-case table type for anything else.

estimated_rowsinteger | nullRequired

Approximate row count from the engine's statistics. null for views and for PostgreSQL tables that have not been analyzed yet.

Errors

StatusMeaning
400The request failed. Possible messages: this database has no tables, browse its keys instead (Redis), the data viewer doesn't support this database engine, the database rejected the connection: <reason>, or an error from the database.
401The API key is missing, invalid, expired or revoked.
403You cannot access the workspace, your role does not allow this action, or the account is suspended.
404The resource does not exist or you cannot access it.
409The data browser cannot run right now. Possible messages: the database must be ready to browse its data, the data viewer is busy, try again in a moment, and couldn't reach the database, check that it's running and try again.

Errors use the standard error format.