Skip to content

Insert independently of match and delete #254

@nikolaimerritt

Description

@nikolaimerritt

Description

Calling match and delete with one variable, and insert with another, results in a TypeQL Error. The insert should be independent of the match and delete.

Environment

  1. OS (where TypeDB server runs): Mac OS 12.6
  2. TypeDB version (and platform): TypeDB Cluster 2.13
  3. TypeDB client: TypeDB Studio 12.13

Reproducible Steps

Steps to create the smallest reproducible scenario:

  1. Create the minimal schema
define 

name sub attribute,
    value string;

person sub entity,
    owns name @key;
  1. Run the minimal query
match  $a isa person, has name "alice"; delete  $a isa person;
insert $b isa person, has name "bob";

Expected Output

alice to be deleted, if exists. bob to be created.

Actual Output

The TypeQL error is generated

[TQL18] TypeQL Error: None of the variables in 'insert' ('[$b isa person,
    has name "bob"]') is within scope of 'match' ('[$a]')

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions