Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Feature Request: SQLSCRIPT - Dynamic Type Naming #2230

Description

@DMCTowns

There are scenarios where being able to set the Type name in a query dynamically would be useful. For example:

LET sources = SELECT FROM Sources WHERE id='abc';
IF($sources.size() > 0){ 
  LET source = $sources[0];
  LET type = $source.type;
  LET target = SELECT FROM $type WHERE id='abc';
  CREATE EDGE IS_SOURCED_FROM FROM $target TO $source IF NOT EXISTS;
};

Currently, this isn't supported and would lead to the error on line 5:

Type with name '$type' was not found

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request
No fields configured for Feature.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions