Skip to content

Commit

Permalink
Generated documentations
Browse files Browse the repository at this point in the history
  • Loading branch information
QSmally committed Aug 23, 2020
1 parent 4b83dca commit 865af3e
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 59 deletions.
52 changes: 26 additions & 26 deletions Documentation/Connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,42 +32,42 @@ const Users = new QDB.Connection("lib/Databases/Users.qdb");
> Type **{RawOptions}**
## [.Pool](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L63)
> Whether this Connection is used in a Pool.
> Whether this Connection is used in a Pool. [**Read Only**]
>
> Type **{Pool|null}**
## [.Table](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L73)
## [.Table](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L74)
> Table name of this Connection. [**Read Only**]
>
> Type **{String}**
## [.Size](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L131)
## [.Size](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L132)
> Retrieves all the rows of this database.
>
> Type **{Number}**
## [.CacheSize](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L142)
## [.CacheSize](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L143)
> Retrieves all the in-memory cached rows of this Connection. Extension of what would be `<Connection>.Cache.size`, but checks for the ready state.
>
> Type **{Number}**
## [.Indexes](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L153)
## [.Indexes](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L154)
> Retrieves all the keys of this database table.
>
> Type **{Array}**
# Methods
## [.Disconnect()](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L164)
## [.Disconnect()](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L165)
> Disconnects from this Connection, clears in-memory rows. Only run this method when you are exiting the program, or want to fully disconnect from this database.
>
> Returns **{Connection}**
## [.AsObject()](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L273)
## [.AsObject()](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L274)
> Converts this database's rows into an Object. To use dotaccess, use {@link Fetch} instead.
>
> Returns **{Object}** An object instance with the key/value pairs of this database.
## [.ToIntegratedManager(Pathlike?, Holds?)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L283)
## [.ToIntegratedManager(Pathlike?, Holds?)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L284)
> Converts this database, or a part of it using dotaccess, to a Manager instance.
> | Key | Type | Description |
> | --- | --- | --- |
Expand All @@ -76,12 +76,12 @@ const Users = new QDB.Connection("lib/Databases/Users.qdb");
>
> Returns **{Manager}** A Manager instance with the key/model pairs.
## [.Transaction()](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L299)
## [.Transaction()](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L300)
> Creates a SQL transaction, which allows you to commit or rollback changes.
>
> Returns **{Transaction|undefined}** A Transaction instance, or `undefined` when already in a transaction.
## [.Set(KeyOrPath, Value)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L312)
## [.Set(KeyOrPath, Value)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L313)
> Manages the elements of the database.
> | Key | Type | Description |
> | --- | --- | --- |
Expand All @@ -90,7 +90,7 @@ const Users = new QDB.Connection("lib/Databases/Users.qdb");
>
> Returns **{Connection}** Returns the updated database.
## [.Fetch(KeyOrPath, Cache?)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L334)
## [.Fetch(KeyOrPath, Cache?)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L335)
> Manages the retrieval of the database.
> | Key | Type | Description |
> | --- | --- | --- |
Expand All @@ -99,23 +99,23 @@ const Users = new QDB.Connection("lib/Databases/Users.qdb");
>
> Returns **{Object|Array|DataModel|Any}** Value of the row, or the property when using dotaccess.
## [.Evict(Keys?)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L361)
## [.Evict(Keys?)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L362)
> Erases elements from this Connection's internal cache.
> | Key | Type | Description |
> | --- | --- | --- |
> | Keys? | ...Pathlike | A key or multiple keys to remove from cache. If none, the cache will get cleared entirely. |
>
> Returns **{Connection}** Returns the updated database.
## [.Erase(Keys)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L377)
## [.Erase(Keys)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L378)
> Manages the deletion of the database.
> | Key | Type | Description |
> | --- | --- | --- |
> | Keys | ...Pathlike | A key or multiple keys to remove from the database. These elements will also get removed from this Connection's internal cache. |
>
> Returns **{Connection}** Returns the updated database.
## [.Exists(Key, Cache?)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L401)
## [.Exists(Key, Cache?)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L402)
> Returns whether or not a row in this database exists. This method also caches the row internally, so getting it would be much faster.
> | Key | Type | Description |
> | --- | --- | --- |
Expand All @@ -124,7 +124,7 @@ const Users = new QDB.Connection("lib/Databases/Users.qdb");
>
> Returns **{Boolean}** Whether a row exists in this database.
## [.Find(Fn, Cache?)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L414)
## [.Find(Fn, Cache?)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L415)
> Iterates through all the keys, returns the first element found.
> | Key | Type | Description |
> | --- | --- | --- |
Expand All @@ -133,7 +133,7 @@ const Users = new QDB.Connection("lib/Databases/Users.qdb");
>
> Returns **{Any}** Returns the row found, or nil.
## [.Accumulate(KeyOrPath, Fn, Cache?)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L430)
## [.Accumulate(KeyOrPath, Fn, Cache?)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L431)
> Accumulates as function on a row, essentially a fetch wrapped in a method. Changes are not recorded on the database.
> | Key | Type | Description |
> | --- | --- | --- |
Expand All @@ -143,7 +143,7 @@ const Users = new QDB.Connection("lib/Databases/Users.qdb");
>
> Returns **{Connection}** Returns the current Connection.
## [.Each(Fn, Evict?)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L448)
## [.Each(Fn, Evict?)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L449)
> Iterates through this database's entries.
> | Key | Type | Description |
> | --- | --- | --- |
Expand All @@ -152,15 +152,15 @@ const Users = new QDB.Connection("lib/Databases/Users.qdb");
>
> Returns **{Connection}** Returns this database.
## [.Select(Fn)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L473)
## [.Select(Fn)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L474)
> Locally filters out rows in memory. Please note that this method does increase memory usage in large databases, although the fetched entries will get evicted.
> | Key | Type | Description |
> | --- | --- | --- |
> | Fn | Function | A filter function which returns a boolean, based on the value(s) of the rows. |
>
> Returns **{Object}** An object with the results which rows passed the tester function.
## [.Push(KeyOrPath, Values)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L495)
## [.Push(KeyOrPath, Values)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L496)
> Pushes something to an array at the path output.
> | Key | Type | Description |
> | --- | --- | --- |
Expand All @@ -169,7 +169,7 @@ const Users = new QDB.Connection("lib/Databases/Users.qdb");
>
> Returns **{Connection}** Returns the updated database.
## [.Shift(KeyOrPath, Values?)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L517)
## [.Shift(KeyOrPath, Values?)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L518)
> Inserts (if defined) or removes a value to/from the front of the array.
> | Key | Type | Description |
> | --- | --- | --- |
Expand All @@ -178,15 +178,15 @@ const Users = new QDB.Connection("lib/Databases/Users.qdb");
>
> Returns **{Number|Any}** New length of the array if a value was inserted, or the shifted value.
## [.Pop(KeyOrPath)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L543)
## [.Pop(KeyOrPath)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L544)
> Pops something from an array at the path output.
> | Key | Type | Description |
> | --- | --- | --- |
> | KeyOrPath | Pathlike | Specifies which row or nested array to pop from. |
>
> Returns **{Any}** Returns the popped value.
## [.Remove(KeyOrPath, Fn)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L563)
## [.Remove(KeyOrPath, Fn)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L564)
> Removes a specific element from this endpoint array.
> | Key | Type | Description |
> | --- | --- | --- |
Expand All @@ -195,7 +195,7 @@ const Users = new QDB.Connection("lib/Databases/Users.qdb");
>
> Returns **{Connection}** Returns the updated database.
## [.Ensure(KeyOrPath, Input)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L593)
## [.Ensure(KeyOrPath, Input)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L594)
> Inserts an input into a row or nested object if the key or path wasn't found at the endpoint. It can be used as a default schema of the database elements, that gets inserted if there's no entry already. This behaves like `if (!DB[Element]) DB[Element] = Input;`.
> | Key | Type | Description |
> | --- | --- | --- |
Expand All @@ -204,7 +204,7 @@ const Users = new QDB.Connection("lib/Databases/Users.qdb");
>
> Returns **{Boolean}** Whether or not the new value was inserted.
## [.Modify(KeyOrPath, Fn)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L616)
## [.Modify(KeyOrPath, Fn)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L617)
> Updates a value in the database by fetching it and passing it onto the callback function.
> | Key | Type | Description |
> | --- | --- | --- |
Expand All @@ -213,7 +213,7 @@ const Users = new QDB.Connection("lib/Databases/Users.qdb");
>
> Returns **{Any}** Returns the new row of the updated property.
## [.Invert(KeyOrPath)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L633)
## [.Invert(KeyOrPath)](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L634)
> Inverts a boolean, i.e. from true to false and vice-versa, at the endpoint of the path.
> | Key | Type | Description |
> | --- | --- | --- |
Expand All @@ -222,7 +222,7 @@ const Users = new QDB.Connection("lib/Databases/Users.qdb");
> Returns **{Boolean}** Updated boolean value of the property.
# Typedefs
## [.RawOptions](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L654)
## [.RawOptions](https://github.com/QSmally/QDB/blob/v4/lib/Connections/Connection.js#L655)
> Options for a database Connection. All integer related options are in milliseconds.
> | Key | Type | Description |
> | --- | --- | --- |
Expand Down
Loading

0 comments on commit 865af3e

Please sign in to comment.