DatumHueEnterprise v0.0.24datumhue.com
Contents

Save data between runs

Keep what your app needs next time, such as settings, progress or a cache, in a store that is still there after your app quits.

Your package's own store

storage.open opens your app's own store, which keeps bytes under string keys. The store follows your package: the same package reaches the same data in every run, in every copy running at once and in every later version, and no other app can open it. Give storage.open a label to open another store of the same package, kept apart from the first.

notes.lualua
local bytes = datumhue.bytes
local storage = datumhue.storage

-- This package's own store: count the runs.
local own = storage.open()
local saved = own:get("runs"):ready().value
local runs = (saved and saved:json() or 0) + 1
own:set("runs", bytes.json(runs)):ready()
print("runs: " .. runs)

-- A second store of the same package, kept apart by its label.
local drafts = storage.open("drafts")
drafts:set("today", bytes.json({ "flour", "eggs" })):ready()
drafts:set("tomorrow", bytes.json({ "butter" })):ready()
local keys = drafts:list():ready().value
print("drafts: " .. table.concat(keys, ", "))

-- Every package under the same scope sees this store.
local team = storage.open_scoped("shared-notes")
team:set("hello", bytes("from notes")):ready()

-- Every app that passes the same UUID sees this one.
local board_id = "1b4e28ba-2fa1-11d2-883f-0016d3cca427"
local board = storage.open_shared(board_id)
print("board keys: " .. #board:list():ready().value)

In this example: datumhue.bytes datumhue.storage datumhue.storage.open Storage:get BytesFetch:ready BytesFetch.value Bytes:json Storage:set datumhue.bytes.json Op:ready Storage:list ListFetch:ready ListFetch.value datumhue.storage.open_scoped datumhue.storage.open_shared

The first run prints runs: 1, the next runs: 2, and so on.

  • A store holds Bytes. Turn a table or a number into bytes with datumhue.bytes.json, and back with Bytes:json.
  • Storage:get returns a fetch that waits for the value; its value is nil when the key is not there. Storage:set and Storage:delete start at once and return an operation.
  • :ready() waits for a fetch or an operation, and raises if it failed. Waiting explains these handles, and how to wait for several at once.
  • Storage:list lists the keys in order, or those that start with a prefix you give it.

Who else sees a store

Opened withShared with
storage.openthis package only
storage.open_scopedevery package under the same scope, such as @alice
storage.open_sharedevery app that passes the same UUID

A store shared by UUID is as private as the UUID. One written into published code is public; one your app keeps to itself works as a key. datumhue.uuid makes a new one.

An app your app starts from Lua source opens your package's stores. Start it with storage = "own", and it opens stores of its own instead, kept between runs (Launch other apps).

A package you run from a folder or a file with datumhue run is known by its name alone. Any app you run that way under the same name opens the same stores, so they are as private as your workstation.

A package installed from the catalog is also known by where it came from. It opens other stores than the same package run from a folder, so trying out your code never touches the data of the installed copy.

See also

Reference used on this page: datumhue.bytes datumhue.storage datumhue.storage.open Storage:get BytesFetch:ready BytesFetch.value Bytes:json Storage:set datumhue.bytes.json Op:ready Storage:list ListFetch:ready ListFetch.value datumhue.storage.open_scoped datumhue.storage.open_shared Storage:delete datumhue.uuid

datumhue.com

(c) 2026 Shuusei AB. Quote excerpts of this manual, with attribution to DatumHue, in your own documentation, tutorials, course materials, reviews, and other writing or video. Republishing it in whole or in substantial part needs written permission: support@datumhue.com.

Victor Mono is licensed under the SIL Open Font License 1.1
Copyright (c) 2024, Rune Bjørnerås (https://github.com/rubjo)

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

Try

    ↑↓ selectEnter openTab filter

    Settings

    Theme
    Text
    Print

    Keyboard shortcuts

    / or Ctrl KSearch
    ↑ ↓ EnterPick a result
    TabNext result filter
    j kNext or previous entry
    [ ]Previous or next page
    yCopy a link to the current entry
    ?These shortcuts
    EscClose

    On this page