Contents


Chapter 17
Building and Browsing Databases

Overview

Accessing the Lasso Database Browser

To access the Lasso Database Browser:

Figure 1: Lasso Database Browser

Lasso Database Browser Features

Database Browser

Selecting a Database to Work With

Figure 2: Settings Sidebar

To select a connector, host, database, table, and key field:

Searching Records

Figure 3: Search Page

To search records in a table:

Search Options

Figure 4: Search Options

Adding Records

Figure 5: Add Page

To add a record to table:

Add Options

Figure 6: Add Options

Listing Records

Figure 7: List Page

Export

List Options

Figure 8: List Options

Displaying Record Details

Figure 9: Detail Page

Record Detail

Detail Options

Figure 10: Detail Options

Updating and Deleting Records

Figure 11: Update Page

Updating Records

To update a record in a database:

Update Options

Figure 12: Update Options

Importing Records

Figure 13: Import Page

Import File

Import Settings

To import data to the current table:

Exporting Records

Figure 14: Export Page

Export Settings

To export data:

Figure 15: SQL Browser

Database Builder

Creating MySQL Databases

Figure 16: Databases Page

Creating Databases

Figure 17: Create Database Panel

To create a new database:

Duplicating Databases

Figure 18: Duplicate Database Panel

To duplicate an existing database:

Updating and Deleting Databases

Creating Tables

Figure 19: Tables Page

Creating Tables

Figure 20: Create Table Panel

To create a table in the selected database:

Duplicating Tables

Figure 21: Duplicate Table Panel

To duplicate a table in the selected database:

Updating and Deleting Tables

Creating Fields

Figure 22: Fields Page

Creating Fields

Figure 23: Create Field Panel

Creating Indices

Figure 24: Indices Page

Creating Indices

Figure 25: Create Index Panel

To create a new index:

Index Detail



Chapter 17
Building and Browsing Databases

[p]This chapter documents the Lasso Database Browser, which is a LassoApp included with Lasso Professional Server for interacting with all Lasso-configured databases and building custom MySQL databases. [/p]

Overview

[p]The Lasso Database Browser allows administrators to interact with the records of all databases enabled in Site Administration. This includes searching, viewing, adding, updating, and deleting records in any database accessible by Lasso. The Lasso Database Browser also allows the administrator to build custom MySQL databases using a Web-based interface for use in Lasso solutions. [/p]

Accessing the Lasso Database Browser

[p]The Lasso Database Browser consists of the [code]DatabaseBrowser.LassoApp[/code] file located in the [code]LassoApps[/code] folder of the Lasso Professional Server application folder. The Lasso Database Browser is a LassoApp file, which is accessed via a Web browser similar to a standard HTML page. [/p]

[p]The Lasso Database Browser can be accessed in any Web browser that meets the Web browser requirements listed in the configuration chapters in this guide. [/p]

To access the Lasso Database Browser:

[p]In a Web browser, visit [code]http://www.example.com/Lasso/DatabaseBrowser.LassoApp[/code]. Replace [code]www.example.com[/code] with your domain name, IP address, or [code]127.0.0.1[/code] if on a local machine. If an error is displayed, make sure Lasso Service is running as described in the configuration chapters of this guide. [/p]

[p]The database browser for a specific host can be visited by loading Site Administration for that host and then using the link in the [code]Support[/code] section. [/p]

Figure 1: Lasso Database Browser

[note][b]Security [/b][b]Note[/b]: The Lasso Database Browser will prompt for the Lasso site administrator username and password. Only the site administrator may use the Lasso Database Browser. [/note]

Lasso Database Browser Features

[p]The [code]Browse[/code] section allows the administrator to test databases once they have been enabled, as well as modify records in existing databases. It is always recommend that databases be tested in the [code]Browse [/code]section of the Lasso Database Browser before attempting to interact with them via custom Lasso code. The [code]Browse[/code] section also allows the administrator to import and export data. [/p]

[p]The [code]Build[/code] section allows the administrator to create databases, tables, fields, and indices, and edit the schema of SQLite and MySQL database via a Web-based interface. No knowledge of SQL is required to build databases using the [code]Build[/code] section. [/p]

Database Browser

[p]The [code]Database[/code] section of the Lasso Database Browser allows administrators to interact with database records and includes the following pages: [/p]

Selecting a Database to Work With

