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) {
Each table bucket is a catalog. Which endpoint serves it depends on the format it holds.
{ fmt.Sprintf("http://localhost:%d", data.IcebergPort) }/v1
{ fmt.Sprintf("http://localhost:%d", data.LancePort) }
| 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") } | |
No table buckets foundCreate your first S3 Tables bucket to get started. |
||||||
{ `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');` }
{ `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 {
{ `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"])` }
{ `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)` }
}