Database View
Central to this view is a list in which the tables (aka object stores) belonging to a database are displayed. If it is an empty database that does not contain any tables, there is a link that can be used to invoke Create Table.
In the database view, the icon in the window title bar opens the database tools, while the icon opens the configuration options that apply to this database and serve as default settings for the tables it contains.
Clicking on the database part of the breadcrumb navigation reloads the database list or returns to it if a datatable is displayed in the current view.
Table List
For each table, its name, its primary key and further indexes, and the number of records it contains are displayed.
If you hover one of the rows, another icon will appear next to the row, which can be used to open the table tools. To switch to the view of one of the data tables, click on the corresponding row in the table.
Database Tools
To invoke the database tools use either the gear icon in the window title bar of the database view or the same icon next to a database row in the origin view. You can choose to export the database, create a copy, edit the database schema, create additional tables, import data or to delete the database.
Export Database
The database export uses the dexie format for the output file, a json-based format that supports all data types (beside CryptoKey) that can be stored in IndexedDB databases.
Hovering the icon displays the export options that will be applied. To adjust the export options, click the icon on the right. The export options are documented in Configuration / Export.
Copy Database
The database name is pre-filled with a unique name for the copied database and the database version with the version of the source database.
If only an empty database with the schema of the source database is to be created, the default option copy data must be deselected.
The last checkbox controls what happens after the action is completed: switch to the table list of the newly created database or keep the current view.
Edit Schema
Using the schema editor, new object stores can be created: Clicking the icon adds a row to the table in which a table name, the primary key and additional indices can be specified. Clicking the icon at the end of a row deletes object stores. Only after execute is the database schema updated, before that the changes can be undone with reset. The close button discards all changes made and terminates the schema editor.
The only restrictions for the name of a new table are that it must be unique in the database and that it is a non-empty JavaScript string. Renaming existing tables is not supported; instead, copy table must be used.
To define the indices, the syntax introduced by the Dexie library is used. In short: ++ represents an auto-incrementing primary key, an ampersand & denotes a unique key, and an asterisk * a multi-entry array index. Square brackets [ ] around a list of identifiers represent a compound index. Identifiers for an index or the parts of a compound index must be valid JavaScript identifiers, possibly with periods as separators if they are key paths to inner object properties.
In the input fields of the Indexes column, several indexes can be defined for a table, separated by commas. Changing the primary key of an existing table is not possible.
Create Table
If create table is selected, you can enter the name for a new table and a string representation of the indexes to be created for the table. Any string is allowed as the table name, with the only restriction that it must be unique within the database.
Within the indexes string, the individual indexes are separated by commas. Since the keypaths parts of an index refer to object properties, a valid keypath consists of valid JavaScript identifiers, possibly separated by dots. The complete syntax for index strings is described in the dexie documentation.
As with all actions that change the database schema, the database version is increased.
Import Data
Under import data in the Database Tools, a file in dexie format can be selected. This file can contain the export of an entire database, the export of a single table, or the export of selected data records from a table, depending on whether it was created in the Database Tools, the Table Tools, or the Selection Tools.
Hovering the icon displays the import options that will be applied. To adjust the import options, click the icon. The import options are documented in Configuration / Import.
Delete Database
After confirmation, the selected database will be permanently deleted. To avoid damage, it is always a good idea to create a backup beforehand using export database.