Skip to content

Commit 964e4b9

Browse files
docs: update js client libraries (2.86.0) (supabase#40845)
1 parent ea094ad commit 964e4b9

16 files changed

+15732
-14966
lines changed

apps/docs/features/docs/__snapshots__/Reference.typeSpec.test.ts.snap

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84221,6 +84221,63 @@ exports[`TS type spec parsing > matches snapshot 1`] = `
8422184221
]
8422284222
}
8422384223
},
84224+
"@supabase/storage-js.packages/StorageAnalyticsClient.default.from": {
84225+
"name": "@supabase/storage-js.packages/StorageAnalyticsClient.default.from",
84226+
"params": [
84227+
{
84228+
"name": "bucketName",
84229+
"type": {
84230+
"type": "intrinsic",
84231+
"name": "string"
84232+
},
84233+
"comment": {
84234+
"shortText": "The name of the analytics bucket (warehouse) to connect to"
84235+
}
84236+
}
84237+
],
84238+
"ret": {
84239+
"type": {
84240+
"type": "nameOnly",
84241+
"name": "IcebergRestCatalog"
84242+
}
84243+
},
84244+
"comment": {
84245+
"shortText": "Get an Iceberg REST Catalog client configured for a specific analytics bucket\\nUse this to perform advanced table and namespace operations within the bucket\\nThe returned client provides full access to the Apache Iceberg REST Catalog API\\n\\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.",
84246+
"tags": [
84247+
{
84248+
"tag": "alpha",
84249+
"text": ""
84250+
}
84251+
],
84252+
"examples": [
84253+
{
84254+
"id": "get-catalog-and-create-table",
84255+
"name": "Get catalog and create table",
84256+
"code": "\`\`\`js\\n// First, create an analytics bucket\\nconst { data: bucket, error: bucketError } = await supabase\\n .storage\\n .analytics\\n .createBucket('analytics-data')\\n\\n// Get the Iceberg catalog for that bucket\\nconst catalog = supabase.storage.analytics.from('analytics-data')\\n\\n// Create a namespace\\nawait catalog.createNamespace({ namespace: ['default'] })\\n\\n// Create a table with schema\\nawait catalog.createTable(\\n { namespace: ['default'] },\\n {\\n name: 'events',\\n schema: {\\n type: 'struct',\\n fields: [\\n { id: 1, name: 'id', type: 'long', required: true },\\n { id: 2, name: 'timestamp', type: 'timestamp', required: true },\\n { id: 3, name: 'user_id', type: 'string', required: false }\\n ],\\n 'schema-id': 0,\\n 'identifier-field-ids': [1]\\n },\\n 'partition-spec': {\\n 'spec-id': 0,\\n fields: []\\n },\\n 'write-order': {\\n 'order-id': 0,\\n fields: []\\n },\\n properties: {\\n 'write.format.default': 'parquet'\\n }\\n }\\n)\\n\`\`\`"
84257+
},
84258+
{
84259+
"id": "list-tables-in-namespace",
84260+
"name": "List tables in namespace",
84261+
"code": "\`\`\`js\\nconst catalog = supabase.storage.analytics.from('analytics-data')\\n\\n// List all tables in the default namespace\\nconst tables = await catalog.listTables({ namespace: ['default'] })\\nconsole.log(tables) // [{ namespace: ['default'], name: 'events' }]\\n\`\`\`"
84262+
},
84263+
{
84264+
"id": "working-with-namespaces",
84265+
"name": "Working with namespaces",
84266+
"code": "\`\`\`js\\nconst catalog = supabase.storage.analytics.from('analytics-data')\\n\\n// List all namespaces\\nconst namespaces = await catalog.listNamespaces()\\n\\n// Create namespace with properties\\nawait catalog.createNamespace(\\n { namespace: ['production'] },\\n { properties: { owner: 'data-team', env: 'prod' } }\\n)\\n\`\`\`"
84267+
},
84268+
{
84269+
"id": "cleanup-operations",
84270+
"name": "Cleanup operations",
84271+
"code": "\`\`\`js\\nconst catalog = supabase.storage.analytics.from('analytics-data')\\n\\n// Drop table with purge option (removes all data)\\nawait catalog.dropTable(\\n { namespace: ['default'], name: 'events' },\\n { purge: true }\\n)\\n\\n// Drop namespace (must be empty)\\nawait catalog.dropNamespace({ namespace: ['default'] })\\n\`\`\`"
84272+
},
84273+
{
84274+
"id": "error-handling-with-catalog-operations",
84275+
"name": "Error handling with catalog operations",
84276+
"code": "\`\`\`js\\nimport { IcebergError } from 'iceberg-js'\\n\\nconst catalog = supabase.storage.analytics.from('analytics-data')\\n\\ntry {\\n await catalog.dropTable({ namespace: ['default'], name: 'events' }, { purge: true })\\n} catch (error) {\\n // Handle 404 errors (resource not found)\\n const is404 =\\n (error instanceof IcebergError && error.status === 404) ||\\n error?.status === 404 ||\\n error?.details?.error?.code === 404\\n\\n if (is404) {\\n console.log('Table does not exist')\\n } else {\\n throw error // Re-throw other errors\\n }\\n}\\n\`\`\`"
84277+
}
84278+
]
84279+
}
84280+
},
8422484281
"@supabase/storage-js.packages/StorageAnalyticsClient.default.listBuckets": {
8422584282
"name": "@supabase/storage-js.packages/StorageAnalyticsClient.default.listBuckets",
8422684283
"params": [

apps/docs/spec/common-client-libs-sections.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,6 +1059,13 @@
10591059
"product": "storage",
10601060
"type": "function",
10611061
"items": [
1062+
{
1063+
"id": "storageanalytics-from",
1064+
"title": "Access an analytics bucket",
1065+
"slug": "storageanalytics-from",
1066+
"type": "function",
1067+
"product": "storage"
1068+
},
10621069
{
10631070
"id": "storageanalytics-createbucket",
10641071
"title": "Create a new analytics bucket",

0 commit comments

Comments
 (0)