terminusdb-client-js
terminusdb-client-js copied to clipboard
Support for isolated variables would be helpful
Is your feature request related to a problem? Please describe. Today, generated variables are AFAIK not generated with unique names, which is an advantage in some scenarios. In other scenarios, it is helpful to get isolated variables. Thus, adding a flag to get variables with a cryptographically unique id as a suffix would help make them local
Describe the solution you'd like
Add an optional flag to the WOQL.vars()
function to generate unique variable names.
Describe alternatives you've considered Write a local function in own code for it.
Additional context Adding the feature request to get a conversation going.
A locally scoped variable would thus be created like so:
const [localVariable] = WOQL.localVars("localVariable")
As the vars is bound to take all parameters, it would not look nice to have the last for first one be a boolean for local, probably better to introduce localVars.