basalt / prisma/src / TenantClientPoolOptions
Interface: TenantClientPoolOptions<TClient>
Defined in: prisma/src/pool.ts:3
Type Parameters
TClient
TClient
Properties
acquireTimeoutMs?
> optional acquireTimeoutMs?: number
Defined in: prisma/src/pool.ts:28
How long get()/acquire() wait for a free slot when every open client is in use, before failing with TenantPoolExhaustedError (503). The pool never opens more than max clients to serve a new tenant. Default: 10_000.
idleMs?
> optional idleMs?: number
Defined in: prisma/src/pool.ts:22
How long a client handed out by get() still counts as in use after the call, in milliseconds. get() cannot know when its caller is done (an HTTP request, a job), so the pool treats the client as busy for this long and never evicts — or disconnects — it in that window. Clients held through acquire()/use() are tracked exactly instead, and are never evicted while leased, whatever this says. Default: 30_000.
max?
> optional max?: number
Defined in: prisma/src/pool.ts:13
Maximum simultaneously open clients. Default: 10
Methods
create()
> create(tenantId): TClient | Promise<TClient>
Defined in: prisma/src/pool.ts:5
Creates the client for a tenant (e.g. new PrismaClient({ datasourceUrl })).
Parameters
tenantId
string
Returns
TClient | Promise<TClient>
destroy()?
> optional destroy(client, tenantId): void | Promise<void>
Defined in: prisma/src/pool.ts:11
Called when a client is evicted or on destroyAll(). Default: calls client.$disconnect() when the client has one, so evicted clients never keep their connections open.
Parameters
client
TClient
tenantId
string
Returns
void | Promise<void>