PropertyStore.PropertyDb Class

A SQLite database for storing PropertyName/PropertyValue pairs.

Extends

Methods

Name Description
constructor(): PropertyStore.PropertyDb    
createDDL(): void Protected Implement this method to create all tables for this subclass of VersionedSqliteDb when a new database file is created.  
deleteProperties(propNames: string[]): Promise<void> Delete an array of properties from this PropertyDb.  
deleteProperty(propName: string): Promise<void> Delete a single property from this PropertyDb.  
forAllProperties(iter: PropertyStore.PropertyIteration, filter?: PropertyStore.PropertyFilter): void call an iteration function for each property, optionally applying a filter  
getBlob(name: string): undefined | Uint8Array Get the value of a blob property by name.  
getBlob(name: string, defaultValue: Uint8Array): Uint8Array Get the value of a blob property by name.  
getBoolean(name: string): undefined | boolean Get the value of a boolean property by name.  
getBoolean(name: string, defaultValue: boolean): boolean Get the value of a boolean property by name.  
getNumber(name: string): undefined | number Get the value of a number property by name.  
getNumber(name: string, defaultValue: number): number Get the value of a number property by name.  
getObject(name: string): undefined | SettingsContainer Get the value of an object property by name.  
getObject(name: string, defaultValue: SettingsContainer): SettingsContainer Get the value of an object property by name.  
getProperty(name: string): undefined | PropertyStore.PropertyType get the value of a Property by name.  
getString(name: string, defaultValue: string): string Get the value of a string property by name.  
getString(name: string): undefined | string Get the value of a string property by name.  
saveProperties(props: PropertyStore.PropertyArray): Promise<void> Save an array of properties in this PropertyDb.  
saveProperty(name: string, value: PropertyStore.PropertyType): Promise<void> Save a single property in this PropertyDb.  

Inherited methods

Name Inherited from Description
abandonChanges(): void Inherited VersionedSqliteDb Abandon (cancel) the outermost transaction, discarding all changes since last save.
closeDb(saveChanges?: boolean): void Inherited VersionedSqliteDb Close SQLiteDb.
createDb(dbName: string): void Inherited VersionedSqliteDb Create a SQLiteDb
createDb(dbName: string, container?: CloudSqlite.CloudContainer, params?: SQLiteDb.CreateParams): void Inherited VersionedSqliteDb  
createTable(args: { addTimestamp?: boolean, columns: string, constraints?: string, tableName: string }): void Protected Inherited VersionedSqliteDb Create a new table in this database.
dispose(): void Inherited VersionedSqliteDb alias for closeDb.
executeSQL(sql: string): DbResult Inherited VersionedSqliteDb execute an SQL statement
getRequiredVersions(): SQLiteDb.RequiredVersionRanges Inherited VersionedSqliteDb Get the required version ranges necessary to open this VersionedSqliteDb.
openDb(dbName: string, openMode: OpenMode | SQLiteDb.OpenParams, container?: CloudSqlite.CloudContainer): void Inherited VersionedSqliteDb Open this database and verify that this version of the software meets the required version range (as appropriate, read or write) stored in the database.
readLastModTime(tableName: string, rowId: number): Date Inherited VersionedSqliteDb Get the last modified date for a row in a table of this database.
saveChanges(): void Inherited VersionedSqliteDb Commit the outermost transaction, writing changes to the file.
setRequiredVersions(versions: SQLiteDb.RequiredVersionRanges): void Inherited VersionedSqliteDb Change the "versions required to open this database" property stored in this database.
upgradeSchema(arg: { dbName: string, lockContainer?: { container: CloudSqlite.CloudContainer, user: string }, upgradeFn: () => void }): Promise<void | () => void> Inherited VersionedSqliteDb  
vacuum(args?: SQLiteDb.VacuumDbArgs): void Inherited VersionedSqliteDb vacuum this database
verifyVersions(): void Protected Inherited VersionedSqliteDb Verify that this version of the software meets the required version range (as appropriate, read or write) stored in the database.
withOpenDb<T>(args: SQLiteDb.WithOpenDbArgs, operation: () => T): T Inherited VersionedSqliteDb Open a database, perform an operation, then close the database.
withPreparedSqliteStatement<T>(sql: string, callback: (stmt: SqliteStatement) => T): T Inherited VersionedSqliteDb Use a prepared SQL statement, potentially from the statement cache.
withSavePoint(savePointName: string, operation: () => void): void Inherited VersionedSqliteDb Perform an operation on this database within a savepoint.
withSqliteStatement<T>(sql: string, callback: (stmt: SqliteStatement) => T): T Inherited VersionedSqliteDb Prepare and execute a callback on a SQL statement.
createNewDb(fileName: string, setupArgs?: any): void Static Inherited VersionedSqliteDb Create a new database file for the subclass of VersionedSqliteDb.

Properties

Name Type Description
myVersion Readonly "3.0.0" The current semver "persistence version" of this class.  

Inherited properties

Name Type Inherited from Description
_versionProps Protected Static Inherited { name: "versions", namespace: "SQLiteDb" } VersionedSqliteDb  
isOpen Accessor Inherited ReadOnly boolean VersionedSqliteDb Returns true if this SQLiteDb is open
isReadonly Accessor Inherited ReadOnly boolean VersionedSqliteDb Returns true if this SQLiteDb is open readonly

Defined in

Last Updated: 14 November, 2024