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

supabase / storage / 25738155938

12 May 2026 01:38PM UTC coverage: 39.251% (-35.1%) from 74.366%
25738155938

Pull #1094

github

web-flow
Merge 0f3efcca0 into defbbb616
Pull Request #1094: feat: embedded vector store

2188 of 6152 branches covered (35.57%)

Branch coverage included in aggregate %.

88 of 280 new or added lines in 6 files covered. (31.43%)

3689 existing lines in 165 files now uncovered.

4312 of 10408 relevant lines covered (41.43%)

34.74 hits per line

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

50.0
/src/http/plugins/storage.ts
1
import { createStorageBackend, StorageBackendAdapter } from '@storage/backend'
2
import { CdnCacheManager } from '@storage/cdn/cdn-cache-manager'
3
import { StorageKnexDB } from '@storage/database'
4
import { PassThroughLocation, TenantLocation } from '@storage/locator'
5
import { Storage } from '@storage/storage'
6
import fastifyPlugin from 'fastify-plugin'
7
import { getConfig } from '../../config'
8

9
declare module 'fastify' {
10
  interface FastifyRequest {
11
    storage: Storage
12
    backend: StorageBackendAdapter
13
    cdnCache: CdnCacheManager
14
  }
15
}
16

17
const { storageBackendType, storageS3Bucket } = getConfig()
3✔
18

19
const storageBackend = createStorageBackend(storageBackendType)
3✔
20

21
export const storage = fastifyPlugin(
3✔
22
  async function storagePlugin(fastify) {
23
    fastify.decorateRequest('storage')
4✔
24
    fastify.addHook('preHandler', async (request) => {
4✔
UNCOV
25
      const database = new StorageKnexDB(request.db, {
×
26
        tenantId: request.tenantId,
27
        host: request.headers['x-forwarded-host'] as string,
28
        reqId: request.id,
29
        sbReqId: request.sbReqId,
30
        latestMigration: request.latestMigration,
31
      })
32

UNCOV
33
      const location = request.isIcebergBucket
×
34
        ? new PassThroughLocation(request.internalIcebergBucketName!)
35
        : new TenantLocation(storageS3Bucket)
36

UNCOV
37
      request.backend = storageBackend
×
UNCOV
38
      request.storage = new Storage(storageBackend, database, location)
×
UNCOV
39
      request.cdnCache = new CdnCacheManager(request.storage)
×
40
    })
41

42
    fastify.addHook('onClose', async () => {
4✔
43
      storageBackend.close()
4✔
44
    })
45
  },
46
  { name: 'storage-init' }
47
)
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