Skip to content

Feature Request: SQLSCRIPT - Dynamic Type Naming #2230

@DMCTowns

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

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions