In-memory Records
In-memory records function like on disk records, but they exist in the temporary memory of your device (RAM). Use in-memory standards by prepending the table declaration with a $.
In-memory Tables
To initialize in-memory tables, you do not need records or an initialized table for that Standard. Let's start with an example:
item: ITM {
protected name string NM *
protected price double PR *
}
This Standard has two constraints, both of which are required. We can use a Standard record creation query to make some items.
$[item] + ("Shirt", 25.99)
$[item] + ("Pants", 25.99)
We created two records for the item Standard in-memory by calling $[item].
We can replicate the records of the existing on-disk records into RAM by calling the below but will overwrite the records in-memory for the selected Standard.
load $[item]
If we make changes, those changes are only made to the data in memory.
#Deletes the shirt in-memory
$[item] - <name "Shirt">
We can sync the in-memory changes to the on-disk records with one simple move:
sync $[item]