Saturday, October 14, 2017

Tutorial Post 20: Using IndexedDB.

Mki3d can now (since version 0.11) store your designs in IndexedDB.
IndexedDB is an internal local database managed by the related browser.
The 'IndexedDB Menu' in mki3d can be invoked by a key sequence 'QB'.


On this menu you can:

  • press the key 'A' to store the current design in the database, or
  • press the key 'I' to start 'Inspecting IDB' sub-menu for inspecting the database.
Thus, to store your design, you only have to press the key sequence 'QBA'.
The entry is stored with the following attributes: its name and creation date.
You do not need to change the name, since the database can contain many entries with the same name. It is convenient for storing many intermediate versions of your design, or if you do not want to waste your time for inventing the name or deciding where to save the data in the  file system.
(Remember that you always can set the current name on the 'Inputs Page'.)


When you inspect the database the entries are sorted by the date and you can preview the stored designs as they where visible on the screen when they where stored.
You start inspecting from the last stored one.



You can cycle through the sequence of entries backward or forward by pressig 'P' or 'N' or arrow keys.
If the database contains too many entries, you can filter them: Press 'F' to invoke the 'IDB Filters' sub-menu.


Here you can set the bounds (or single bound) of dates' range and a sub-string that the filtered entries must contain in their name.
Press 'Enter' key  to confirm or 'Esc' to cancel, and return to 'Inspecting IDB'.

While inspecting the database  you can also merge,  load, or remove the entry. Each of these actions requires confirmation:



You have to press precisely the 'Y' key to confirm. Pressing any other key cancels the action.

The last option on 'Inspecting IDB' sub-menu is 'V' that hides the menu and cursor to show you the  the preview in full display.

The IndexedDB can be convenient for rapid storing and previewing of your  designs. However, I would recommend that you still save copies of your more precious designs outside the browser: Use 'QFS' key sequence to invoke saving in the files, or by copying text from text areas.
The persistence of your data in IndexedDB may depend on the policy of the browser's producer.