basalt / files-prisma/src / PrismaFileStore
Class: PrismaFileStore
Defined in: files-prisma/src/index.ts:84
Where file metadata lives — the app's database in production.
Implements
Constructors
Constructor
> new PrismaFileStore(client, options?): PrismaFileStore
Defined in: files-prisma/src/index.ts:87
Parameters
client
options?
Returns
PrismaFileStore
Methods
create()
> create(record): Promise<void>
Defined in: files-prisma/src/index.ts:94
Parameters
record
Returns
Promise<void>
Implementation of
delete()
> delete(tenantId, id): Promise<void>
Defined in: files-prisma/src/index.ts:139
Parameters
tenantId
string
id
string
Returns
Promise<void>
Implementation of
find()
> find(tenantId, id): Promise<FileRecord | null>
Defined in: files-prisma/src/index.ts:112
Parameters
tenantId
string
id
string
Returns
Promise<FileRecord | null>
Implementation of
list()
> list(tenantId): Promise<FileRecord[]>
Defined in: files-prisma/src/index.ts:117
Parameters
tenantId
string
Returns
Promise<FileRecord[]>
Implementation of
totalSize()
> totalSize(tenantId): Promise<number>
Defined in: files-prisma/src/index.ts:148
Summed in the database rather than by listing and adding up in JS: a quota check runs on every upload, and a tenant with fifty thousand files should not move fifty thousand rows across the wire to learn one number.
Parameters
tenantId
string
Returns
Promise<number>
Implementation of
update()
> update(tenantId, id, patch): Promise<FileRecord | null>
Defined in: files-prisma/src/index.ts:125
Parameters
tenantId
string
id
string
patch
Returns
Promise<FileRecord | null>