Spanish Total.js
English
Documentation For AI agents
Contents

Make, empty and drop tables

Make a table by filling in its columns, or take one away. In both cases you read the SQL before it runs.

.md GitHub
On this page

Make a table

  1. Press New table…, the plus next to Find a table.
  2. Write its name. If the database has several schemas, choose one.
  3. Fill in the columns. There are two to begin with: a key called id, which the database numbers, and an empty one for text.
  4. Press Column for each one more. Those without a name are left out.
  5. Press Review, read the statement, and press Make the table. Back returns to the columns.
Column of the formWhat it means
TypeChoose one of the common types, or write any that your database has
DefaultAn expression: 0, 'new', now()
NULLIt may have no value
KeyPart of the primary key. Mark several for a key of several columns
NumberedThe database gives the numbers: 1, 2, 3… Only for a key

Then add its indexes, relations and rules. In SQLite, relations and rules are set when the table is made, so write its CREATE TABLE in a query if you need them.

Rename a table

In Structure, press Rename the table… Views, functions and programs that name the table are not changed with it.

Start a query on a table

With the right button, New query on it opens a query that takes the first 100 rows of the table, in the words of your database and with the name between its quotes.

Copy the name copies the name of the table, with its schema.

Empty a table

Choose Empty… with the right button. Every row goes and the table stays. If other tables point to this one, the database may refuse.

Drop a table or a view

Choose Drop… with the right button. A table goes with every row that it has.

Emptying and dropping cannot be undone. Export the table first if you may need it.

On a read-only connection you cannot make, rename, empty or drop anything here.

After a change made elsewhere

If another program made or dropped a table, press Reload the tables.

Made in Europe