withEditableDb Method

Acquire the write lock, get or create an editable tip WorkspaceDb, open it, run operation, then close the db and release the lock. If the current tip has already been published, a new prerelease version is created automatically. On error the lock is released and changes are abandoned.

withEditableDb(user: string, operation: (db: EditableWorkspaceDb) => void, props?: WorkspaceDbProps): Promise<void>

Parameter Type Description
user string The name of the user acquiring the write lock.
operation (db: EditableWorkspaceDb) => void A callback invoked with the opened EditableWorkspaceDb.
props WorkspaceDbProps Properties identifying which db to operate on. Defaults to the container's default db.

Returns - Promise

Defined in

Last Updated: 20 April, 2026