Skip to content

Commit 35c766f

Browse files
committed
feat: add vector and analytics buckets to storage config
1 parent c540244 commit 35c766f

File tree

4 files changed

+74
-3
lines changed

4 files changed

+74
-3
lines changed

pkg/config/config.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,14 @@ func (s *storage) Clone() storage {
295295
img := *s.ImageTransformation
296296
copy.ImageTransformation = &img
297297
}
298+
if s.IcebergCatalog != nil {
299+
iceberg := *s.IcebergCatalog
300+
copy.IcebergCatalog = &iceberg
301+
}
302+
if s.VectorBuckets != nil {
303+
vector := *s.VectorBuckets
304+
copy.VectorBuckets = &vector
305+
}
298306
if s.S3Protocol != nil {
299307
s3 := *s.S3Protocol
300308
copy.S3Protocol = &s3

pkg/config/storage.go

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ type (
1414
ImgProxyImage string `toml:"-"`
1515
FileSizeLimit sizeInBytes `toml:"file_size_limit"`
1616
ImageTransformation *imageTransformation `toml:"image_transformation"`
17+
IcebergCatalog *icebergCatalog `toml:"iceberg_catalog"`
18+
VectorBuckets *vectorBuckets `toml:"vector_buckets"`
1719
S3Protocol *s3Protocol `toml:"s3_protocol"`
1820
S3Credentials storageS3Credentials `toml:"-"`
1921
Buckets BucketConfig `toml:"buckets"`
@@ -23,6 +25,19 @@ type (
2325
Enabled bool `toml:"enabled"`
2426
}
2527

28+
icebergCatalog struct {
29+
Enabled bool `toml:"enabled"`
30+
MaxNamespaces uint `toml:"max_namespaces"`
31+
MaxTables uint `toml:"max_tables"`
32+
MaxCatalogs uint `toml:"max_catalogs"`
33+
}
34+
35+
vectorBuckets struct {
36+
Enabled bool `toml:"enabled"`
37+
MaxBuckets uint `toml:"max_buckets"`
38+
MaxIndexes uint `toml:"max_indexes"`
39+
}
40+
2641
s3Protocol struct {
2742
Enabled bool `toml:"enabled"`
2843
}
@@ -70,6 +85,17 @@ func (s *storage) ToUpdateStorageConfigBody() v1API.UpdateStorageConfigBody {
7085
if s.ImageTransformation != nil {
7186
body.Features.ImageTransformation.Enabled = s.ImageTransformation.Enabled
7287
}
88+
if s.IcebergCatalog != nil {
89+
body.Features.IcebergCatalog.Enabled = s.IcebergCatalog.Enabled
90+
body.Features.IcebergCatalog.MaxNamespaces = cast.UintToInt(s.IcebergCatalog.MaxNamespaces)
91+
body.Features.IcebergCatalog.MaxTables = cast.UintToInt(s.IcebergCatalog.MaxTables)
92+
body.Features.IcebergCatalog.MaxCatalogs = cast.UintToInt(s.IcebergCatalog.MaxCatalogs)
93+
}
94+
if s.VectorBuckets != nil {
95+
body.Features.VectorBuckets.Enabled = s.VectorBuckets.Enabled
96+
body.Features.VectorBuckets.MaxBuckets = cast.UintToInt(s.VectorBuckets.MaxBuckets)
97+
body.Features.VectorBuckets.MaxIndexes = cast.UintToInt(s.VectorBuckets.MaxIndexes)
98+
}
7399
if s.S3Protocol != nil {
74100
body.Features.S3Protocol.Enabled = s.S3Protocol.Enabled
75101
}
@@ -83,6 +109,17 @@ func (s *storage) FromRemoteStorageConfig(remoteConfig v1API.StorageConfigRespon
83109
if s.ImageTransformation != nil {
84110
s.ImageTransformation.Enabled = remoteConfig.Features.ImageTransformation.Enabled
85111
}
112+
if s.IcebergCatalog != nil {
113+
s.IcebergCatalog.Enabled = remoteConfig.Features.IcebergCatalog.Enabled
114+
s.IcebergCatalog.MaxNamespaces = cast.IntToUint(remoteConfig.Features.IcebergCatalog.MaxNamespaces)
115+
s.IcebergCatalog.MaxTables = cast.IntToUint(remoteConfig.Features.IcebergCatalog.MaxTables)
116+
s.IcebergCatalog.MaxCatalogs = cast.IntToUint(remoteConfig.Features.IcebergCatalog.MaxCatalogs)
117+
}
118+
if s.VectorBuckets != nil {
119+
s.VectorBuckets.Enabled = remoteConfig.Features.VectorBuckets.Enabled
120+
s.VectorBuckets.MaxBuckets = cast.IntToUint(remoteConfig.Features.VectorBuckets.MaxBuckets)
121+
s.VectorBuckets.MaxIndexes = cast.IntToUint(remoteConfig.Features.VectorBuckets.MaxIndexes)
122+
}
86123
if s.S3Protocol != nil {
87124
s.S3Protocol.Enabled = remoteConfig.Features.S3Protocol.Enabled
88125
}

pkg/config/templates/config.toml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,25 @@ enabled = true
105105
# The maximum file size allowed (e.g. "5MB", "500KB").
106106
file_size_limit = "50MiB"
107107

108+
# [storage.s3_protocol]
109+
# enabled = true
110+
108111
# Image transformation API is available to Supabase Pro plan.
109112
# [storage.image_transformation]
110113
# enabled = true
111114

112-
# [storage.s3_protocol]
113-
# enabled = false
115+
# Iceberge Catalog is available to Supabase Pro plan.
116+
# [storage.iceberg_catalog]
117+
# enabled = true
118+
# max_namespaces = 0
119+
# max_tables = 0
120+
# max_catalogs = 0
121+
122+
# Vector Buckets is available to Supabase Pro plan.
123+
# [storage.vector_buckets]
124+
# enabled = true
125+
# max_buckets = 0
126+
# max_indexes = 0
114127

115128
# Uncomment to configure local storage buckets
116129
# [storage.buckets.images]

pkg/config/testdata/config.toml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,25 @@ enabled = true
105105
# The maximum file size allowed (e.g. "5MB", "500KB").
106106
file_size_limit = "50MiB"
107107

108+
[storage.s3_protocol]
109+
enabled = true
110+
108111
# Image transformation API is available to Supabase Pro plan.
109112
[storage.image_transformation]
110113
enabled = true
111114

112-
[storage.s3_protocol]
115+
# Iceberge Catalog is available to Supabase Pro plan.
116+
[storage.iceberg_catalog]
117+
enabled = true
118+
max_namespaces = 0
119+
max_tables = 0
120+
max_catalogs = 0
121+
122+
# Vector Buckets is available to Supabase Pro plan.
123+
[storage.vector_buckets]
113124
enabled = true
125+
max_buckets = 0
126+
max_indexes = 0
114127

115128
# Uncomment to configure local storage buckets
116129
[storage.buckets.images]

0 commit comments

Comments
 (0)