Skip to content

Function: captureServicePrincipalPool()

captureServicePrincipalPool(pool): LakebasePool

Capture AppKit’s existing service-principal Lakebase pool.

Call this during setup:complete, outside any asUser() scope. AppKit’s exported pool routes dynamically by request context, but its runtime activePool() method returns the already-created underlying pool selected in the current context. Capturing it once at startup pins application-owned storage to the service principal without creating another pool or connection.

A future AppKit version may export a fixed pool directly; in that case the pool has no activePool() method and is returned unchanged.

LakebasePool

LakebasePool