Databases are a critical part of most Websites and WebApps. They have the ability to store and retrieve information. Thorium Builder's Data Manager is a powerful resource for building database functions within your website or WebApp. Its simplicity of use belies its strength and power.
SQLIte Database is supported for Web Projects and PWA Projects.
Database App are powered by SQLLite version 3, you must make sure that your Hosting Provider supports SQLite v3 with fts5 Module enabled (this is the SQLLite Full-text search Engine).
You can disable FTS5 for your project if required (see DB Tools) You must make sure that the project folder db/webservices/dbfile has at least read-write permissions (600).In order to check your configuration, you can install the phpLiteAdmin Tool ( https://www.phpliteadmin.org ) in your DB folder (db/webservices/dbfile) in order to check the SQLite configuration
Thorium Builder uses a hierarchical database structure. A hierarchical database is a database in which the data is organized into a tree-like structure. You can envision this structure as you might a tree of family members. First, you have the parents. Then, you have the children. Then, you have the children’s children and so on.
An example of a hierarchal database can be seen below in a Travel Blog: the first level (the parent) could be “North America". The second level (the child), could be the “The countries of North America”. The third level (the child’s children) could be “cities” visited in North America (parent).See the included illustration below:
The Data Hierarchy selector defines the depth of the level of records that you want to display.
There are three settings:
1. All Hierarchy (default) : all the records for the selected category are displayed.
2. Root Records Only: Only the records at the first level of the database category will be displayed.
In our Travel Blog example, this selection would display the “parent” record of North America.
3. Show Only Current record Child:
Again, in the Travel Blog example, this selection would show only the “child" of the of the selected “parent". In this case, it would show Canada as the child of North America.
Use the Database Displayer Widgets on a Thorium Builder web page to display the data in a database.
Note that you can create a sophisticated hierarchical database, just by dragging & dropping items within the Data Manager Display Area. In this way, you can create a hierarchy with unlimited parent-child records.
Open the Data Manager from the Thorium Builder toolbar or from the File Menu as represented above. The Data Manager functionality is not available in the Fre Edition of Thorium Builder.
The initial Data Manager Window includes a toolbar of selectors, a list of database Categories , and a Database Display Area . When a Category is selected, the Database Display Area reveals the data that is currently in that database Category .
The Left side of the Data Manager Window shows the Category Manager. It displays the various Categories that are available for the records within the Database. You can create, rename or delete categories by using the settings icon (1) at the bottom of the Category Manager . (See the illustration)When you click on the Category Manager settings icon (1) at the bottom of the list. A new Categories Editor (2) will open up. Here, you can add +, delete -, or rename the categories in the editor. Use the close button when finished updating your categories.
The Data Manager Toolbar offers a number of selector buttons. Each of these buttons provides more options. The buttons that give an immediate response from the Toolbar are explained first in this document. The more complex selectors have links located at the bottom of this document that will take you to in-depth explanations for each selector.
The Search feature of Thorium Builder gives you the option to search and display specific information from the database.(This search box will be disabled if you disable FTS5)
The DBTool Module grants you an access to SQLite advanced tools.The first option (Optimize) , will execute the VACUUM command on the user database.The VACUUM command rebuilds the database file, repacking it into a minimal amount of disk space.See SQLite documentation for more information: https://sqlite.org/lang_vacuum.html
The Second option (Disable/enable FTS5) will let you control whether or not you want to use the SQLite full-text engine.If your hosting provider supports FTS5, then it is better to keep it enabled, but some providers are supporting SQLite without FTS5, which may have for result that your Database will simply not work. (Then disabling FTS5 will fix the issue).?ote: disabling FTS5 will disable the full text features for your project.For more information about FTS5, read the SQLite documentation at
The third option “Rebuild Full-Text” will simply recalculate the FTS5 index.In general you should never have to use it, as the full text index is recalculated automatically.