package app import ( "fmt" "net/url" "github.com/seaweedfs/seaweedfs/weed/admin/dash" "github.com/seaweedfs/seaweedfs/weed/s3api/s3tables" ) templ S3TablesBuckets(data dash.S3TablesBucketsData) {

S3 Tables Buckets

if data.IcebergPort > 0 { } if data.LancePort > 0 { }
if data.IcebergPort > 0 || data.LancePort > 0 {
Catalog endpoints

Each table bucket is a catalog. Which endpoint serves it depends on the format it holds.

if data.IcebergPort > 0 {
ICEBERG { fmt.Sprintf("http://localhost:%d", data.IcebergPort) }/v1
} if data.LancePort > 0 {
LANCE { fmt.Sprintf("http://localhost:%d", data.LancePort) }
}
} if data.IcebergPort == 0 && data.LancePort == 0 {
No catalog endpoint is running. Start `weed s3` with `-s3.port.iceberg` or `-s3.port.lance`, and point admin at it with `-iceberg.port` or `-lance.port`.
}
Total Buckets
{ fmt.Sprintf("%d", data.TotalBuckets) }
Last Updated
{ data.LastUpdated.Format("2006-01-02 15:04") }
Iceberg REST Port
if data.IcebergPort > 0 { { fmt.Sprintf("%d", data.IcebergPort) } } else { - }
Table Buckets
for _, bucket := range data.Buckets { } if len(data.Buckets) == 0 { }
Name Format Owner ARN Catalog Endpoint Created Actions
{ bucket.Name } { formatLabel(bucket.Format) } { bucket.OwnerAccountID } { bucket.ARN } { bucketCatalogPath(bucket.Format, bucket.Name) } { bucket.CreatedAt.Format("2006-01-02 15:04") }
{{ bucketName, parseErr := s3tables.ParseBucketNameFromARN(bucket.ARN) }} if parseErr == nil { } else { }
No table buckets found

Create your first S3 Tables bucket to get started.

if data.IcebergPort > 0 || data.LancePort > 0 {
Client Examples
if data.IcebergPort > 0 {
ICEBERGDuckDB
								
									{ `INSTALL iceberg;
LOAD iceberg;

CREATE SECRET (
    TYPE ICEBERG,
    ENDPOINT 'http://localhost:` + fmt.Sprintf("%d", data.IcebergPort) + `',
    SCOPE 's3://my-table-bucket/'
);

SELECT * FROM iceberg_scan('s3://my-table-bucket/my-namespace/my-table');` }
								
							
ICEBERGPython (PyIceberg)
								
									{ `from pyiceberg.catalog import load_catalog

catalog = load_catalog(
    name="seaweedfs",
    **{
        "type": "rest",
        "uri": "http://localhost:` + fmt.Sprintf("%d", data.IcebergPort) + `",
        "warehouse": "s3://my-table-bucket/",
    }
)

namespaces = catalog.list_namespaces()` }
								
							
} if data.LancePort > 0 {
0) }>LANCEPython (lance-namespace)
									
										{ `from lance_namespace import connect

ns = connect("rest", {"uri": "http://localhost:` + fmt.Sprintf("%d", data.LancePort) + `"})

ns.list_namespaces(id=["my-table-bucket"])
ns.describe_table(id=["my-table-bucket", "my-namespace", "my-table"])` }
									
								
LANCEPython (pylance)
									
										{ `import lance
from lance_namespace import connect

ns = connect("rest", {"uri": "http://localhost:` + fmt.Sprintf("%d", data.LancePort) + `"})
table = ns.describe_table(id=["my-table-bucket", "my-namespace", "my-table"])

# The namespace vends both the location and the credentials to read it.
dataset = lance.dataset(table.location, storage_options=table.storage_options)` }
									
								
}
}
}