[p]The sidebar is where the data source connector, host, database, table, and key field of the records to be browsed are first specified. The administrator can use the sidebar on any page within the browse section. [/p]

Figure 2: Settings Sidebar

To select a connector, host, database, table, and key field:

  1. In the sidebar, select a data source connector from the [code]Datasource[/code] pull-down menu. When a pull-down menu option is selected, the [code]Select[/code] page will automatically update to show the correct information for that option in the pull-down menus below.
  1. Select a data source host from the [code]Host[/code] pull-down menu.
  1. Select a database from the [code]Database[/code] pull-down menu.
  1. Select a table from the [code]Table[/code] pull-down menu.
  1. Select the [code]Key Field[/code] from the [code]Key Field[/code] pull-down menu. The key field of a table is typically the [code]ID[/code] field, and is used to store values unique to each record.
  1. Select the [code]Select[/code] button.

Searching Records

[p]The [code]Search[/code] page allows the administrator to search records in a selected table. All fields are shown by default for the selected table, and both [code]Search[/code] and [code]Find All[/code] buttons return results in the [code]List [/code]page. The data type of each field is displayed to the right of each field by default. For more information on data types, consult the appropriate third-party documentation for the data source being used. [/p]

Figure 3: Search Page

To search records in a table:

  1. Enter the information you wish to search for in the appropriate field next to each field name. If data is entered in more than one field, the found set will only contain records containing all values searched for.
[p]Selecting the [code]Show Options[/code] button displays the [code]Field View Options[/code] panel to the right with the first field selected. Here, the administrator may set field display options for each field. [/p]

Search Options

[p]Selecting the name of a field in the [code]Search Records[/code] panel displays the [code]Field View Options[/code] panel to the right for that field. [/p]

Figure 4: Search Options

[p]The following input and display options can be edited for each field. [/p]

[p]Options are changed by selecting the desired values from the pull-down menus and selecting the [code]Apply[/code] button. The [code]Reset[/code] button returns all options to their default values. Selecting the [code]Hide Options [/code]button hides the [code]Field View Options[/code] panel. [/p]

Adding Records

[p]The [code]Add[/code] page allows the administrator to add a record to the selected table. The [code]Add Record[/code] panel displays all fields within the table by default, and displays an input field to the right of each field name. The input type used for each field (text input, pull-down menu, radio buttons, etc.) can be customized in the [code]Field View Options[/code] panel, which is described later in this section. [/p]

Figure 5: Add Page

To add a record to table:

  1. Enter the information you wish to add in the appropriate text field next to each field name. The data type of each field is displayed to the right by default.
[p]The sidebar displays the current database, table, and key field being used in the [code]Databases[/code] section. The key field of the current record may be changed by selecting a new key field from the [code]Key Field[/code] pull-down menu, and then selecting the [code]Select[/code] button. The fields shown in the [code]Add[/code] page will change to reflect the new table if a new database or table is selected. [/p]

[p]Selecting the [code]Show Options[/code] button displays the [code]Field View Options[/code] panel to the right with the first field selected. Here, the administrator may set field display options for each field. [/p]

Add Options

[p]Selecting the name of a field in the [code]Add Record[/code] panel displays the [code]Field View Options[/code] panel to the right for that field. [/p]

Figure 6: Add Options

[p]The following input and display options can be edited for each field. [/p]

[p]Options are changed by selecting the desired values from the pull-down menus and selecting the [code]Apply[/code] button. The [code]Reset[/code] button returns all options to their default values. Selecting the [code]Hide Options [/code]button hides the [code]Field View Options[/code] panel. [/p]

Listing Records

[p]The [code]List[/code] page shows results from a [code]Search[/code] or [code]Find All[/code] action. Each row represents a record from the selected table, and each column represents one of the first eight fields from the selected table. Which fields are displayed in the[code] List[/code] page can be set in the [code]Field View Options[/code] panel, described later in this section. A number is displayed to the left of each record corresponding to its order in the found set. Selecting the record number link shows the [code]Detail[/code] page for the selected record by default. [/p]

Figure 7: List Page

[p]The sidebar displays the current database, table, and key field being used in the [code]Databases[/code] section. These can be changed by selecting new values in each pull-down menu, and then selecting the [code]Select[/code] button. Selecting a new database or table will automatically return all records in the new table in the [code]List[/code] page. [/p]

