Skip to content

feat(storage): list the tables of an Iceberg namespace - #905

Merged
Tr00d merged 5 commits into
masterfrom
feat/storage.analytics.list_tables
Nov 26, 2026
Merged

Tr00d merged 5 commits into
masterfrom
feat/storage.analytics.list_tables

Conversation

@Tr00d

@Tr00d Tr00d commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Summary

A caller can list the tables of an Iceberg namespace, one page at a time.

Capability: storage.analytics.list_tables - List Iceberg Tables. No capability spec exists; the contract comes from the supabase/storage Iceberg table routes.

Public API

// IIcebergCatalog
Task<IcebergTablePage> ListTablesAsync(IcebergNamespace @namespace, ListTablesOptions? options = null, CancellationToken cancellationToken = default);

// new, Supabase.Storage.ListTables
public sealed record ListTablesOptions { int? PageSize; string? PageToken }   // unset: not sent
public sealed record IcebergTablePage { IReadOnlyList<IcebergTable> Tables /* empty */; string? NextPageToken }
var catalog = storage.Analytics.From("analytics-data");
var page = await catalog.ListTablesAsync(IcebergNamespace.Of("sales"));
foreach (var table in page.Tables)
    Console.WriteLine(table.Name);

Behavior

  • GET {storageUrl}/iceberg/v1/{bucket}/namespaces/{namespace}/tables[?pageToken&pageSize], service-role key, no body. Each paging parameter is sent only when set.
  • 200 maps identifiers to IcebergTables, in the order the service listed them, using the namespace the service sent. An identifier without a namespace falls back to the namespace that was listed. A missing identifiers becomes an empty page, and next-page-token becomes NextPageToken.
  • Storage applies pageSize as a limit, ignores pageToken and never sends next-page-token today. The interface docs say so.
  • Failures throw SupabaseStorageException, with the Iceberg error type in Code:
    • 404 NoSuchNamespaceException or NoSuchCatalog (Reason NotFound)
    • 400 for a negative page size (the service validates it)
    • 403 AccessDenied
  • A null namespace throws ArgumentNullException, and a ./.. namespace throws ArgumentException, before any request.

Deviations from supabase-js

  • Typed IcebergTable identifiers instead of raw { namespace, name } objects.

Tests

Tier Class Pins
Contract ListTablesContractTests GET, path, no body, no query without options, page size and token, namespace encoding, table mapping and namespace fallback, empty page, next-page token, the 404 / 400 / 403 failures, headers read at call time, cancellation, no capture of the caller's context
Unit ListTablesTests null and relative namespace, default options and page

No E2E: the local stack does not serve the Iceberg routes. Storage registers them only with ICEBERG_ENABLED, which the CLI does not set locally, and table operations proxy to an external Iceberg REST catalog.

Changed-line coverage: 100% (33 lines). Mutation: 37/37 on the changed files (33 killed, 4 timeouts on the ConfigureAwait(false) mutants), 0 survivors.

Notes

  • ListNamespacesQuery and the new ListTablesQuery share an internal Common/QueryString helper (Append, Parameter) instead of each keeping its own copy. ListNamespacesAsync's behavior is unchanged and its tests are untouched.

…ics.list_tables

# Conflicts:
#	packages/Storage/Storage/IcebergCatalog.cs
#	packages/Storage/Storage/Interfaces/IIcebergCatalog.cs
…ics.list_tables

# Conflicts:
#	packages/Storage/Storage/IcebergCatalog.cs
#	packages/Storage/Storage/Interfaces/IIcebergCatalog.cs
@Tr00d
Tr00d marked this pull request as ready for review November 26, 2026 10:06
@Tr00d
Tr00d merged commit 2838485 into master Nov 26, 2026
7 checks passed
@Tr00d
Tr00d deleted the feat/storage.analytics.list_tables branch November 26, 2026 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant