Pool

Utility class for mass-data management

Utility class for initialising and managing mass-databases. This class cuts down on individual class constants for the databases and allows you to manage multiple databases using this class.

To initialise a pool, the Path variable should be pointing towards the directory with all the database files within it. If the path is pointing to a file, not a directory, QDB will throw an error. Options allows you to pass on options to all the databases, but some will be reserved so that the pool class can take care of it, like backups and polling.

const DBS = new QDB.Pool(Path, Options?);

Take a look at the available options.

Note

Backups of entire pools can only be created on Unix computers (i.e. MacOS and Linux-based), due to the way folders are copied using Shell. There is currently no alternative method. However, individual backups can still be created, or create a backup mechanism externally from QDB.

Properties

.Path

The path to the directory which was inputted.
Type - String

.Datatypes

A Collection with the types of the databases, indexed by the name of the database.
Type - Collection<Name, Type>

.Databases

A DataStore with the databases as data models, indexed by the name of the database.
Type - DataStore<Name, Connection>

.Cache

A Cache Collection which is free to use within this pool.
Type - Cache

Methods

.Select(Base)

Selects a database connection and returns it.

Parameter Type Description
Base String The name of the database file which you would like to select.

Returns - Connection | Null
Returns the resolved connection if the DataStore contains it, otherwise returns a nill value.

.LRR()

Returns the last recently resolved database.

Returns - Connection | Null
Returns the last recently resolved connection. If none, QDB returns a nill value instead.