Using tables
How to make, load, chance and delete tables
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 base > Selecting a database.
See all the tables
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
.
Making a table
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
.
Loading a table
If you want to load a table, use the function database.loadTable
. This is a example for loading a table called example
.
Chancing a table
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.
Rename a column
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
.
Deleting a column
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
.
Clearing a table
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.
Cloning a table
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
.
Deleting a table
If you want to delete a table, use the function database.deleteTable
. Here is a example where the table example
will get deleted.
Last updated
Was this helpful?