Skip to main content

Interface: LakebasePoolManager

Interface: LakebasePoolManager

Manages multiple Lakebase connection pools keyed by an identifier (e.g. userId).

Used for On-Behalf-Of (OBO) scenarios where each user needs their own pool with their own OAuth token refresh, enabling features like Row-Level Security.

Properties

size

readonly size: number;

Number of active pools.

Methods

closeAll()

closeAll(): Promise<void>;

Close all managed pools and stop cleanup (for graceful shutdown).

Returns

Promise<void>


closePool()

closePool(key: string): Promise<void>;

Close and remove a specific pool.

Parameters

ParameterType
keystring

Returns

Promise<void>


getPool()

getPool(
   key: string, 
   perPoolConfig: Partial<LakebasePoolConfig>, 
   tokenFingerprint?: string): Pool;

Get an existing pool or create a new one for the given key. When creating, merges perPoolConfig with the base config passed to the factory.

If tokenFingerprint is provided and differs from the cached pool's fingerprint, the stale pool is closed and a fresh one is created with the new config (including the updated workspaceClient).

Parameters

ParameterType
keystring
perPoolConfigPartial<LakebasePoolConfig>
tokenFingerprint?string

Returns

Pool


hasPool()

hasPool(key: string): boolean;

Check whether a pool exists for the given key.

Parameters

ParameterType
keystring

Returns

boolean

Databricks Developer Hub

Ready to ship your next agentic app in minutes?

Read docs