Using tables
How to make, load, chance and delete tables
Last updated
Was this helpful?
How to make, load, chance and delete tables
Last updated
Was this helpful?
A MySQL database is constructed from tables. You can make, load, chance and delete tables, normally as many as you like!
If you want to work with tables, you have to load in a database. You can find more explanation for this at the .
If you want to see all the tables (without the data in it) you can use the function database.getTables
. Here is a example.
To get the amount of tables there are in the database, log the length of
tables
.
To make a table, use the database.createTable
function. This is a example for making a table called example
with the columns name
, mail
and password
.
If you want to load a table, use the function database.loadTable
. This is a example for loading a table called example
.
For chancing a table, you have to use the function database.chanceTable
. Here you have to give up a action. Look at the different headings for all the actions.
You can rename a column with the action name rename_column
. Here is a example where the column nname
will be renamed to name
in the database example
.
You can also delete a column with the action name delete_column
. Here is a example where the column hi
will be deleted of the database example
.
If you want to reset all the data of a table, you can do that with the action clear
. Here is a example where the table example
will be cleared.
If you want to clone a table (for a backup), you can use the clone
action. Here is a example where the table example
will be cloned to example2
.
If you want to delete a table, use the function database.deleteTable
. Here is a example where the table example
will get deleted.