Programmatic / embedded
Outside the server (in tests, an embedded store or an import tool), build the Datamodel yourself
with the same methods, then open a store on it:
var datamodel = new Datamodel();
datamodel.AddNamespace<IVenue>();
datamodel.Add<IEvent>();
// on disk in the folder "data"; DataStoreLocal.Open(datamodel) alone keeps the store in memory
var datastore = DataStoreLocal.Open(datamodel, new SettingsLocal(), new IOProviderDisk("data"));
using var db = new NodeStore(datastore);Add every type before the store is created: adding to a datamodel that is already initialized
throws. Under the server, OnDatamodelInit is the place for this.