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.
Properties
Section titled “Properties”schema
Section titled “schema”
readonlyschema:string
Methods
Section titled “Methods”assign()
Section titled “assign()”assign(
input):Promise<void>
Inserts or replaces one assignment and its managed name and expiration.
Parameters
Section titled “Parameters”expiresAt
Section titled “expiresAt”string = ...
machineId
Section titled “machineId”string = ...
managedName
Section titled “managedName”string = ...
userId
Section titled “userId”string = ...
workspaceScope
Section titled “workspaceScope”string = ...
Returns
Section titled “Returns”Promise<void>
close()
Section titled “close()”close():
Promise<void>
Releases store-owned resources without closing the caller-owned pool.
Returns
Section titled “Returns”Promise<void>
deleteMachineServiceProject()
Section titled “deleteMachineServiceProject()”deleteMachineServiceProject(
workspaceScope,machineId,serviceKind):Promise<boolean>
Deletes one machine-owned service project and returns whether a row was removed.
Parameters
Section titled “Parameters”workspaceScope
Section titled “workspaceScope”string
machineId
Section titled “machineId”string
serviceKind
Section titled “serviceKind”"terminal" | "desktop" | "stats"
Returns
Section titled “Returns”Promise<boolean>
deleteMachineServiceProjectsForMachine()
Section titled “deleteMachineServiceProjectsForMachine()”deleteMachineServiceProjectsForMachine(
workspaceScope,machineId):Promise<number>
Deletes all machine-owned service projects for one Sandbox.
Parameters
Section titled “Parameters”workspaceScope
Section titled “workspaceScope”string
machineId
Section titled “machineId”string
Returns
Section titled “Returns”Promise<number>
deleteProject()
Section titled “deleteProject()”deleteProject(
workspaceScope,userId,projectId):Promise<boolean>
Deletes one persisted project and returns whether a row was removed.
Parameters
Section titled “Parameters”workspaceScope
Section titled “workspaceScope”string
userId
Section titled “userId”string
projectId
Section titled “projectId”string
Returns
Section titled “Returns”Promise<boolean>
deleteProjectsForMachine()
Section titled “deleteProjectsForMachine()”deleteProjectsForMachine(
workspaceScope,machineId):Promise<number>
Deletes all persisted projects for one Sandbox.
Parameters
Section titled “Parameters”workspaceScope
Section titled “workspaceScope”string
machineId
Section titled “machineId”string
Returns
Section titled “Returns”Promise<number>
deleteProjectsForOwnerMachine()
Section titled “deleteProjectsForOwnerMachine()”deleteProjectsForOwnerMachine(
workspaceScope,userId,machineId):Promise<number>
Deletes one owner’s persisted projects for a shared Sandbox.
Parameters
Section titled “Parameters”workspaceScope
Section titled “workspaceScope”string
userId
Section titled “userId”string
machineId
Section titled “machineId”string
Returns
Section titled “Returns”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.
Parameters
Section titled “Parameters”workspaceScope
Section titled “workspaceScope”string
userId
Section titled “userId”string
machineId
Section titled “machineId”string
Returns
Section titled “Returns”Promise<{ createdAt: string; expiresAt?: string; machineId: string; managedName?: string; userId: string; workspaceScope: string; } | undefined>
getMachineServiceProject()
Section titled “getMachineServiceProject()”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.
Parameters
Section titled “Parameters”workspaceScope
Section titled “workspaceScope”string
machineId
Section titled “machineId”string
serviceKind
Section titled “serviceKind”"terminal" | "desktop" | "stats"
Returns
Section titled “Returns”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()
Section titled “getProject()”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.
Parameters
Section titled “Parameters”workspaceScope
Section titled “workspaceScope”string
userId
Section titled “userId”string
projectId
Section titled “projectId”string
Returns
Section titled “Returns”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()
Section titled “getProjectByName()”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.
Parameters
Section titled “Parameters”workspaceScope
Section titled “workspaceScope”string
userId
Section titled “userId”string
machineId
Section titled “machineId”string
string
Returns
Section titled “Returns”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()
Section titled “listAssignments()”listAssignments(
workspaceScope,userId?):Promise<object[]>
Lists assignments in one workspace, optionally restricted to one AppKit user.
Parameters
Section titled “Parameters”workspaceScope
Section titled “workspaceScope”string
userId?
Section titled “userId?”string
Returns
Section titled “Returns”Promise<object[]>
listMachineServiceProjects()
Section titled “listMachineServiceProjects()”listMachineServiceProjects(
workspaceScope,machineId?):Promise<object[]>
Lists machine-owned service projects in one workspace, optionally for one Sandbox.
Parameters
Section titled “Parameters”workspaceScope
Section titled “workspaceScope”string
machineId?
Section titled “machineId?”string
Returns
Section titled “Returns”Promise<object[]>
listProjects()
Section titled “listProjects()”listProjects(
workspaceScope,filters?):Promise<object[]>
Lists persisted projects in one workspace with optional owner and machine filters.
Parameters
Section titled “Parameters”workspaceScope
Section titled “workspaceScope”string
filters?
Section titled “filters?”machineId?
Section titled “machineId?”string
userId?
Section titled “userId?”string
Returns
Section titled “Returns”Promise<object[]>
unassign()
Section titled “unassign()”unassign(
workspaceScope,userId,machineId):Promise<boolean>
Removes one user’s assignment and returns whether a row was deleted.
Parameters
Section titled “Parameters”workspaceScope
Section titled “workspaceScope”string
userId
Section titled “userId”string
machineId
Section titled “machineId”string
Returns
Section titled “Returns”Promise<boolean>
unassignAll()
Section titled “unassignAll()”unassignAll(
workspaceScope,machineId):Promise<number>
Removes every assignment for one Sandbox and returns the deleted row count.
Parameters
Section titled “Parameters”workspaceScope
Section titled “workspaceScope”string
machineId
Section titled “machineId”string
Returns
Section titled “Returns”Promise<number>
upsertMachineServiceProject()
Section titled “upsertMachineServiceProject()”upsertMachineServiceProject(
input):Promise<void>
Inserts or updates one machine-owned service project.
Parameters
Section titled “Parameters”config
Section titled “config”Record<string, JSONType> = ...
definitionVersion
Section titled “definitionVersion”number = ...
directory
Section titled “directory”string = ...
machineId
Section titled “machineId”string = ...
openPath?
Section titled “openPath?”string = ...
string = ...
number = ...
serviceKind
Section titled “serviceKind”"terminal" | "desktop" | "stats" = ...
stripPrefix
Section titled “stripPrefix”boolean = ...
workspaceScope
Section titled “workspaceScope”string = ...
Returns
Section titled “Returns”Promise<void>
upsertProject()
Section titled “upsertProject()”upsertProject(
input):Promise<void>
Inserts or updates one persisted Sandbox project.
Parameters
Section titled “Parameters”config
Section titled “config”Record<string, JSONType> = ...
directory
Section titled “directory”string = ...
machineId
Section titled “machineId”string = ...
string = ...
openPath?
Section titled “openPath?”string = ...
string = ...
number = ...
projectId
Section titled “projectId”string = ...
projectPath
Section titled “projectPath”string = ...
route?
Section titled “route?”boolean = ...
serviceDependencies?
Section titled “serviceDependencies?”("terminal" | "desktop" | "stats")[] = ...
stripPrefix
Section titled “stripPrefix”boolean = ...
userId
Section titled “userId”string = ...
workspaceScope
Section titled “workspaceScope”string = ...
Returns
Section titled “Returns”Promise<void>
withMachineServiceProjectLock()
Section titled “withMachineServiceProjectLock()”withMachineServiceProjectLock<
T>(workspaceScope,machineId,serviceKind,operation):Promise<T>
Runs one service-project operation under its machine- and service-scoped advisory lock.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”workspaceScope
Section titled “workspaceScope”string
machineId
Section titled “machineId”string
serviceKind
Section titled “serviceKind”"terminal" | "desktop" | "stats"
operation
Section titled “operation”() => Promise<T>
Returns
Section titled “Returns”Promise<T>
withReaperLock()
Section titled “withReaperLock()”withReaperLock<
T>(workspaceScope,operation):Promise<T>
Runs one reconciliation pass while holding a workspace-scoped advisory lock.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”workspaceScope
Section titled “workspaceScope”string
operation
Section titled “operation”() => Promise<T>
Returns
Section titled “Returns”Promise<T>
create()
Section titled “create()”
staticcreate(pool):Promise<LakebaseMachineOwnershipStore>
Detects the connecting Lakebase role, then creates tables in its schema.
Parameters
Section titled “Parameters”LakebasePool
Returns
Section titled “Returns”Promise<LakebaseMachineOwnershipStore>