CloudSqlite.DbAccess<DbType extends VersionedSqliteDb, ReadMethods, WriteMethods> Class

Class that provides convenient local access to a SQLite database in a CloudContainer.

Extended by

Methods

Name Description
constructor<DbType extends VersionedSqliteDb, ReadMethods, WriteMethods>(args: { dbName: string, dbType: Constructor<DbType>, props: CloudSqlite.ContainerAccessProps }): CloudSqlite.DbAccess<DbType, ReadMethods, WriteMethods> Create a new DbAccess for a database stored in a cloud container.  
close(): void Close the database for this DbAccess if it is opened, and disconnect this `DbAccess from its CloudContainer.  
closeDb(): void Close the database for this DbAccess, if it is open  
openForRead(): DbType Ensure that the database controlled by this DbAccess is open for read access and return the database object.  
startPrefetch(): CloudSqlite.CloudPrefetch Start a prefetch operation to download all the blocks for the VersionedSqliteDb  
synchronizeWithCloud(): void 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> 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 Initialize a cloud container to hold VersionedSqliteDbs.  
createBlobContainer(args: Omit<BlobContainer.CreateNewContainerProps, "userToken">): Promise<CloudSqlite.ContainerProps> Protected Static Create a new BlobContainer from the BlobContainer service to hold one or more VersionedSqliteDbs.  

Properties

Name Type Description
_cacheName Protected Static string    
_cloudDb Protected DbType    
_container Protected CloudSqlite.CloudContainer    
container Accessor ReadOnly CloudSqlite.CloudContainer the container for this DbAccess.  
dbName Readonly string The name of the database within the cloud container.  
lockParams Readonly CloudSqlite.ObtainLockParams Parameters for obtaining the write lock for this container.  
reader Accessor ReadOnly PickMethods<ReadMethods> A Proxy Object to call a synchronous readonly method on the database controlled by this DbAccess.  
sasToken Accessor string The token that grants access to the cloud container for this DbAccess.  
writeLocker Accessor ReadOnly PickAsyncMethods<WriteMethods> A Proxy Object to call a writeable async method on the cloud database controlled by this DbAccess.  

Defined in

Last Updated: 23 November, 2024