You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently trying to implement a Database via my own class. Hence, I define my database via the use of local variables rather than global ones, as, naturally, there is no dedicated syntax for this database type yet (such as in the case of Relational Databases). However, the router component heavily invokes the function elementToPath on store objects that are present in the mapping object handed over to the execute function. The function elementToPath, however, errors when invoked on objects that do not exist globally but are rather bound via local variables.
Potential Solutions:
This is the problematic code segment of elementToPath:
function meta::pure::functions::meta::elementToPath(element:PackageableElement[1], separator:String[1]):String[1]
{
let path = $element->elementPath();
if($path->size() == 1,
| let first = $path->at(0);
if(is(::, $first),
| '',
| $first.name->toOne());,
| $path->tail()->map(e | $e.name)->joinStrings($separator));
}
If $first does not have a name attribute, the call to toOne() errors. My current workaround is to provide a name attribute to my custom Store. However, I guess this is rather a hack, as in reality, my local object does not have a package path.
One solution would be to provide a wrapper type that lets me expose my custom store as a packagable element so that calls to that functions do not error. Does such a type/solution exist?
The text was updated successfully, but these errors were encountered:
Feature Request / Question
Description of Problem:
I am currently trying to implement a Database via my own class. Hence, I define my database via the use of local variables rather than global ones, as, naturally, there is no dedicated syntax for this database type yet (such as in the case of Relational Databases). However, the router component heavily invokes the function
elementToPath
on store objects that are present in the mapping object handed over to theexecute
function. The functionelementToPath
, however, errors when invoked on objects that do not exist globally but are rather bound via local variables.Potential Solutions:
This is the problematic code segment of
elementToPath
:If
$first
does not have aname
attribute, the call totoOne()
errors. My current workaround is to provide aname
attribute to my custom Store. However, I guess this is rather a hack, as in reality, my local object does not have a package path.One solution would be to provide a wrapper type that lets me expose my custom store as a packagable element so that calls to that functions do not error. Does such a type/solution exist?
The text was updated successfully, but these errors were encountered: