WorkspaceContainer Namespace

Interface

Name Description
WorkspaceContainer.Alias A member named containerName that specifies by an entry in a "cloud/containers" setting
WorkspaceContainer.Props Properties that specify a WorkspaceContainer.

Type alias

Name Description
WorkspaceContainer.Id The unique identifier of a WorkspaceContainer.
WorkspaceContainer.Name The name of a WorkspaceContainer in a "cloud/containers" setting.
WorkspaceContainer.TokenFunc  

Function

Name Description
WorkspaceContainer.makeDbFileName Create a dbName for a WorkspaceDb from its base name and version.
WorkspaceContainer.parseDbFileName Parse the name stored in a WorkspaceContainer into the dbName and version number.
WorkspaceContainer.validateContainerId Validate that a WorkspaceContainer.Id is valid.
WorkspaceContainer.validateDbName  

Defined in

WorkspaceContainer Interface

A WorkspaceContainer is a type of CloudSqlite.CloudContainer that holds WorkspaceDbs. Normally a WorkspaceContainer will hold (many versions of) a single WorkspaceDb. Each version of a WorkspaceDb is treated as immutable after it is created and is stored in the WorkspaceContainer indefinitely. That means that older versions of the WorkspaceDb may continue to be used, for example by archived projects. For programmers familiar with NPM, this is conceptually similar and versioning follows the same rules as NPM using Semantic Versioning.

@note It is possible to store more than one WorkspaceDb in the same WorkspaceContainer, but access rights are administered per WorkspaceContainer. That is, if a user has rights to access a WorkspaceContainer, that right applies to all WorkspaceDbs in the WorkspaceContainer.

Methods

Name Description
close(): void Close this WorkspaceContainer.  
closeWorkspaceDb(container: WorkspaceDb): void Close and remove a currently opened WorkspaceDb from this Workspace.  
getWorkspaceDb(props: WorkspaceDb.Props): WorkspaceDb find or open a WorkspaceDb from this WorkspaceContainer.  
makeNewVersion(fromProps: WorkspaceDb.Props, versionType: WorkspaceDb.VersionIncrement): Promise<{ newName: string, oldName: string }> Create a copy of an existing WorkspaceDb in this WorkspaceContainer with a new version number.  
resolveDbFileName(props: WorkspaceDb.Props): string Find the appropriate version of a WorkspaceDb in this WorkspaceContainer based on the SemVer rule  

Properties

Name Type Description
cloudContainer Readonly undefined | CloudSqlite.CloudContainer CloudContainer for this WorkspaceContainer (undefined if this is a local WorkspaceContainer.)  
filesDir Readonly string the local directory where this WorkspaceContainer will store temporary files extracted for file-resources.  
id Readonly string The unique identifier for a WorkspaceContainer a cloud storage account.  
workspace Readonly Workspace Workspace holding this WorkspaceContainer.  

Defined in

Last Updated: 16 April, 2024