assignment operators (:=) with .esdl / REPL
#5466
-
|
Hi there, Was using the edgedb UI and was interested in the assignment operator ( We can see that in the example below where Schema type SensorType {
required property name -> str;
optional link brand -> SensorBrand;
}
type SensorBrand {
required property name -> str;
}edgedb UIinsert4 :=
insert default::SensorBrand {
name := <std::str>"Cool Sensor"
}
insert3 :=
insert default::SensorType {
name := <std::str>"Data Logger",
brand := insert4
}But if I copy past this example into the REPL it doesn't let me assign the output to a variable. Is there a possibility to use this method when writing queries? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
I'm not sure what magic UI does to make the above work. Here is how you should write the complete query instead: I.e you should use |
Beta Was this translation helpful? Give feedback.
I'm not sure what magic UI does to make the above work. Here is how you should write the complete query instead:
I.e you should use
WITHto declare variables (views) before the query, and after thewithblock some query should happen. In my example it's the lastinsert, but you could useSELECT (insert4, insert3)instead.