🔨 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
⌛ Promise (Ready when loaded) >> the database itself, so you can chain operations
💾 Save the data from the database
⌛ Promise (Ready when saved) >> 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
Database class is basically a DatabaseObject with save and load functionality
SyncDatabase - A database that works sync instead of using promises
Database.constructor() - the constructor
Database.saveData() - saves the data to the DatabaseAdapter
Database.reloadData() - loads the data from the DatabaseAdapter
Database.data - the data of the array
Database.length - the array length
Database.set() - sets a value from the Database
Database.setDefault() - sets a default value from the Database
Database.setDefaults() - sets defaults for the Database
Database.get() - gets a value from the Database
Database.getNormal() - gets a value from the Database and normalizes it
Database.update() - updates a value from the Database
Database.contains() - checks if the Database contains a value
Database.generateId() - checks if the Database - Generates an id using a namespace