[p]The bottom right panel contains navigation controls allowing the administrator to view different sets of records from the found set. The [code]Next[/code] and [code]Previous[/code] buttons take the administrator to the next and previous sets in the found set. The [code]First[/code] and [code]Last[/code] buttons will take the administrator to the first and last record in the found set. The [code]Jump[/code] button allows the administrator to specify the record number from the found set in which to begin the list with. [/p]

[p]The bottom left panel contains sort options that allow the administrator to control how the records are sorted in the [code]List[/code] page. The [code]Sort Field[/code] pull-down menu contains the field by which the records are sorted, and the [code]Sort Order[/code] pull-down menu specifies whether the records are sorted in an ascending (A-Z, 1-9) or descending (Z-A, 9-1) order. The sort options can be changed by selecting a value from each pull-down menu and selecting the [code]Sort [/code]button. [/p]

Export

[p]Selecting the Export area in the sidebar allows the current results to be exported. Setting one or more options and then selecting Export Results will result in a text file being sent to the browser containg the current result set. [/p]

List Options

[p]Selecting the name of a field displays the [code]Field View Options[/code] panel in the lower left panel for that field. Doing so will limit the number of records shown in the [code]List[/code] page to one record while display options are set. [/p]

Figure 8: List Options

[p]The following input and display options can be edited for each field. [/p]

[p]Options are changed by selecting the desired values from the pull-down menus and selecting the [code]Apply[/code] button. The [code]Reset[/code] button returns all options to their default values. Selecting the [code]Hide Options [/code]button hides the [code]Field View Options[/code] panel and returns the administrator to the regular[code] List[/code] view with all records displayed. [/p]

Displaying Record Details

[p]The[code] Detail [/code]page displays the field data for the selected record. All fields in the record are displayed by default. [/p]

Figure 9: Detail Page

Record Detail

[p]The [code]Record Detail[/code] panel shows the field data for the record. The data type of each field is displayed to the right of the data for that field. Selecting the [code]Update[/code] button will take the administrator to the [code]Update [/code]page, while seecting [code]Delete[/code] button will display a confirmation dialog asking the administrator to confirm the delete. Once this is done, the administrator will be returned to the [code]List[/code] page. If a record is deleted, it cannot be retrieved. [/p]

[p]The sidebar displays the current database, table, and key field being used in the [code]Databases[/code] section. The key field of the current record may be changed by selecting a new key field from the [code]Key Field[/code] pull-down menu, and then selecting the [code]Select[/code] button. Since the database or table of the current record displayed cannot be changed, selecting a new database or table will return the administrator to the [code]Select[/code] page. [/p]

[p]The bottom panel contains navigation controls allowing the administrator to instantly switch to another record in the found set to be displayed in the [code]Detail[/code] page. The [code]Next[/code] and [code]Previous[/code] buttons take the administrator to the next and previous records in the found set. The [code]First[/code] and [code]Last[/code] buttons will take the administrator to the first and last record in the found set. The [code]Jump[/code] button allows the administrator to specify the record number from the search results of the record to be displayed. [/p]

[p]Selecting the [code]Show Options[/code] button displays the [code]Field View Options[/code] panel to the right with the first field selected. Here, the administrator may set field display options for each field. [/p]

Detail Options

[p]Selecting the name of a field in the [code]Record Detail[/code] panel displays the [code]Field View Options[/code] panel to the right for that field. [/p]

Figure 10: Detail Options

[p]The following input and display options can be edited for each field. [/p]

[p]Options are changed by selecting the desired values from the pull-down menus and selecting the [code]Apply[/code] button. The [code]Reset[/code] button returns all options to their default values. Selecting the [code]Hide Options [/code]button hides the [code]Field View Options[/code] panel. [/p]

Updating and Deleting Records

[p]The[code] Update[/code] page allows the administrator to update or delete records within a database, and displays all fields and their current values for the selected record by default. [/p]

Figure 11: Update Page

Updating Records

[p]The [code]Update Record[/code] panel shows the field data for the record within input fields. The input type that is used for each field can be specified in the [code]Field View Options[/code] page, described later in this section. The data type of each field is displayed to the right of the data for that field. [/p]

To update a record in a database:

  1. Enter the information you wish to update in the appropriate text field next to each field name. The data type of each field is displayed to the right by default.
  1. Select [code]Update Record. [/code]The results of an updated record are displayed in the [code]Detail [/code]page.
