• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / storage / 18461456855

13 Oct 2025 09:35AM UTC coverage: 77.138% (+0.8%) from 76.366%
18461456855

Pull #774

github

web-flow
Merge 6bf5f5903 into 3562ba0f4
Pull Request #774: feat: vector buckets

1905 of 2759 branches covered (69.05%)

Branch coverage included in aggregate %.

2036 of 2315 new or added lines in 40 files covered. (87.95%)

23 existing lines in 2 files now uncovered.

23147 of 29718 relevant lines covered (77.89%)

95.49 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

84.91
/src/http/plugins/vector.ts
1
import fastifyPlugin from 'fastify-plugin'
1✔
2
import { FastifyInstance } from 'fastify'
1✔
3
import { getTenantConfig } from '@internal/database'
1✔
4
import {
1✔
5
  createS3VectorClient,
1✔
6
  KnexVectorMetadataDB,
1✔
7
  VectorStoreManager,
1✔
8
  S3Vector,
1✔
9
} from '@storage/protocols/vector'
1✔
10
import { getConfig } from '../../config'
1✔
11
import { ERRORS } from '@internal/errors'
1✔
12

1✔
13
declare module 'fastify' {
1✔
14
  interface FastifyRequest {
1✔
15
    s3Vector: VectorStoreManager
1✔
16
  }
1✔
17
}
1✔
18

1✔
19
const s3VectorClient = createS3VectorClient()
1✔
20
const s3VectorAdapter = new S3Vector(s3VectorClient)
1✔
21

1✔
22
export const s3vector = fastifyPlugin(async function (fastify: FastifyInstance) {
1✔
23
  fastify.addHook('preHandler', async (req) => {
122✔
24
    const { isMultitenant, vectorBucketS3, vectorMaxBucketsCount, vectorMaxIndexesCount } =
88✔
25
      getConfig()
88✔
26

88✔
27
    if (!vectorBucketS3) {
88!
NEW
28
      throw ERRORS.FeatureNotEnabled('vector', 'Vector service not configured')
×
NEW
29
    }
×
30

88✔
31
    let maxBucketCount = vectorMaxBucketsCount
88✔
32
    let maxIndexCount = vectorMaxIndexesCount
88✔
33

88✔
34
    if (isMultitenant) {
88!
NEW
35
      const { features } = await getTenantConfig(req.tenantId)
×
NEW
36
      maxBucketCount = features?.vectorBuckets?.maxBuckets || vectorMaxBucketsCount
×
NEW
37
      maxIndexCount = features?.vectorBuckets?.maxIndexes || vectorMaxIndexesCount
×
NEW
38
    }
×
39

88✔
40
    const db = req.db.pool.acquire()
88✔
41
    const store = new KnexVectorMetadataDB(db)
88✔
42
    req.s3Vector = new VectorStoreManager(s3VectorAdapter, store, {
88✔
43
      tenantId: req.tenantId,
88✔
44
      vectorBucketName: vectorBucketS3,
88✔
45
      maxBucketCount: maxBucketCount,
88✔
46
      maxIndexCount: maxIndexCount,
88✔
47
    })
88✔
48
  })
122✔
49
})
122✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc