ShortcutDB

Database for Apple Shortcuts

Easy to use module which adds key-value database to your shortcut. It uses iCloud Files to store all information in one file and keeps history of all changes. With auto-update.
Demo: the example which uses ShortcutDB internally. It asks you to install the database, if you don't have it yet, then shows a popup with two options: set and get to insert or retrieve information from the DB.

How to use it in your shortcut
Pass a dictionary as an input to a ShortcutDB. Dictionary must have the operation field:

operation:
  • set - set value for some key
  • get - get value by some key
I use text dictionary representation here, but you must use Dictionary action from Apple Shortcuts. If the operation is get, your dictionary must contain the key:


{
    "operation": "get",
    "key": "my-username",
}                       
If the operation is set, your dictionary must contain the key and the value fields:

{
    "operation": "get",
    "key": "my-username",
    "value": "user_1",
}                       

All request parameters
  • operation
  • key
  • value
  • db_name specify name for the database. database by default.
  • disable_check_update - if presented and has any value, disables update checks.
Database is stored in files://Shortcuts/shortcut_db/{{db_name}}.
Be careful and don't store sensitive data, the DB's file is not encrypted. :)
ShortcutDB uses great module UpdateKit (by Mike Beasley) to provide auto-updates feature. It checks once a day if there is a new version and if it exists - suggests to update the DB.