[p]To delete the current record from the table, select the[code] Delete [/code]button. A confirmation dialog will always be displayed asking the administrator to confirm the delete. Once this is done, the administrator will be returned to the [code]List[/code] page. If a record is deleted, it cannot be retrieved. [/p]

[p]The top and bottom panels of the [code]Update[/code] page act in the same manner as in the [code]Detail [/code]page. Selecting the [code]Show Options[/code] button displays the [code]Field View Options[/code] panel to the right with the first field selected. Here, the administrator may set field display options for each field. [/p]

Update Options

[p]Selecting the name of a field in the [code]Update Record[/code] panel displays the [code]Field View Options[/code] panel to the right for that field. [/p]

Figure 12: Update Options

[p]The following input and display options can be edited for each field. [/p]

[p]Options are changed by selecting the desired values from the pull-down menus and selecting the [code]Apply[/code] button. The [code]Reset[/code] button returns all options to their default values. Selecting the [code]Hide Options [/code]button hides the [code]Field View Options[/code] panel. [/p]

Importing Records

[p]The [code]Import[/code] page allows data to be imported to the selected table from a text file in a comma-delimited, tab-delimited, or XML format. Files can be uploaded from the local machine or can be placed in the [code]Lasso Professional Server/LassoAdmin/Browse[/code] folder. Uploaded files are placed in this folder and then imported. This is the same folder which the [code]Export [/code]section uses. [/p]

[note][b]Note: [/b]The data in import files is always imported in the same order as the fields in the database. There is no option to match fields or import data out of order. [/note]

Figure 13: Import Page

[p]The sidebar displays the current database, table, and key field being used in the [code]Databases[/code] section. These can be changed by selecting new values in each pull-down menu, and then selecting the [code]Select[/code] button. Selecting a new database, table, and keyfield will change the table to which data is imported. [/p]

Import File

[p]The [code]Import File [/code]panel allows the administrator to upload or select the file to be imported. These options are described below: [/p]

Import Settings

[p]The [code]Import Settings [/code]panel allows the administrator to set import options and see a preview of the data to be imported. This panel is only available when a file is selected in the [code]Import [/code]File panel. The options available are described below: [/p]

[p]Options are changed by selecting the desired values from the pull-down menus, selecting or deselecting a check box to the left of the desired options, and selecting the [code]Apply[/code] button. The [code]Reset[/code] button returns all options to their default values. [/p]

To import data to the current table:

  1. In the [code]Import File [/code]panel, select a data file to import from the [code]File Name[/code] pull-down menu or upload a file from the local machine. Select the [code]Apply[/code] button if no other options are shown.
  1. In the [code]Import Settings [/code]panel, select the data type of the text file from the [code]Type[/code] pull-down menu, or verify that the [code]Automatic[/code] type is correct by looking at the [code]Import Preview [/code]field.
  1. Select the line endings used in the text file in the [code]Line Endings[/code] pull-down menu, or verify that the [code]Automatic[/code] type is correct by looking at the [code]Import Preview [/code]field. Knowing which operating system the file was created in is helpful for determining which line ending characters are used.
  1. Select [code]Yes [/code]for [code]Replace Matching Key Values [/code]if you want the imported data to receive new key values in the current table. This is strongly recommended if data is being imported to a table with existing records, however, the field that is matched with the current key field will be overwritten.
  1. Select [code]Yes [/code]for [code]Skip First Record [/code]if the first record in the text file contains field names as opposed to values. See the [code]Import Preview [/code]field to determine this.
  1. Select the [code]Apply[/code] button.
  1. Select the [code]Perform Import [/code]button.

Exporting Records

[p]The [code]Export[/code] page allows the administrator to export data from a table to a text file in a comma-delimited, tab-delimited, or XML format. This feature allows the records in the current found set to be instantly exported to a text format that can be interpreted by any number of other data sources. [/p]

[p]Files can be downloaded to the local machine or can be exported to the [code]Lasso Professional Server/lassoAdmin/Browse[/code] folder. Downloaded files are first written into this folder and then streamed to the Web client. This is the same folder which the [code]Import [/code]section uses. [/p]

Figure 14: Export Page

