eg.
MATCH (n:Person)
DELETE n
This would involve adding delete <identifier> to the parser, and extending the frontend to understand it, so that it emits an additional LogicalPlan operator. See how the CREATE operator is added here. The delete operator would be saying "delete the thing in slot X", where "slot x" is the slot that the n identifier go assigned to.
You can check that an identifier has a slot assignment (as a result of a match or a create clause) by converting the string you get out of the parse to a Token (via pc.tokenize(..)) and then calling pc.is_bound(..), like this.
The create PR has examples of one approach to writing tests here.
Finally, you'll need to modify the GRAM backend to panic or something if it gets a logical plan with delete in it, for now.
eg.
This would involve adding
delete <identifier>to the parser, and extending the frontend to understand it, so that it emits an additional LogicalPlan operator. See how the CREATE operator is added here. The delete operator would be saying "delete the thing in slot X", where "slot x" is the slot that the n identifier go assigned to.You can check that an identifier has a slot assignment (as a result of a match or a create clause) by converting the string you get out of the parse to a
Token(viapc.tokenize(..)) and then callingpc.is_bound(..), like this.The create PR has examples of one approach to writing tests here.
Finally, you'll need to modify the GRAM backend to panic or something if it gets a logical plan with delete in it, for now.