Table Designer

The Table Designer is a specialized part of the Morfik development environment which allows you to define the structure of tables in your project's default database. Within the Table Designer you can add the fields you want to your table and choose the appropriate data type for each one of them.

With Morfik's Table Designer you can also create one or more indices for your Table and choose their composition as to enhance the performance for data retrieval operations.

Table Designer

The Table designer enables you to create tables or visualize their structure from within Morfik. The projects have a server side component and are using the built-in database allow you create tables in the project's associated database. When you are using an external database you will only be able to visualize the structure of the imported tables, but will not be able to alter them.

Creating Your Tables

In order to create a new Table within a Morfik project you can either choose an option in the Project tab of the Ribbon or from New Item submenu of the Power Menu. At both locations you'll have the option of immediately creating a table and going into edit mode with the Table Designer or to use the Table Wizard which can guide you through the creation of the individual fields of the new table.

Once you have completed the process of creating a new Table object within your project you will be placed in the Design View of Table designer in the Morfik development environment. In this view you can add, remove or alter the definition of fields for your tables.

Figure 1: Power Menu option to create a new Table with the Table designer.

Data Types

When you create a table you must choose the data type of each of the fields that will compose your table. The Morfik built-in database engine supports a rich set of data types. You can choose the one that is best suited for the fields that you create in a table. In order to choose wisely it is necessary for you to know what the characteristics are of the data types available. You can see the available data types in table 1.

Table 1 - Morfik database engine data types
Data Type Characteristics
Text strings of letters, digits, punctuation marks and other basic symbols up to 32765 characters long
Memo Text with arbitrary length
Number Numbers used in mathematical calculations. Can be set as being of subtypes: long real, short real, long integer or short integer
DateTime data and/or time values
Currency numbers formatted for currency
AutoNumber sequentially numbers each new record. This data type is typically used for the primary key
Yes/No Lets you set up fields with a yes/no or true/false or 0/1 data type. Often called Boolean data type.
Picture any form of picture, compressed or not. i.e. a JPEG, BMP, TIFF or other graphic file.
Document any of the standard document types such as Microsoft Word, PDF, etc
Multimedia any multimedia file such as Flash File, Audio File, Video File
Blob any other type of object that does not fit into any of the above categories. Often called Binary Large OBject.

Creating Indices

Within the Table designer you can choose to create Indices for your table. Some indices are created automatically for you, in order to support relationships, but you can create additional indices of your choosing, in order to improve data retrieval performance in certain circumstances.

You can choose to create a new index by right clicking on the editing area of the table designer and choosing the Indexes option of the context menu that pops up. This will lead you to a dialog where you can create or alter indices for the table you are currently editing in the table designer.

Figure 2: Table Indices dialog. Reachable from the Table designer.
Note: While adding indices to a table can be very useful to boost data retrieval, it should be done on "as needed" basis. Indices slow down data insertion and updates and if abused can have adverse performance effects.

Entering Data

Through the Table Designer you can also enter data directly into a table. This is done through the Data View of the Table Designer. To use this feature you should select the "Data" option in the view menu that is shown when you click on the View Button of the Home tab of the Ribbon when in the Table designer.

Figure 3: Data view of the Table designer in the Morfik development environment.

If you need to enter content for larger text/string fields the Table designer will display a more comfortable editing space if you click on the small down pointing arrow button on the right side of the data entry space for that specific field. This will allow you to view more text at the same time, while editing your content.

Figure 4: Drop down text editor for long text/string fields in the Morfik Table Designer

Related Topics

Back to top