[p]The sidebar displays the current database, table, and key field being used in the [code]Databases[/code] section. These can be changed by selecting new values in each pull-down menu, and then selecting the [code]Select[/code] button. Selecting a new database or table will automatically find all records in the new table, which will be the found set that is exported. [/p]

Export Settings

[p]The [code]Export Settings [/code]panel allows the administrator to set the format options in which the current found set will be exported. The [code]Type[/code] pull-down menu allows the administrator to select from one of three data formats to export to. The remaining options (which the exception of [code]Line Endings[/code]) will vary depending on which format is selected. [/p]

[p]Options are changed by selecting the desired values from the pull-down menus, selecting or deselecting a check box to the left of the desired options, and selecting the [code]Apply[/code] button. The [code]Reset[/code] button returns all options to their default values. [/p]

[p]Export Preview [/p]

[p]The [code]Export Preview[/code] page displays the first five records of what the exported data will look like in the text file. To preview all data to be exported, select the [code]Preview Full Export[/code] button. [/p]

[p]The [code]Perform Export[/code] button exports data to the [code]Lasso Professional Server/lassoAdmin/Browse[/code] folder. The [code]Download Export [/code]button opens a new browser window and automatically downloads the data. [/p]

To export data:

  1. In the [code]Export Format[/code] panel, select the data format to be exported to from the [code]Type[/code] pull-down menu.
  1. Select options for the specified format below the [code]Type[/code] pull-down menu.
  1. Select a line ending option from the [code]Line Endings[/code] pull-down menu.
  1. Select [code]Apply[/code].
  1. Examine the data to be exported in the [code]Export Preview[/code] panel to ensure it is the correct format needed for the data source that will import the file.
  1. Enter a name for the text file to be created in the [code]File Name[/code] field. To have the file name end with the date and time of creation, select [code]Yes[/code] from the [code]Append Date to File Name[/code] pull-down menu.
  1. Select the [code]Perform Export[/code] button or the [code]Download Export [/code]button.
[note][b]Note: [/b]The [code]Export[/code] page will only export the current found set from the [code]List[/code] page. To export all records in a table, make sure the [code]Find All Records[/code] button was selected previously in the [code]Select[/code] or [code]Search[/code] page. [/note]

[note][b]SQL [/b]Browser [/note]

[p]The Browse > SQL section of the Lasso Database Browser provides a Web-based interface that allows the administrator to issue SQL queries to Lasso-accessible SQL databases. This includes any SQLite, MySQL, or SQL-compliant JDBC database that has been set up and enabled in the Setup > Data Sources section of Site Administration. [/p]

Figure 15: SQL Browser

[p]The functionality of the Browse > SQL section is similar to that of the Utility > SQL section of Site Administration. For documentation on issuing SQL statements, see the Site Administration Utilities chapter. [/p]

Database Builder

[p]The [code]Build[/code] section of the Lasso Database Browser allows the administrator to create databases, tables, fields, and indices, and edit the schema of SQLite and MySQL database via a Web-based interface. This is useful for easily creating new MySQL databases for custom solutions, or for editing the schema (tables names, field names and types) of existing SQLite or MySQL databases. [/p]

Creating MySQL Databases

[p]The [code]Databases[/code] page is where the administrator can view all databases within a selected host and create new databases. The[code] Databases Listing[/code] panel shows a listing of all databases within the selected host and data source connector. [/p]

Figure 16: Databases Page

[p]The current data source connector and host can be changed using the [code]Connector[/code] and [code]Host[/code] pull-down menus. The administrator can view database details by selecting the database name, which will show the details to the right in the [code]Database Detail[/code] panel. [/p]

Creating Databases

[p]Selecting the [code]Create Database[/code] button displays the [code]Create Database[/code] panel to the right. The [code]Create Database[/code] page is where the administrator can create new databases within a specified data source host. [/p]

Figure 17: Create Database Panel

To create a new database:

  1. Enter the name of your database in the[code] Name[/code] field.
  2. [note][b]Note: [/b]Per naming conventions in SQLite and MySQL, database names may only consist of alpha-numeric characters plus the [code]_[/code] and [code]$[/code] characters. For more information on naming conventions, see the datasource documentation. [/note]
  1. Select [code]Enabled[/code] or [code]Disabled[/code] from the [code]Status[/code] pull-down menu to enable or disable the database within Lasso.
  1. Select [code]Create Database[/code].

