@@ -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": [
0 commit comments