1. Home
  2. Docs
  3. UniREST Solution 3.5
  4. UniREST Server
  5. Database Manager
  6. Creating new Tables

Creating new Tables

To create a new Table just click the [ADD NEW] button. A popup window will ask you to provide the table name and define the record structure (the table’s columns and their data-type characteristics).

You can click the [X] button in the upright window corner in any moment to interrupt the operation.

Table name

The name of a table must respect this rule: it must contain only letters, numbers and only the underscore symbol is permitted. It must start with a letter (a name starting with a number or with the underscore is not allowed).

EXAMPLES
myNewTableOK
my_new_table2OK
_my_new_tableERROR
2_tablesERROR

Columns

A table has always a predefined unique id column that identifies each record and must contain at least one custom column to be considered valid.

To add columns, just click the [ADD NEW COLUMN BUTTON] one or more times. For each column, these parameters can be set:

NameThis is the name of the column. It must be unique and follow the same rule of the Table’s name.
TypeIt’s the kind of data you are going to store in this column. The following options are available:
TEXT
VARCHAR
INT
FLOAT
DATETIME
BIGINT
SizeThis parameter allows limiting the length of the value you can store in this column. The option is available for these Types only:
VARCHAR
INT
BIGINT
OptionsBy default, all columns require a value to store and don’t accept null values. Check the NULL option if you want to store NULL values too.
Type Description
TEXTString with a maximum length of 65,535 bytes.
VARCHARVariable length string (can contain letters, numbers, and special characters). The size parameter specifies the maximum column length in characters – can be from 0 to 65535.
INTA medium integer. Signed range is from -2147483648 to 2147483647. Unsigned range is from 0 to 4294967295. The size parameter specifies the maximum display width (which is 255).
FLOATA floating point value. Signed range is from -3.402823466E+38 to  -1.175494351E-38. Unsigned range is from 1.175494351E-38  to 3.402823466E+38.
DATETIMEA date and time combination. Format: YYYY-MM-DD hh:mm:ss. The supported range is from ‘1000-01-01 00:00:00’ to ‘9999-12-31 23:59:59’. Adding DEFAULT and ON UPDATE in the column definition to get automatic initialization and updating to the current date and time.
BIGINTA large integer. Signed range is from -9223372036854775808 to 9223372036854775807. Unsigned range is from 0 to 18446744073709551615. The size parameter specifies the maximum display width (which is 255),

Columns reorganization

During the definition of the table structure you can:

  • remove an unwanted column clicking the red [X] button on the right;
  • reorder the columns list pressing the “three lines” icon on the left and performing a drag & drop of the column in a new position.

Finalization

Once the table structure is ready, click the [CREATE TABLE] button to create the new table. Its name will appear listed on the left. Clicking its name, you can perform the provided management operations.

Notes

If the table contains more than 100 records, a pagination system is automatically activated. In this case, you can use the functionalities shown in the table’s footer to navigate through the records.

Moreover, if a column cell contains too much data, in order to avoid visualization problems, the text is shown truncated.