Duplicating Databases

[p]Selecting the [code]Duplicate Database[/code] button shows the [code]Duplicate Database[/code] panel to the right. The [code]Duplicate Database[/code] panel is where the administrator can duplicate an existing database within a specified data source host. The administrator has the option to duplicate a database’s schema only (tables and fields), or the schema along with all data (records). [/p]

Figure 18: Duplicate Database Panel

To duplicate an existing database:

  1. Select the data source connector of the source database from the [code]Connector[/code] pull-down menu. This can be either [code]Lasso Connector for SQlite[/code] or [code]Lasso Connector for MySQL. [/code]
  1. Select the data source host of the source database from the [code]Host[/code] pull-down menu.
  1. Select the source database from the [code]Database[/code] pull-down menu.
  1. Select [code]Yes[/code] from the [code]Copy Data[/code] pull-down menu to copy all records from the source database to the new database. Selecting [code]No[/code] copies only the database schema (table and field structure) with no records.
  1. Enter the name of the new database in the[code] Name[/code] field.
  2. [note][b]Note: [/b]Per naming conventions in SQLite and MySQL, database names may only consist of alpha-numeric characters plus the [code]_[/code] and [code]$[/code] characters. For more information on naming conventions, see the datasource documentation. [/note]
  1. Select [code]Enabled[/code] or [code]Disabled[/code] from the [code]Status[/code] pull-down menu to enable or disable the database within Lasso.
  1. Select [code]Duplicate Database[/code]. The new database will appear in the [code]Database Listing[/code] panel to the left.

Updating and Deleting Databases

[p]The administrator may update or delete a database by selecting the [code]Update Database[/code] or [code]Delete Database[/code] button in the [code]Database Detail [/code]panel. To update a database, the administrator can change the name, alias, and status for the database via the [code]Name[/code], [code]Alias[/code], and [code]Status[/code] fields, and select the[code] Update Database[/code] button. Selecting the[code] Delete Database[/code] button will display a confirmation message for deleting the selected database, and selecting [code]OK[/code] will permanently delete the database. [/p]

Creating Tables

[p]The [code]Tables[/code] page is where the administrator can view all tables and create new tables within the selected database. The[code] Table Listing[/code] panel shows the current database and lists all tables within the database. The administrator can view table details by selecting a table name, which will show details to the right in the[code] Table Detail[/code] panel. [/p]

Figure 19: Tables Page

Creating Tables

[p]Selecting the [code]Create Table[/code] button show the [code]Create Table[/code] panel to the right. The [code]Create Table[/code] page is where the administrator can create tables in the selected database. [/p]

Figure 20: Create Table Panel

To create a table in the selected database:

  1. Enter the name of your table in the[code] Table Name[/code] field.
  2. [note][b]Note: [/b]Per naming conventions in SQLite and MySQL, table names may only consist of alpha-numeric characters plus the [code]_[/code] and [code]$[/code] characters. For more information on naming conventions, see the datasource documentation. [/note]
  1. Select [code]Enabled[/code] or [code]Disabled [/code]from the [code]Status[/code] pull-down menu to enable or disable the table within Lasso.
  1. Select [code]Create Table[/code].
[p]The [code]ID[/code] field is automatically created in each new table, which increments automatically with every new record added. There can only be one [code]ID[/code] field per table. [/p]

Duplicating Tables

[p]Selecting the [code]Duplicate Table [/code]button shows the [code]Duplicate Table [/code]panel to the right. The [code]Duplicate Table[/code] panel is where the administrator can duplicate an existing table within a specified database. [/p]

Figure 21: Duplicate Table Panel

To duplicate a table in the selected database:

  1. Select the data source connector of the source table from the [code]Connector[/code] pull-down menu.[code] [/code]
  1. Select the data source host of the source table from the [code]Host[/code] pull-down menu.
  1. Select the database of the source table from the [code]Database[/code] pull-down menu.
  1. Select the source table from the [code]Table[/code] pull-down menu.
  1. Select [code]Yes[/code] from the [code]Copy Data[/code] pull-down menu to copy all records from the source table to the new database. Selecting [code]No[/code] copies only the table schema (field structure) with no records.
  1. Enter the name of the new table in the[code] Name[/code] field. This new table will contain the information being duplicated, and will be created within the database currently selected in the [code]Table Listing[/code] panel.
  2. [note][b]Note: [/b]Per naming conventions in SQLite and MySQL, table names may only consist of alpha-numeric characters plus the [code]_[/code] and [code]$[/code] characters. For more information on naming conventions, see the datasource documentation. [/note]
  1. Select [code]Enabled[/code] or [code]Disabled[/code] from the [code]Status[/code] pull-down menu to enable or disable the table within Lasso.
  1. Select [code]Duplicate Table[/code]. The new table will appear in the [code]Tables Listing[/code] panel to the left.

