Constructor for Database class
the adapter to get the data from / save the data to
the data to create the database with
the adapter to get the data from / save the data to
The data of the DatabaseObject
The data of the DatabaseObject
Returns the length of the object
Checks if the DatabaseObject contains a value
the path to apply the value to
the value at the position of the position
Generates an using a namespace
the name to generate a namespace from
the generated id
Gets a value from the DatabaseObject.
the path to get
the value at the position
Gets a value from the DatabaseObject and normalizes it
the path to get
the normalized value at the position
🔄 Reload the data from the database
the database itself, so you can chain operations
💾 Save the data from the database
the database itself, so you can chain operations
Sets a value from the DatabaseObject.
the path to apply the value to
the value to apply to the given path
the DatabaseObject itself, so you can chain operations like that
Sets a default value from the DatabaseObject.
the path to apply the value to
the value to apply to the given path
the DatabaseObject itself, so you can chain operations like that
Sets default values for the DatabaseObject.
an object containing all the default values
the DatabaseObject itself, so you can chain operations like that
Updates a value from the DatabaseObject.
the path to update
the function to update the value
the DatabaseObject itself, so you can chain operations like that
Generated using TypeDoc
SyncDatabase class is basically a DatabaseObject with save and load functionality. It is written synchronously (without using promises)
Database - A database that works using promises for better performance
SyncDatabase.constructor() - the constructor
SyncDatabase.saveData() - saves the data to the DatabaseAdapter
SyncDatabase.reloadData() - loads the data from the DatabaseAdapter
SyncDatabase.data - the data of the array
SyncDatabase.length - the array length
SyncDatabase.set() - sets a value from the SyncDatabase
SyncDatabase.setDefault() - sets a default value from the SyncDatabase
SyncDatabase.setDefaults() - sets defaults for the SyncDatabase
SyncDatabase.get() - gets a value from the SyncDatabase
SyncDatabase.getNormal() - gets a value from the SyncDatabase and normalizes it
SyncDatabase.update() - updates a value from the SyncDatabase
SyncDatabase.contains() - checks if the SyncDatabase contains a value
SyncDatabase.generateId() - checks if the SyncDatabase - Generates an id using a namespace