MCPcopy Index your code
hub / github.com/simstudioai/sim / getFileMetadataByKeys

Function getFileMetadataByKeys

apps/sim/lib/uploads/server/metadata.ts:188–206  ·  view source on GitHub ↗
(
  keys: string[],
  context: StorageContext,
  executor: Pick<typeof db, 'select'> = db
)

Source from the content-addressed store, hash-verified

186 * Batches what would otherwise be N `getFileMetadataByKey` calls.
187 */
188export async function getFileMetadataByKeys(
189 keys: string[],
190 context: StorageContext,
191 executor: Pick<typeof db, 'select'> = db
192): Promise<FileMetadataRecord[]> {
193 if (keys.length === 0) {
194 return []
195 }
196 return executor
197 .select()
198 .from(workspaceFiles)
199 .where(
200 and(
201 inArray(workspaceFiles.key, keys),
202 eq(workspaceFiles.context, context),
203 isNull(workspaceFiles.deletedAt)
204 )
205 )
206}
207
208/**
209 * Get file metadata by ID

Calls 1

eqFunction · 0.50

Tested by

no test coverage detected