Getset
Getset is made by Paultje#0933 (327462385361092621) on Discord and Paultje52 on GitHub > Paul also created the hole package.
Importing
First, let's import getset
! You have to import it in a database, and the return is a class. In that class you can load or create a table, to use getset
!
If you are using a existing table, the table can only have the column
k
andv
. Nothing more.
You have two parameters in the constructor.
- The table name: Required. The name of the table.
- Loading in the memory: Optional, by default true
. Loading everything in the memory.
If you have loading in the memory enabled, you don't have to use await. Everything will be saved to a variable, and then everything in the server will be updated. This is really fast.
If you set the loading in memory to
false
, you can use the same functions, but then with await. Everything will be requested at the server. Usually, this is slower.
waitForReady
If you are using the loading in memory, you have to wait until everything is loaded before you can start. Usually, this takes about 5 seconds. This is a await
function, so you can set this in your code.
There are two variables that are working with this: example.readyState
and example.ready
.
ReadyState is a string, ready
or not ready
.
Ready is a boolean, true
or false
.
get(key, path)
Next, getting data!
The key
is always required, but the path
only if you are using objects AND if you have loading in memory
at false
.
Here is a example.
set(key, value, path)
Now, let's set some data! Just like the get function, you can use the path
, if you have loading in memory
at true
and you are setting something in a already existing object.
Here is a example, again!
Delete(key, path)
And now, the last one! Path, you know it. And example.
Later
Later, there will be more functions!
Last updated
Was this helpful?