PropertyStore.CloudAccess Class

Provides access to a cloud-based PropertyDb to hold a set of values of type PropertyType, each with a unique PropertyName. PropertyStore.PropertyDbs that are stored in cloud containers require an access token that grants permission to read and/or write them. All write operations will fail without an access token that grants write permission.

The database is cached on a local drive so reads are fast and inexpensive, and may even be done offline after a prefetch. However, that means that callers are responsible for synchronizing the local cache to ensure it includes changes made by others, as appropriate (see PropertyStore.CloudAccess.synchronizeWithCloud).

Extends

Methods

Name Description
constructor(props: CloudSqlite.ContainerAccessProps): PropertyStore.CloudAccess    
createNewContainer(args: PropertyStore.CreateNewContainerProps): Promise<CloudSqlite.ContainerProps> Static Create and initialize a new BlobContainer to hold a PropertyStore  

Inherited methods

Name Inherited from Description
close(): void Inherited CloudSqlite.DbAccess<PropertyStore.PropertyDb> Close the database for this DbAccess if it is opened, and disconnect this `DbAccess from its CloudContainer.
closeDb(): void Inherited CloudSqlite.DbAccess<PropertyStore.PropertyDb> Close the database for this DbAccess, if it is open
openForRead(): PropertyStore.PropertyDb Inherited CloudSqlite.DbAccess<PropertyStore.PropertyDb> Ensure that the database controlled by this DbAccess is open for read access and return the database object.
startPrefetch(): CloudSqlite.CloudPrefetch Inherited CloudSqlite.DbAccess<PropertyStore.PropertyDb> Start a prefetch operation to download all the blocks for the VersionedSqliteDb
synchronizeWithCloud(): void Inherited CloudSqlite.DbAccess<PropertyStore.PropertyDb> Synchronize the local cache of this database with any changes by made by others.
withLockedDb<T>(args: { openMode?: OpenMode, operationName: string, user?: string }, operation: () => Promise<T>): Promise<T> Inherited CloudSqlite.DbAccess<PropertyStore.PropertyDb> Perform an operation on this database with the lock held and the database opened for write
_initializeDb(args: { blockSize?: "4M" | "64K", dbName: string, dbType: , props: CloudSqlite.ContainerProps }): Promise<void> Protected Static Inherited CloudSqlite.DbAccess<PropertyStore.PropertyDb> Initialize a cloud container to hold VersionedSqliteDbs.
createBlobContainer(args: Omit<BlobContainer.CreateNewContainerProps, "userToken">): Promise<CloudSqlite.ContainerProps> Protected Static Inherited CloudSqlite.DbAccess<PropertyStore.PropertyDb> Create a new BlobContainer from the BlobContainer service to hold one or more VersionedSqliteDbs.

Inherited properties

Name Type Inherited from Description
_cacheName Protected Static Inherited string CloudSqlite.DbAccess<PropertyStore.PropertyDb>  
_cloudDb Protected Inherited PropertyStore.PropertyDb CloudSqlite.DbAccess<PropertyStore.PropertyDb>  
_container Protected Inherited CloudSqlite.CloudContainer CloudSqlite.DbAccess<PropertyStore.PropertyDb>  
container Accessor Inherited ReadOnly CloudSqlite.CloudContainer CloudSqlite.DbAccess<PropertyStore.PropertyDb> the container for this DbAccess. It is automatically connected to the CloudCache whenever it is accessed.
dbName Readonly Inherited string CloudSqlite.DbAccess<PropertyStore.PropertyDb> The name of the database within the cloud container.
lockParams Readonly Inherited CloudSqlite.ObtainLockParams CloudSqlite.DbAccess<PropertyStore.PropertyDb> Parameters for obtaining the write lock for this container.
reader Accessor Inherited ReadOnly PickMethods<ReadMethods> CloudSqlite.DbAccess<PropertyStore.PropertyDb> A Proxy Object to call a synchronous readonly method on the database controlled by this DbAccess.
Whenever a method is called through this Proxy, it will first ensure that the database is opened for at least read access.
sasToken Accessor Inherited string CloudSqlite.DbAccess<PropertyStore.PropertyDb> The token that grants access to the cloud container for this DbAccess. If it does not grant write permissions, all
write operations will fail. It should be refreshed (via a timer) before it expires.
writeLocker Accessor Inherited ReadOnly PickAsyncMethods<WriteMethods> CloudSqlite.DbAccess<PropertyStore.PropertyDb> A Proxy Object to call a writeable async method on the cloud database controlled by this DbAccess.

Whenever a method is called through this Proxy, it will:
- attempt to acquire the write lock on the container
- open the database for write
- call the method
- close the database
- upload changes
- release the write lock.

Defined in

Last Updated: 26 November, 2024