Updating and Deleting Tables

[p]The administrator may update or delete a table by selecting the [code]Update Table[/code] or [code]Delete Table[/code] button in the [code]Table Detail[/code] panel. To update a table, the administrator can change the name, alias, and status for the table via the [code]Name[/code], [code]Alias[/code], and [code]Status[/code] fields, and select the [code]Update Table[/code] button. Selecting the [code]Delete Table [/code]button will display a confirmation message for deleting the selected table, and selecting [code]OK[/code] will permanently delete the table from the selected database. [/p]

Creating Fields

[p]The [code]Fields [/code]page is where the administrator can view all fields within the selected table and database. The [code]Fields Listing[/code] panel includes a list of fields for the current table including all their editable attributes and the option to delete fields. [/p]

[p]The SQL statement that will be used to modify the table can be viewed by selecting the [code]Preview Change[/code] button. The modifications can be applied to the table by selecting the [code]Alter Table[/code] button. [/p]

[p]In addition to modifying the fields within the table, one field can be added by specifying its attributes in the [code]New[/code] line at the end of the table. If more fields need to be added the [code]Create Fields[/code] section can be used. [/p]

Figure 22: Fields Page

[p]Each field includes the following details. [/p]

Creating Fields

[p]The [code]Create Fields[/code] panel allows multiple fields to be created all at once. This section allows up to ten fields to be created at once. The SQL statement that will be used to modify the table can be viewed by selecting the [code]Preview Change[/code] button. The modifications can be applied to the table by selecting the [code]Alter Table[/code] button. [/p]

Figure 23: Create Field Panel

[p]The options for each field are the same as those for modifying fields in the [code]Field[/code] section. [/p]

Creating Indices

[p]The database browser allows the indices of SQLite and MySQL tables to be manipulated. [/p]

[p]An index in a MySQL database is an ordered list of the contents of a field or group of fields in a table (also known as the [code]MYI[/code] file in the MySQL database folder). Indices in MySQL databases allow faster searches to be performed for the fields specified, and up to 25 indices can be specified for a MySQL table. For more information on MySQL indices, see the MySQL documentation. [/p]

[p]The [code]Indices[/code] page allows to administrator to view the current indices for a selected table, as well as create new indices that contain one or more fields. [/p]

Figure 24: Indices Page

[p]The [code]Index Listing[/code] panel shows a list of current indices in the current table. The administrator can view details for an index by selecting the index name, which will show the details in the [code]Index Detail[/code] panel to the right. [/p]

Creating Indices

[p]Selecting the [code]Create Index[/code] button show the [code]Create Database[/code] panel to the right. The [code]Create Index[/code] panel is where the administrator can create new indices for the selected table. Unlike setting the index options for individual fields in the [code]Fields[/code] page, indices created in the [code]Index Detail[/code] panel may contain more than one field. A single index may contain up to 16 unique fields. To learn about the benefits associated with multiple field indexing, see the datasource documentation. [/p]

Figure 25: Create Index Panel

To create a new index:

  1. Type a name for the index.
  1. Select the fields that will comprise the index. In MySQL the entire lenght of [code]CHAR[/code] or [code]VARCHAR[/code] fields will be index and the first 255 characters of [code]TEXT[/code] fields.
  1. Select the type of index. The following types are available.
  1. Select the [code]Create[/code] button The new index should appear in the[code] Index Listing [/code]panel to the left.
[note][b]Note: [/b]Primary key fields can be established in the Fields section. [/note]

Index Detail

[p]The [code]Index Detail[/code] panel shows all information available from the database for the selecting index. The following information is displayed: [/p]

[p]The administrator may delete an index by selecting the [code]Delete[/code] button in the [code]Index Detail [/code]panel. Indices cannot be edited, only created and deleted. A confirmation message will always be displayed before an index is deleted. [/p]