You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9609fa2
Browse filesBrowse the repository at this point in the historyBrowse files
feat(cli): add warehouse tables list and get (#7689)
Generate `warehouse tables list` from `GET
/v2/projects/{ref}/warehouse/tables`. It lists the tables selected for
Warehouse replication with their freshness:
- `status`: `syncing`, `live`, `error`, `stopped` or `unknown`;
- the raw replication state;
- when the state was observed;
- `lag_ms`, the flush lag of the replication slot that carries the
table.
Text output shows one row per table. `-o json` and `-o yaml` also
include the full replication feedback. That feedback includes
`flush_lag_bytes`, which reads 0 for a caught-up slot whose lag time
Postgres no longer reports.
Also generate `warehouse tables get <table-id>` from `GET
/v2/projects/{ref}/warehouse/tables/{table_id}`. It reads one of those
tables by the source OID that `warehouse tables list` shows as its ID,
with the same attributes. Its text output also shows the nested
replication feedback, and a table that isn't replicated is an API error.
This is the first generated command with a positional argument on a real
operation, so the generic bindings test now supplies positional path
parameters.
Two generic changes to the text output of generated commands:
- an empty collection prints `No results` instead of `Data -`;
- a column that holds a nested object in any row is left out of the
table. Before, rows with a nested object printed it as compact JSON
while rows with `null` printed `-`.
The tables contracts, and `flush_lag_bytes` in the status contract, come
from OpenAPI overrides until they ship in the deployed Management API
specification.
Stacked on #7640. Depends on
supabase/platform#42055 and
supabase/platform#42108.
Implements PIPE-1451 and PIPE-1453.
---------
Co-authored-by: Julien Goux <hi@jgoux.dev>
| text presentation | the response as labelled fields and tables, nested objects as indented blocks, `-` for null or empty values; with `--wait` the final read response; an empty response prints `Done.`|
151
-
| JSON presentation | the API's JSON response bytes, unchanged, preserving unknown and null fields; with `--wait` the final read response |
152
-
|`-o json`| the same bytes; no `target` key is added |
153
-
|`-o yaml`| the same document as YAML; `-o pretty` selects text; other `-o` values are a usage error |
154
-
|`--dry-run`, text presentation |`Dry run: <METHOD> <path>`, then `Query`, `Headers` and indented JSON `Body` blocks |
155
-
|`--dry-run` otherwise | the request preview in the selected JSON or YAML presentation |
| text presentation | the response as labelled fields and tables, nested objects as indented blocks (a collection table omits a column holding nested values; `-o json` shows them), `-` for null or empty values; with `--wait` the final read response; an empty response prints `Done.` and an empty collection `No results`|
151
+
| JSON presentation | the API's JSON response bytes, unchanged, preserving unknown and null fields; with `--wait` the final read response |
152
+
|`-o json`| the same bytes; no `target` key is added |
153
+
|`-o yaml`| the same document as YAML; `-o pretty` selects text; other `-o` values are a usage error |
154
+
|`--dry-run`, text presentation |`Dry run: <METHOD> <path>`, then `Query`, `Headers` and indented JSON `Body` blocks |
155
+
|`--dry-run` otherwise | the request preview in the selected JSON or YAML presentation |
156
156
157
157
When the presentation is text and `--output-format` is `text`, each request, and with `--wait` the
158
158
whole polling phase, runs under a task that shows the polled status after 200 ms. On a terminal it
Returns one source table selected for Warehouse replication by its source OID, from the same observations and with the same status and freshness attributes as the Warehouse tables list. Returns 404 when the table is not selected for replication, including when Warehouse is not set up, its publication is missing, or it is being disabled.
- Positional argument `<table-id>`, bound to path parameter `table_id`.
90
+
91
+
## `supabase warehouse tables list`
92
+
93
+
List tables replicated to Warehouse
94
+
95
+
Lists the source tables selected for Warehouse replication with their replication status and freshness, from the same observations as the Warehouse status. Freshness comes from the replication slot that carries each table: its own sync slot until it follows changes, then the pipeline apply slot; one slot never stands in for the other. lag_ms is that slot's flush lag. Postgres reports no lag time for a caught-up slot without new WAL, so lag_ms can be null while replication_feedback.flush_lag_bytes is 0; neither is ever filled with zero when unknown. observed_at is when the API read the replication state, not when data last synchronized. A stopped, failed or unreadable pipeline reports its tables as stopped or unknown rather than live, and keeps each table's last recorded state. Returns an empty list when Warehouse is not set up, its publication is missing, or it is being disabled or failed to clean up.
0 commit comments