Skip to content

Class: LakebaseMachineOwnershipStore

Lakebase-backed ownership and expiration records for one connecting role.

Tables live in dbx_tools_databricks_sandbox_<hash(current_user)> so each workspace user or app service principal owns its partition. The runtime treats these records as its application-level machine visibility boundary. Databricks workspace authorization remains authoritative for the underlying REST and SSH operations.

readonly schema: string

assign(input): Promise<void>

Inserts or replaces one assignment and its managed name and expiration.

string = ...

string = ...

string = ...

string = ...

string = ...

Promise<void>


close(): Promise<void>

Releases store-owned resources without closing the caller-owned pool.

Promise<void>


deleteMachineServiceProject(workspaceScope, machineId, serviceKind): Promise<boolean>

Deletes one machine-owned service project and returns whether a row was removed.

string

string

"terminal" | "desktop" | "stats"

Promise<boolean>


deleteMachineServiceProjectsForMachine(workspaceScope, machineId): Promise<number>

Deletes all machine-owned service projects for one Sandbox.

string

string

Promise<number>


deleteProject(workspaceScope, userId, projectId): Promise<boolean>

Deletes one persisted project and returns whether a row was removed.

string

string

string

Promise<boolean>


deleteProjectsForMachine(workspaceScope, machineId): Promise<number>

Deletes all persisted projects for one Sandbox.

string

string

Promise<number>


deleteProjectsForOwnerMachine(workspaceScope, userId, machineId): Promise<number>

Deletes one owner’s persisted projects for a shared Sandbox.

string

string

string

Promise<number>


get(workspaceScope, userId, machineId): Promise<{ createdAt: string; expiresAt?: string; machineId: string; managedName?: string; userId: string; workspaceScope: string; } | undefined>

Returns one assignment by workspace, user, and Sandbox ID.

string

string

string

Promise<{ createdAt: string; expiresAt?: string; machineId: string; managedName?: string; userId: string; workspaceScope: string; } | undefined>


getMachineServiceProject(workspaceScope, machineId, serviceKind): Promise<{ config: Record<string, JSONType>; createdAt: string; definitionVersion: number; directory: string; machineId: string; openPath?: string; path: string; port: number; serviceKind: "terminal" | "desktop" | "stats"; stripPrefix: boolean; updatedAt: string; workspaceScope: string; } | undefined>

Returns one machine-owned service project by workspace, Sandbox, and service kind.

string

string

"terminal" | "desktop" | "stats"

Promise<{ config: Record<string, JSONType>; createdAt: string; definitionVersion: number; directory: string; machineId: string; openPath?: string; path: string; port: number; serviceKind: "terminal" | "desktop" | "stats"; stripPrefix: boolean; updatedAt: string; workspaceScope: string; } | undefined>


getProject(workspaceScope, userId, projectId): Promise<{ config: Record<string, JSONType>; createdAt: string; directory: string; machineId: string; name: string; openPath?: string; path: string; port: number; projectId: string; projectPath: string; route: boolean; serviceDependencies: ("terminal" | "desktop" | "stats")[]; stripPrefix: boolean; updatedAt: string; userId: string; workspaceScope: string; } | undefined>

Returns one persisted project by workspace, owner, and project ID.

string

string

string

Promise<{ config: Record<string, JSONType>; createdAt: string; directory: string; machineId: string; name: string; openPath?: string; path: string; port: number; projectId: string; projectPath: string; route: boolean; serviceDependencies: ("terminal" | "desktop" | "stats")[]; stripPrefix: boolean; updatedAt: string; userId: string; workspaceScope: string; } | undefined>


getProjectByName(workspaceScope, userId, machineId, name): Promise<{ config: Record<string, JSONType>; createdAt: string; directory: string; machineId: string; name: string; openPath?: string; path: string; port: number; projectId: string; projectPath: string; route: boolean; serviceDependencies: ("terminal" | "desktop" | "stats")[]; stripPrefix: boolean; updatedAt: string; userId: string; workspaceScope: string; } | undefined>

Returns one persisted project by workspace, owner, machine, and name.

string

string

string

string

Promise<{ config: Record<string, JSONType>; createdAt: string; directory: string; machineId: string; name: string; openPath?: string; path: string; port: number; projectId: string; projectPath: string; route: boolean; serviceDependencies: ("terminal" | "desktop" | "stats")[]; stripPrefix: boolean; updatedAt: string; userId: string; workspaceScope: string; } | undefined>


listAssignments(workspaceScope, userId?): Promise<object[]>

Lists assignments in one workspace, optionally restricted to one AppKit user.

string

string

Promise<object[]>


listMachineServiceProjects(workspaceScope, machineId?): Promise<object[]>

Lists machine-owned service projects in one workspace, optionally for one Sandbox.

string

string

Promise<object[]>


listProjects(workspaceScope, filters?): Promise<object[]>

Lists persisted projects in one workspace with optional owner and machine filters.

string

string

string

Promise<object[]>


unassign(workspaceScope, userId, machineId): Promise<boolean>

Removes one user’s assignment and returns whether a row was deleted.

string

string

string

Promise<boolean>


unassignAll(workspaceScope, machineId): Promise<number>

Removes every assignment for one Sandbox and returns the deleted row count.

string

string

Promise<number>


upsertMachineServiceProject(input): Promise<void>

Inserts or updates one machine-owned service project.

Record<string, JSONType> = ...

number = ...

string = ...

string = ...

string = ...

string = ...

number = ...

"terminal" | "desktop" | "stats" = ...

boolean = ...

string = ...

Promise<void>


upsertProject(input): Promise<void>

Inserts or updates one persisted Sandbox project.

Record<string, JSONType> = ...

string = ...

string = ...

string = ...

string = ...

string = ...

number = ...

string = ...

string = ...

boolean = ...

("terminal" | "desktop" | "stats")[] = ...

boolean = ...

string = ...

string = ...

Promise<void>


withMachineServiceProjectLock<T>(workspaceScope, machineId, serviceKind, operation): Promise<T>

Runs one service-project operation under its machine- and service-scoped advisory lock.

T

string

string

"terminal" | "desktop" | "stats"

() => Promise<T>

Promise<T>


withReaperLock<T>(workspaceScope, operation): Promise<T>

Runs one reconciliation pass while holding a workspace-scoped advisory lock.

T

string

() => Promise<T>

Promise<T>


static create(pool): Promise<LakebaseMachineOwnershipStore>

Detects the connecting Lakebase role, then creates tables in its schema.

LakebasePool

Promise<LakebaseMachineOwnershipStore>